MERN
REST API in Express and MongoDB with JWT authentication and request validation, running in Docker. Built in the MERN Stack Front To Back course.
- Year
- 2023
- Type
- Study project
- Status
- Complete
01 · Problem
Course project to practise a Node.js back end with authentication.
02 · Solution
An Express API with Mongoose models, JWT login, express-validator rules and a Docker setup with helper scripts.
03 · Stack
- Node.js
- Express
- MongoDB / Mongoose
- JWT
- Docker
- ESLint / Prettier
04 · Architecture decisions
The decisions that shaped the project.- —
JWT in a header, not a session
A stateless API: the token is signed with a secret from .env and checked by an auth middleware on protected routes.
- —
Validation at the edge
express-validator rules reject bad input before it reaches Mongoose.
- —
Docker with helper scripts
A small shell script wraps Docker Compose to bring the API up and open a shell in the container.