A Node.js backend practice project for course records, user authentication, and profile management.
Stack: JavaScript · Express · MongoDB / Mongoose · JWT · bcryptjs
Status: Development project.
- User registration and login.
- JWT middleware for profile routes.
- Course CRUD operations and paginated listing.
- Request validation for course creation.
- Health endpoint at
/health.
The current course router does not apply authentication middleware: course creation, updates, and deletion are public alongside reads. Profile routes use authentication. Add authorization to course write operations before exposing this API as a shared service.
The repository is an API backend; it does not include a frontend.
Use a current Node.js LTS release, npm, and a local MongoDB instance or MongoDB Atlas database.
git clone https://github.com/MONOCODE-V/course-management-api.git
cd course-management-api
npm install
cp .env.example .envSet MONGODB_URI, a strong JWT_SECRET, and optionally PORT in .env.
npm run dev
# or
npm startDefault URL: http://localhost:3000.
| Area | Base path | Current behavior |
|---|---|---|
| Authentication | /api/auth |
Registration and login |
| Courses | /api/courses |
Public reads and writes |
| Profile | /api/profile |
JWT-protected profile management |
| Health | /health |
Process health response |
For example, request GET /api/courses?page=1&limit=10 to list courses. See the router files for the authoritative middleware and endpoint behavior.
index.js: server, database connection, and middleware.controllers/: request handlers.routes/: endpoint wiring.data/: Mongoose models.middleware/auth.js: authentication helpers.- Environment template.
API_DOCS.md and RAILWAY_DEPLOYMENT.md contain earlier reference material; check examples against the current routes.
- Protect course write endpoints and enforce roles.
- Add integration tests for authentication, validation, pagination, and authorization.
- Validate deployment and database readiness before publishing a live demo.
MIT.