Skip to content

DotDev262/Hostly

Repository files navigation

Hostly - A Microservices-based Hostel Management System

Hostly is a comprehensive hostel management system designed to showcase a microservices architecture. Each module is intentionally developed with a different technology stack to demonstrate polyglot programming, inter-service communication patterns, and various software engineering concepts.

Features

  • Centralized Frontend Gateway: A single, unified entry point for the entire application, featuring user authentication (students and wardens) and a dashboard that provides access to all modules.
  • Real-time Complaint Management: A real-time system for students to submit complaints and for wardens to track and update their status.
  • Room & Occupant Information: A service for managing room details and occupant information.
  • Real-time Notice Board: A module for broadcasting important announcements to all users in real-time.
  • P2P Resource Sharing: A peer-to-peer file sharing system for students to share study materials and other resources.
  • Live Mess Feedback: A real-time voting system for students to provide feedback on the mess food.

Tech Stack

This project utilizes a diverse set of technologies to build a polyglot microservices application:

Service Language / Framework Key Libraries/Features Communication Protocol Storage
Frontend Gateway Node.js / Express.js EJS, JWT (JSON Web Tokens) REST API In-memory (for users)
Complaints Node.js / Express.js Socket.IO WebSockets In-memory
Room Info Java Java RMI, com.sun.net.httpserver RMI, REST API In-memory
Notice Board Node.js / Express.js REST API In-memory
P2P Share Go net/http REST API File system
Mess Feedback Python / Flask multiprocessing.shared_memory REST API Shared Memory

Architecture

The system is designed as a set of independent microservices, each running in its own Docker container. These services communicate with each other over a dedicated Docker network. A central Frontend Gateway acts as the main entry point, handling user authentication and routing requests to the appropriate backend service. This architecture allows for individual services to be developed, deployed, and scaled independently.

Modules

1. Frontend Gateway (frontend-gateway)

  • Tech: Node.js, Express.js, EJS
  • The primary user interface of the application.
  • Provides a login page for students and wardens.
  • Features a dashboard that acts as a launchpad to access all other modules.
  • Handles user authentication and generates JWTs for secure communication with other services.

2. Complaint Management (mod1-complaints)

  • Tech: Node.js, Express.js, Socket.IO
  • A real-time, interactive module for managing hostel complaints.
  • Students can submit new complaints, view the status of their complaints, and receive live updates.
  • Wardens have a separate dashboard to view all complaints and update their status (e.g., "Pending", "In Progress", "Resolved").

3. Room Information (mod2-room-info)

  • Tech: Java, RMI
  • A service to manage room assignments and occupant details.
  • Demonstrates the use of Java RMI for remote procedure calls.
  • Provides a simple web interface for students to search for occupants and for wardens to manage room information.

4. Notice Board (mod3-notice-board)

  • Tech: Node.js, Express.js
  • A real-time notice board for displaying important announcements.
  • Wardens can post new notices, which are then broadcasted to all connected students.

5. P2P Resource Sharing (mod4-p2p-share)

  • Tech: Go
  • A peer-to-peer file sharing network for students.
  • Users can upload files, which are then available for download by other users on the network.
  • The system demonstrates P2P concepts where nodes can discover and download files from each other.

6. Mess Feedback (mod5-mess-feedback)

  • Tech: Python, Flask
  • A simple, real-time voting system for collecting feedback on the quality of the mess food.
  • This module uses shared memory for high-performance, inter-process data sharing, showcasing a unique approach to state management.

Getting Started

Prerequisites

Running the Application

  1. Clone the repository:

    git clone https://github.com/DotDev262/Hostly
    cd Hostly
  2. Build and run the services using Docker Compose:

    docker-compose up --build

    This command will build the Docker images for each service and start all the containers.

  3. Access the application: Open your web browser and navigate to http://localhost:60000.

Stopping the Application

To stop and remove all services, networks, and volumes created by Docker Compose, run:

docker-compose down

Demo Accounts

You can use the following credentials to log in and test the application:

  • Warden:
    • Email: warden@hostly.com
    • Password: password123
  • Student:
    • Email: student@hostly.com
    • Password: password123

About

Hostly: Microservices hostel management system showcasing polyglot programming (Node.js, Java, Go, Python). Features: complaints, room info, P2P sharing, notices, feedback.

Topics

Resources

Stars

Watchers

Forks

Contributors