Skip to content
~/caio.barilli
ENPT
← All projects
JavaScript

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.
  1. —

    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.

  2. —

    Validation at the edge

    express-validator rules reject bad input before it reaches Mongoose.

  3. —

    Docker with helper scripts

    A small shell script wraps Docker Compose to bring the API up and open a shell in the container.

05 · Screenshots

Repository cover from the MERN course

06 · Links

Next projectMEAN →
React, Node.js, Express and MongoDB logos over Express code
Repository cover from the MERN course