Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Camp Backend

This repository contains the backend API for Project Camp, a collaborative project management system built with Node.js, Express, and MongoDB.

🚀 Features

  • User registration, login, JWT-based authentication
  • Email verification, password reset, refresh tokens
  • Role-based authorization (Admin, Project Admin, Member)
  • Project management (create, list, update, delete)
  • Team member management within projects
  • Task and subtask management, including file attachments
  • Project notes (CRUD)
  • Healthcheck endpoint
  • Data validation, error handling, and response formatting

📁 Project Structure

package.json
PRD.md
README.md
src/
  app.js           # Express application setup
  index.js         # Server entry point
  db/              # MongoDB connection
  controllers/     # Route handlers
  middlewares/     # Custom middleware (auth, validation, multer)
  models/          # Mongoose schemas
  routes/          # Express routers for each area
  utils/           # Helpers (ApiError, ApiResponse, mail)
  validators/      # express-validator rules
public/            # Static files & uploads

⚙️ Setup

  1. Install dependencies

    npm install
  2. Environment variables Create a .env file in the project root with the following (example):

    PORT=3000
    MONGO_URI=mongodb://localhost:27017/projectcamp
    ACCESS_TOKEN_SECRET=your_secret
    REFRESH_TOKEN_SECRET=another_secret
    FORGOT_PASSWORD_REDIRECT_URL=http://localhost:3000/reset-password
    CORS_ORIGIN=http://localhost:5173
  3. Start the server

    node src/index.js
    # or use nodemon if installed
  4. API base URL http://localhost:3000/api/v1

📌 API Overview

Authentication (/auth)

  • POST /register – create account
  • POST /login – authenticate
  • POST /logout – clear tokens
  • GET /current-user – get profile
  • POST /change-password
  • POST /refresh-token
  • GET /verify-email/:token
  • POST /forgot-password
  • POST /reset-password/:token
  • POST /resend-email-verification

Projects (/projects)

  • GET / – list user projects
  • POST / – create project
  • GET /:projectId – project details
  • PUT /:projectId – update (Admin only)
  • DELETE /:projectId – delete (Admin only)
  • Member routes under /projects/:projectId/members

Tasks (/tasks)

  • GET /:projectId – list tasks
  • POST /:projectId – create task
  • GET /:projectId/t/:taskId – task details
  • PUT /:projectId/t/:taskId – update task
  • DELETE /:projectId/t/:taskId – delete task
  • Subtasks under /tasks/:projectId/t/:taskId/subtasks and /tasks/:projectId/st/:subTaskId

Notes (/notes)

  • GET /:projectId – list notes
  • POST /:projectId – create note (Admin only)
  • GET /:projectId/n/:noteId – note details
  • PUT /:projectId/n/:noteId – update note (Admin only)
  • DELETE /:projectId/n/:noteId – delete note (Admin only)

Healthcheck

  • GET /healthcheck – server status

🛠️ Technologies

  • Node.js & Express
  • MongoDB via Mongoose
  • express-validator for input validation
  • Multer for file uploads
  • JWT for authentication
  • Nodemailer (via utils/mail) for emails

✅ Testing

Use Postman or similar to hit the endpoints. A sample collection should include:

  • Auth folder (register, login, etc.)
  • Projects folder with member operations
  • Tasks folder with subtasks and attachments
  • Notes folder

📝 License

MIT License.


Feel free to fork and extend!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages