# just-moh-it/hotingo architecture

> Architecture diagram of the GitHub repository just-moh-it/hotingo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/just-moh-it/hotingo
- Repository: https://github.com/just-moh-it/hotingo

## Overview

##### Project Type and Purpose
- This is a standalone desktop “full-stack” monolithic application for hotel management.
- Built with Python 3, Tkinter (GUI), MySQL (database), Matplotlib/NumPy (charts), and dotenv for config.
- Features: user login/authentication, CRUD for Rooms, Guests, Reservations, dashboard graphs, and an About page.

##### File Structure
- Entry and orchestration:
- main.py – application bootstrap and Tkinter main loop
- config.py – loads environment variables and DB credentials
- controller.py – business logic layer (connects GUI actions to database queries)
- UI layer:
- gui/… – organized by feature (login, main_window, sub-modules for dashboard, guests, reservations, rooms, about)
- each subfolder contains GUI definitions, asset references, and view logic
- Data layer:
- sql/hms.sql – schema for MySQL tables (login, rooms, guests, reservations)
- Static resources:
- assets/… – fonts, screenshots, Figma exports
- Supporting files:
- requirements.txt – Python package list (tkinter-designer, mysql-connector-python, python-dotenv, numpy, matplotlib)
- .env.example – template for DB credentials
- .gitignore, LICENSE.txt, README.md

##### README for Additional Insights
- Confirms MVC pattern: GUI (View), controller.py (Controller), MySQL (Model).
- Technical stack and external dependencies are clearly listed.
- No microservices or distributed components—single monolith.

## Diagram (Mermaid)

```mermaid
flowchart TD
    direction TB

    U["User"]:::user

    Entry["main.py"]:::entry
    Config["config.py"]:::config
    Controller["controller.py"]:::controller
    DB["MySQL Database"]:::db
    NoteDB["(schema: hms.sql)"]:::db

    subgraph "GUI Layer"
        direction TB
        Login["Login View"]:::ui
        MainWin["Main Window"]:::ui
        Dashboard["Dashboard"]:::ui
        About["About Page"]:::ui

        subgraph "Rooms"
            direction TB
            ViewRooms["View Rooms"]:::ui
            AddRoom["Add Room"]:::ui
            UpdateRoom["Update Room"]:::ui
        end

        subgraph "Guests"
            direction TB
            ViewGuests["View Guests"]:::ui
            AddGuests["Add Guests"]:::ui
            UpdateGuests["Update Guests"]:::ui
        end

        subgraph "Reservations"
            direction TB
            ViewRes["View Reservations"]:::ui
            AddRes["Add Reservation"]:::ui
            UpdateRes["Update Reservation"]:::ui
        end
    end

    subgraph "External Libraries"
        direction TB
        Dotenv["python-dotenv"]:::ext
        MySQLConn["mysql-connector-python"]:::ext
        TkDesigner["tkinter-designer"]:::ext
        NumPy["NumPy/Matplotlib"]:::ext
    end

    U -->|actions| Login
    Entry -->|bootstrap UI| Login
    Entry -->|initialize config| Config
    Entry -->|load controller| Controller

    Login -->|invoke| Controller
    MainWin -->|invoke| Controller
    Dashboard -->|invoke| Controller
    About -->|invoke| Controller
    ViewRooms -->|invoke| Controller
    AddRoom -->|invoke| Controller
    UpdateRoom -->|invoke| Controller
    ViewGuests -->|invoke| Controller
    AddGuests -->|invoke| Controller
    UpdateGuests -->|invoke| Controller
    ViewRes -->|invoke| Controller
    AddRes -->|invoke| Controller
    UpdateRes -->|invoke| Controller

    Config -->|provides credentials| Controller
    Controller -->|SQL over Connector| DB
    DB -->|results| Controller
    Controller -->|update view| Login
    Controller -->|update view| MainWin
    Controller -->|update view| Dashboard
    Controller -->|update view| About
    Controller -->|update view| ViewRooms
    Controller -->|update view| AddRoom
    Controller -->|update view| UpdateRoom
    Controller -->|update view| ViewGuests
    Controller -->|update view| AddGuests
    Controller -->|update view| UpdateGuests
    Controller -->|update view| ViewRes
    Controller -->|update view| AddRes
    Controller -->|update view| UpdateRes

    Dotenv --> Config
    MySQLConn --> Controller
    TkDesigner --> Login
    TkDesigner --> MainWin
    TkDesigner --> Dashboard
    NumPy --> Dashboard

    click Entry "https://github.com/just-moh-it/hotingo/blob/main/main.py"
    click Config "https://github.com/just-moh-it/hotingo/blob/main/config.py"
    click Controller "https://github.com/just-moh-it/hotingo/blob/main/controller.py"
    click DB "https://github.com/just-moh-it/hotingo/blob/main/sql/hms.sql"
    click Login "https://github.com/just-moh-it/hotingo/blob/main/gui/login/gui.py"
    click MainWin "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/main.py"
    click Dashboard "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/dashboard/gui.py"
    click About "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/about/main.py"
    click ViewRooms "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/rooms/view_rooms/main.py"
    click AddRoom "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/rooms/add_room/gui.py"
    click UpdateRoom "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/rooms/update_rooms/main.py"
    click ViewGuests "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/guests/view_guests/main.py"
    click AddGuests "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/guests/add_guests/gui.py"
    click UpdateGuests "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/guests/update_guests/main.py"
    click ViewRes "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/reservations/view_reservations/main.py"
    click AddRes "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/reservations/add_reservations/gui.py"
    click UpdateRes "https://github.com/just-moh-it/hotingo/blob/main/gui/main_window/reservations/update_reservation/main.py"

    classDef user fill:#f8f9fa,stroke:#333,stroke-width:1px
    classDef entry fill:#f8f9fa,stroke:#333,stroke-width:1px
    classDef ui fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef controller fill:#d4edda,stroke:#333,stroke-width:1px
    classDef config fill:#e2e3e5,stroke:#333,stroke-width:1px
    classDef db fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef dbNote fill:#fff3cd,stroke:#fff3cd,stroke-width:0px
    classDef ext fill:#e2e3e5,stroke:#333,stroke-width:1px
```
