A full-stack task management application with a modern Next.js frontend and Node.js/Express backend.
task-manager-app/
├── backend/ # Node.js + Express + MongoDB API
│ ├── config/ # Database connection
│ ├── controllers/ # Route handlers
│ ├── middleware/ # Auth middleware
│ ├── models/ # Mongoose models
│ ├── routes/ # API routes
│ ├── .env # Environment variables (do NOT commit)
│ └── server.js # Entry point
├── frontend/ # Next.js 16 + Tailwind + shadcn/ui
│ ├── app/ # Next.js App Router pages
│ ├── components/ # UI components (shadcn/ui + custom)
│ ├── lib/ # API client, auth context, utilities
│ ├── hooks/ # Custom React hooks
│ ├── .env.local # Local env vars (do NOT commit)
│ └── next.config.mjs
└── README.md
- Node.js 18+
- npm or pnpm
- MongoDB Atlas account (or local MongoDB)
cd backend
npm installEdit .env with your values:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secure_random_secret
FRONTEND_URL=* # or your specific frontend URL in productionStart the backend:
npm run dev # development (nodemon)
npm start # productioncd frontend
npm install # or: pnpm installEdit .env.local:
NEXT_PUBLIC_API_URL=http://localhost:5000Start the frontend:
npm run dev # development → http://localhost:3000
npm run build # production build
npm start # production server- Push
backend/to a Git repo - Deploy to your platform of choice
- Set environment variables:
MONGO_URI— your MongoDB Atlas connection stringJWT_SECRET— a strong random secretFRONTEND_URL— your frontend's deployed URL (for CORS)PORT— usually set automatically
- Push the entire project to GitHub
- Import the repo in Vercel
- Set Root Directory to
frontend - Add environment variable:
NEXT_PUBLIC_API_URL= your deployed backend URL (e.g.https://your-api.railway.app)
- Deploy
| Method | Endpoint | Body | Description |
|---|---|---|---|
| POST | /api/users/register |
{ name, email, password } |
Register new user |
| POST | /api/users/login |
{ email, password } |
Login |
| Method | Endpoint | Body | Description |
|---|---|---|---|
| GET | /api/tasks |
— | Get all tasks |
| POST | /api/tasks |
{ title, description? } |
Create task |
| PUT | /api/tasks/:id |
{ title?, completed?, description? } |
Update task |
| DELETE | /api/tasks/:id |
— | Delete task |
Frontend
- Next.js 16 (App Router)
- TypeScript
- Tailwind CSS v4
- shadcn/ui components
- Axios
- Lucide React icons
Backend
- Node.js + Express 5
- MongoDB + Mongoose
- JWT authentication
- bcryptjs password hashing
- Never commit
.envor.env.localfiles - Change
JWT_SECRETto a strong random value in production - Set
FRONTEND_URLto your specific frontend URL in production (not*) - Consider adding rate limiting for production (
express-rate-limit)