A full-stack task manager built with React + Vite on the frontend and Node.js + Express + MongoDB on the backend.
- User signup and login with JWT auth
- Protected task routes
- Create, read, update, and delete tasks
- Tailwind CSS UI
- Docker Compose support for MongoDB
- Frontend: React, Vite, React Router, Axios, Tailwind CSS
- Backend: Node.js, Express, Mongoose, JWT, bcryptjs
- Database: MongoDB
task-manager/
client/ # React frontend
server/ # Express API + MongoDB models/routes
docker-compose.yml # MongoDB container (optional for local dev)
cd server
npm install
cd ../client
npm installCreate server/.env:
MONGO_URI=mongodb://localhost:27017/task-manager
JWT_SECRET=your_super_secret_key
PORT=5000Create client/.env:
VITE_API_URL=http://localhost:5000/apiChoose one option:
- Local MongoDB installation, or
- Docker Compose from project root:
docker compose up -dNote: The included docker-compose.yml uses MongoDB root credentials. Update it before using in shared environments.
Terminal 1 (backend):
cd server
npm run devTerminal 2 (frontend):
cd client
npm run devFrontend runs on Vite default URL (typically http://localhost:5173).
npm run dev- start API server (server.js)npm test- placeholder test script
npm run dev- start Vite dev servernpm run build- create production buildnpm run preview- preview production buildnpm run lint- run ESLint
Base URL: http://localhost:5000/api
POST /auth/signupPOST /auth/login
POST /tasksGET /tasksPUT /tasks/:idDELETE /tasks/:id
Auth header format:
Authorization: <jwt_token>- The frontend includes
client/vercel.jsonrewrite support for SPA routing. - The backend requires
MONGO_URIandJWT_SECRETat runtime. server.jsvalidates required env vars on startup and exits if missing.
- Signup currently returns the created user document.
PUT /tasks/:idandDELETE /tasks/:iddo not enforce task ownership checks.- Auth and task routes do not yet include comprehensive validation/error handling.
- Add request validation (
zod,joi, orexpress-validator) - Enforce task ownership in update/delete operations
- Add centralized error middleware
- Add backend tests for auth and task routes
- Add frontend loading/error states and notifications