A RESTful backend for Project Camp, built with Node.js, Express, and MongoDB. It provides secure authentication, project management, task management, role-based access control, and email-based account workflows.
- JWT Authentication (Access & Refresh Tokens)
- Email Verification
- Forgot & Reset Password
- Project CRUD Operations
- Task & Subtask Management
- Notes Management
- Role-Based Project Member Management
- Request Validation
- Cookie-Based Authentication
- Centralized Error Handling
- Node.js
- Express.js
- MongoDB + Mongoose
- JWT
- Nodemailer
- Multer
- Express Validator
- Node.js (v18+ recommended)
- MongoDB (Local or Atlas)
- npm
Clone the repository and install dependencies:
git clone <repository-url>
cd project_camp
npm installCreate a .env file in the project root.
API_KEY =
PORT=8000
CORS_ORIGIN = *
MONGO_URL=<your_mongodb_connection_string>
ACCESS_TOKEN_SECRET=<your_access_secret>
ACCESS_TOKEN_EXPIRY = '12h'
REFRESH_TOKEN_SECRET=<your_refresh_secret>
REFRESH_TOKEN_EXPIRY = '2d'
SERVER_URL=http://localhost:8000
FORGOT_PASSWORD_REDIRECT_URL = http://localhost:8000/forgot-password
MAILTRAP_SMTP_HOST=
MAILTRAP_SMTP_PORT=
MAILTRAP_SMTP_USER=
MAILTRAP_SMTP_PASS=
SERVER_URL = ""Start the development server:
npm run devStart the production server:
npm startThe server will be available at:
http://localhost:8000
src/
├── controllers/
├── middlewares/
├── models/
├── routes/
├── utils/
├── db/
├── constants/
└── index.js
- Register
- Login
- Logout
- Refresh Access Token
- Verify Email
- Resend Verification Email
- Forgot Password
- Reset Password
- Get Current User
- Create Project
- Get Projects
- Update Project
- Delete Project
- Manage Project Members
- Update Member Roles
- Create Task
- Update Task
- Delete Task
- Manage Subtasks
- Create, Update, Delete Notes
- Verify server status
npm install # Install dependencies
npm run dev # Start development server using Nodemon
npm start # Start production serverProtected routes require a valid JWT Access Token. Authentication tokens are issued during login and managed using HTTP cookies.