Backend for the Jobster app. Provides user auth, job tracking APIs, and serves the prebuilt React client from client/build.
- Node.js + Express
- MongoDB + Mongoose
- JWT auth (
Authorization: Bearer <token>) - Security: helmet, xss-clean
- Rate limiting on auth routes
- Install deps
npm install
- Create
.envwith:MONGO_URI=your-mongodb-connection-string JWT_SECRET=your-secret JWT_LIFETIME=30d - Start the server
Runs on
npm run dev # nodemon # or npm start
PORTor5000.
- Auth
POST /api/v1/auth/register– create userPOST /api/v1/auth/login– get JWTPATCH /api/v1/auth/updateUser– update profile (JWT required)
- Jobs (JWT required)
GET /api/v1/jobs– list (filters:search,status,jobType; sorting; pagination)POST /api/v1/jobs– createGET /api/v1/jobs/:id– get onePATCH /api/v1/jobs/:id– updateDELETE /api/v1/jobs/:id– deleteGET /api/v1/jobs/stats– status counts + 6‑month timeline
- User:
name,email(unique),password(hashed),lastName,location - Job:
company,position,status(interview|declined|pending),jobType(full-time|part-time|remote|internship),jobLocation,createdBy
- React client already built; Express serves static assets from
client/build. - Non-API routes fall back to
index.html.
- Seed sample jobs with
node populate.js(usesmock-data.jsonand your.envconnection).
- Requests from the configured test user (
userId === 6960305544d804e588f40174) are read-only. - Auth routes are rate-limited (10 requests per 15 minutes per IP).