A simple, clean full‑stack To‑Do app built for internship evaluation using a MERN‑like stack with NestJS, Vite + React (TypeScript), and MongoDB.
- Backend: NestJS + @nestjs/mongoose + class-validator
- Frontend: Vite + React (TypeScript) + Axios
- DB: MongoDB (local or Atlas)
- Language: TypeScript (both sides)
- Bonus: Client‑side filtering (All / Completed / Pending)
# unzip this repo, then:
cd backend
cp .env.example .env # adjust MONGODB_URI if needed
npm install
npm run dev # http://localhost:4000# in a second terminal
cd ../frontend
cp .env.example .env # VITE_API_BASE defaults to http://localhost:4000
npm install
npm run dev # http://localhost:5173Make sure MongoDB is running locally or your Atlas URI is correct.
Base URL: http://localhost:4000
- POST
/tasks→ Create a task (body:{ title, description?, completed? }) - GET
/tasks→ Get all tasks - GET
/tasks/:id→ Get one task - PATCH
/tasks/:id→ Update title/description/completed - DELETE
/tasks/:id→ Delete a task
Example:
curl -X POST http://localhost:4000/tasks -H "Content-Type: application/json" -d '{"title":"Read NestJS docs","description":"Chapters 1–3"}'- Add new tasks using the Task Form
- See tasks in Task List
- Toggle completed and delete tasks instantly
- Filter: All / Completed / Pending
backend/
src/
app.module.ts
main.ts
tasks/
dto/
create-task.dto.ts
update-task.dto.ts
task.schema.ts
tasks.controller.ts
tasks.module.ts
tasks.service.ts
.env.example
package.json
tsconfig.json
frontend/
src/
api.ts
ui/App.tsx
main.tsx
styles.css
.env.example
index.html
vite.config.ts
package.json
tsconfig.json
- Backend: Render/Heroku/Fly → set
MONGODB_URIandPORT - Frontend: Vercel/Netlify → set
VITE_API_BASEenv to your backend URL - DB: MongoDB Atlas → get connection string and paste into
.env
- Commit small, meaningful changes:
feat(tasks): add PATCH endpointui: add filter controlsfix: validate title length
Good luck & happy building! 💪