A full-stack task manager with an Express/MongoDB backend and a Vite/React frontend. This guide captures everything needed to run the project locally and ship it safely.
- Node.js 20+
- npm 10+
- MongoDB Atlas cluster or accessible MongoDB instance
cd backend
npm install
npm run dev # runs ts-node with nodemonEnvironment variables live in backend/.env (see .env.example for the required keys).
cd frontend
npm install
npm run dev # starts Vite on http://localhost:5173Create a .env file (see .env.example) so the client knows where to find the API.
- Backend:
npm run build --prefix backendproduces ESM output inbackend/dist, then start withnpm run start --prefix backend. - Frontend:
npm run build --prefix frontendoutputs static assets tofrontend/dist(serve via Netlify/Vercel or any static host).
| Scope | Key | Description |
|---|---|---|
| Backend | MONGO_URI |
Connection string for MongoDB |
| Backend | PORT |
Port for Express (defaults to 5000) |
| Frontend | VITE_API_URL |
URL the client uses for API requests |
- Copy
.env.examplefiles to real.envfiles with production secrets. - Run
npm run build --prefix backendandnpm run build --prefix frontend. - Start the backend using
npm start --prefix backend(or Docker/host equivalent) and verify/health. - Serve
frontend/distfrom your hosting provider, pointingVITE_API_URLat the production backend URL. - Configure CI (e.g., GitHub Actions) to run the build commands on each push before deploying.
- Monitor logs/metrics for the backend process after deploy.
npm test --prefix frontend(placeholder – add tests when ready)npm run lint --prefix frontendnpm run dev --prefix backend/npm run dev --prefix frontend
Update this file as your deployment process evolves so future deploys stay repeatable.