Skip to content

Mchiir/hotel-mis-microservices

Repository files navigation

Hotel MIS Microservices

Node.js Express MongoDB React Vite Docker Nginx JWT

A Hotel Management Information System (MIS) built using a simple microservices architecture for academic projects, practical exams, and learning distributed systems fundamentals.


Features

  • JWT Authentication
  • Refresh Token Rotation
  • Role-Based Access Control (RBAC)
  • Room Management
  • Guest Management
  • Reservation Management
  • Check-In / Check-Out
  • Payment Processing
  • Occupancy Reports
  • Revenue Reports
  • Reservation Reports
  • Swagger API Documentation
  • Nginx API Gateway
  • Dockerized Services

Architecture

The system follows a lightweight microservices architecture designed for simplicity, maintainability, and exam-oriented development.

Microservices

  • Auth Service
  • User Service
  • Room Service
  • Reservation Service
  • Payment Service
  • Report Service

Infrastructure

  • Nginx API Gateway
  • Docker Compose
  • MongoDB

Frontend

  • React + Vite SPA

All services communicate synchronously through REST APIs.


Tech Stack

Backend

  • Node.js (ES Modules)
  • Express.js
  • MongoDB
  • Mongoose
  • Joi Validation
  • JWT Authentication
  • Winston Logging
  • Swagger Documentation
  • pnpm

Frontend

  • React
  • Vite
  • React Router
  • TailwindCSS
  • Fetch API
  • React Hot Toast
  • SweetAlert2
  • Lucide Icons

Infrastructure

  • Docker
  • Docker Compose
  • Nginx API Gateway

Project Structure

hotel-mis/

docs/
frontend/
gateway/

services/
├── auth-service/
├── user-service/
├── room-service/
├── reservation-service/
├── payment-service/
└── report-service/

docker-compose.yml

Documentation

Comprehensive project documentation is available inside:

/docs

Available Documentation

File Description
architecture.md System architecture diagrams
system-flow.md Reservation, payment, check-in and check-out flows
database.md ER diagrams and entity relationships
hotel-mis.dbml Source-of-truth database schema

Visual References

  • Architecture Diagram
  • Service Communication Flow
  • Reservation Lifecycle Flow
  • Database ER Diagram
  • DBML Schema Definition

These documents provide a complete overview of the system design and implementation.


Running the Backend

Build and start all services:

docker compose up --build

Run in detached mode:

docker compose up -d --build

Stop all services:

docker compose down

Stop services and remove volumes:

docker compose down -v

Rebuild containers:

docker compose build --no-cache

View logs:

docker compose logs -f

View specific service logs:

docker compose logs -f gateway
docker compose logs -f auth-service
docker compose logs -f reservation-service

Running the Frontend

cd frontend

pnpm install

pnpm run dev

Frontend URL:

http://localhost:5173

Gateway URL:

http://localhost:8080

API Gateway Routes

/api/auth/*
/api/users/*
/api/rooms/*
/api/reservations/*
/api/payments/*
/api/reports/*

The Nginx Gateway acts as the single entry point for all backend services.


User Roles

ADMIN

  • Full system access
  • User management
  • Room management
  • Reservations
  • Payments
  • Reports

RECEPTIONIST

  • Guest management
  • Reservations
  • Check-ins
  • Check-outs
  • Room availability

ACCOUNTANT

  • Payment management
  • Revenue reports
  • Financial reporting

API Documentation

Every microservice exposes Swagger documentation.

Examples:

http://localhost:3001/api-docs
http://localhost:3002/api-docs
http://localhost:3003/api-docs
http://localhost:3004/api-docs
http://localhost:3005/api-docs
http://localhost:3006/api-docs

Development Principles

  • Feature-Based Structure
  • Controller → Service → Model Pattern
  • Joi Validation
  • Reusable Middleware
  • Reusable React Components
  • Global Error Handling
  • Consistent Response Structure
  • Minimal Abstractions
  • Functional Programming Approach
  • Exam-Friendly Design

Learning Objectives

This project demonstrates:

  • Microservices Architecture
  • API Gateway Pattern
  • JWT Authentication
  • Refresh Token Rotation
  • Role-Based Access Control
  • RESTful API Design
  • Service-to-Service Communication
  • Docker Containerization
  • MongoDB Data Modeling
  • React SPA Development

About

Hotel Management Information System supporting room management, guest registration, reservations, check-ins, check-outs, payments, occupancy tracking, revenue reporting, and role-based staff operations.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages