MEAN Stack with Docker

December 6, 2025 ยท View on GitHub

MEAN Stack with Docker

Production-Ready Full-Stack Application

MongoDB | Express.js | Angular 21 | Node.js | Docker

Angular Build Express Build Nginx Build


Contacts List

A modern, containerized contact management system demonstrating best practices in full-stack TypeScript development

Get Started | View Demo | Documentation | Report Bug


Table of Contents


Overview

This project demonstrates a production-ready MEAN stack application with modern development practices including TypeScript across the entire stack, JWT authentication, and Docker containerization. It serves as both a learning resource and a foundation for building scalable web applications.

Key Highlights

FeatureTechnology
FrontendAngular 21 with TypeScript and Bootstrap 5
BackendExpress.js with TypeScript
DatabaseMongoDB with Mongoose ODM
AuthenticationJWT-based secure authentication
ContainerizationDocker and Docker Compose
Load BalancerNginx reverse proxy
CI/CDGitHub Actions

Architecture

flowchart TB
    subgraph Internet["INTERNET"]
        direction TB
        client(("User<br/>Browser"))
    end

    subgraph Docker["DOCKER ENVIRONMENT"]
        direction TB
        
        subgraph Gateway["GATEWAY LAYER"]
            nginx{{"NGINX<br/>Load Balancer<br/>:80"}}
        end

        subgraph Services["APPLICATION LAYER"]
            direction LR
            angular["ANGULAR 21<br/>Frontend<br/>:4000"]
            express["EXPRESS.JS<br/>REST API<br/>:3000"]
        end

        subgraph Data["DATA LAYER"]
            mongodb[("MONGODB<br/>Database<br/>:27017")]
        end
    end

    client ==>|"HTTP Request"| nginx
    nginx -->|"Static Assets"| angular
    nginx -->|"/api/* Routes"| express
    express <-->|"CRUD Operations"| mongodb

    classDef internet fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#01579b
    classDef gateway fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px,color:#1b5e20
    classDef frontend fill:#ffcdd2,stroke:#c62828,stroke-width:2px,color:#b71c1c
    classDef backend fill:#fff3e0,stroke:#ef6c00,stroke-width:2px,color:#e65100
    classDef database fill:#e8f5e9,stroke:#388e3c,stroke-width:2px,color:#2e7d32
    classDef user fill:#bbdefb,stroke:#1976d2,stroke-width:2px,color:#0d47a1

    class client user
    class nginx gateway
    class angular frontend
    class express backend
    class mongodb database

How It Works

LayerComponentResponsibility
GatewayNginxSingle entry point on port 80. Routes traffic and serves as reverse proxy
FrontendAngular 21Serves the user interface with reactive components and Bootstrap 5 styling
BackendExpress.jsHandles API requests, authentication, and business logic
DataMongoDBPersists user accounts and contact information

Request Routing

Request PathRouted ToDescription
/*Angular :4000Static frontend assets and SPA routes
/api/*Express :3000REST API endpoints
DatabaseMongoDB :27017Data persistence (internal only)

Tech Stack

Frontend

  • Angular 21
  • TypeScript
  • Bootstrap 5
  • RxJS
  • Router Guards

Backend

  • Node.js
  • Express.js
  • TypeScript
  • Mongoose ODM
  • JWT Auth

Database

  • MongoDB 7.0
  • Mongoose
  • Data Seeding

DevOps

  • Docker
  • Docker Compose
  • Nginx
  • GitHub Actions

Getting Started

Prerequisites

Quick Start

# 1. Clone the repository
git clone https://github.com/nitin27may/mean-docker.git
cd mean-docker

# 2. Create environment file
cp .env.example .env

# 3. Start the application
docker-compose -f docker-compose.nginx.yml up

Ready in under 2 minutes! Open http://localhost in your browser.

Default Login

Username: nitin27may@gmail.com
Password: P@ssword#321

Deployment Modes

Development Mode

3 containers running on separate ports.

docker-compose up
ServiceURL
Frontendhttp://localhost:4000
APIhttp://localhost:3000
Databaselocalhost:27017

Production Mode

4 containers with Nginx gateway.

docker-compose -f docker-compose.nginx.yml up
ServiceURL
Applicationhttp://localhost
Databaselocalhost:27017

Features

Authentication

  • JWT-based secure login and registration
  • Protected routes with Angular guards
  • Token-based API authorization
  • Password change functionality

Contact Management

  • Create, read, update, and delete contacts
  • Responsive design for mobile and desktop
  • Form validation with custom error messages
  • Search, sort, and paginate contacts

Login Screen


Documentation

DocumentDescription
FrontendAngular application architecture and components
Backend APIExpress.js endpoints and middleware
DatabaseMongoDB schemas and data models
Load BalancerNginx routing configuration
Local DevelopmentRunning without Docker
Docker GuideContainer setup and configuration

Roadmap 2026

QuarterFocus AreaGoals
Q1Testing & QualityUnit tests, E2E tests with Cypress, code coverage reporting
Q2UI ModernizationAngular Material integration, dark/light theme, responsive redesign
Q3Security & AccessRole-based access control (Admin, Manager, User), OAuth 2.0 support
Q4Performance & ScaleRedis caching, API rate limiting, Kubernetes deployment configs

See the complete roadmap for details.


Contributing

Contributions are welcome. Please review our Contributing Guide before submitting changes.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Built by Nitin Singh

Twitter GitHub

If you find this project useful, please consider giving it a star!