# nivin-sithija/hotel-skynest architecture

> Architecture diagram of the GitHub repository nivin-sithija/hotel-skynest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nivin-sithija/hotel-skynest
- Repository: https://github.com/nivin-sithija/hotel-skynest

## Overview

SkyNest is a role-based hotel management system for guests, receptionists, and administrators. Users sign in and access role-specific dashboards and hotel workflows; frontend pages call a REST API, which exposes authentication and operational endpoints backed by MySQL. The major product areas include bookings and rooms, guest and service management, payments and live billing, financial configuration, support, and reporting. The graph follows documented routes and sampled imports; several domain implementations are represented at their existing directories because their source was not excerpted.

Main entry points: [`backend/server.js`](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/server.js) (API server), [`backend/config/database.js`](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/config/database.js) (MySQL database), [`frontend/src/utils/api.js`](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/utils/api.js) (API client), [`frontend/src/App.jsx`](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/App.jsx) (Role-based app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_booking_ui["Booking pages"]
  node_dashboard_ui["Role dashboards"]
  node_service_ui["Service workflows"]
  node_finance_ui["Finance pages<br/>[PaymentGateway.jsx]"]
  node_report_ui["Reporting page<br/>[Reports.jsx]"]
end

subgraph group_api["API and access"]
  node_server["API server<br/>[server.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_access["JWT access<br/>[auth.js]"]
  node_auth_logic["Authentication<br/>[authController.js]"]
end

subgraph group_operations["Hotel operations"]
  node_booking_logic["Booking and rooms"]
  node_guest_logic["Guest management<br/>[guestController.js]"]
  node_service_logic["Service requests"]
end

subgraph group_finance["Finance and insights"]
  node_payment_logic["Payment processing"]
  node_financial_config["Fees and tax rules"]
  node_reports["Business reports"]
end

subgraph group_platform["Persistence"]
  node_mysql[("MySQL database<br/>[database.js]")]
end

node_guest(("Hotel user"))

node_guest -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_booking_ui
node_authctx -->|"auth requests"| node_server
node_booking_ui -.->|"calls"| node_api_client
node_service_ui -->|"calls"| node_api_client
node_finance_ui -.->|"calls"| node_api_client
node_report_ui -.->|"calls"| node_api_client
node_api_client -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth_logic
node_auth_routes -->|"verifies token"| node_access
node_server -->|"routes requests"| node_booking_logic
node_server -->|"routes requests"| node_guest_logic
node_server -->|"routes requests"| node_service_logic
node_server -->|"routes requests"| node_payment_logic
node_server -->|"routes requests"| node_financial_config
node_server -->|"routes requests"| node_reports
node_auth_logic -->|"queries"| node_mysql
node_booking_logic -->|"queries"| node_mysql
node_payment_logic -->|"queries"| node_mysql
node_financial_config -->|"queries"| node_mysql
node_guest_logic -.->|"uses database"| node_mysql
node_service_logic -.->|"uses database"| node_mysql
node_reports -.->|"uses database"| node_mysql

click node_app "https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/context/AuthContext.jsx"
click node_api_client "https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/utils/api.js"
click node_booking_ui "https://github.com/nivin-sithija/hotel-skynest/tree/main/frontend/src/pages"
click node_dashboard_ui "https://github.com/nivin-sithija/hotel-skynest/tree/main/frontend/src/pages/dashboards"
click node_service_ui "https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/pages/ServiceRequests.jsx"
click node_finance_ui "https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/pages/PaymentGateway.jsx"
click node_report_ui "https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/pages/Reports.jsx"
click node_server "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/server.js"
click node_auth_routes "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/routes/authRoutes.js"
click node_access "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/middleware/auth.js"
click node_auth_logic "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/authController.js"
click node_booking_logic "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/bookingController.js"
click node_guest_logic "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/guestController.js"
click node_service_logic "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/serviceRequestController.js"
click node_payment_logic "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/paymentController.js"
click node_financial_config "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/taxDiscountController.js"
click node_reports "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/reportController.js"
click node_mysql "https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/config/database.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authctx,node_api_client,node_booking_ui,node_dashboard_ui,node_service_ui,node_finance_ui,node_report_ui,node_guest toneBlue
class node_server,node_auth_routes,node_access,node_auth_logic toneAmber
class node_booking_logic,node_guest_logic,node_service_logic toneMint
class node_payment_logic,node_financial_config,node_reports toneRose
class node_mysql toneIndigo
```

## Components

### Web experience

- [Role-based app](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth context](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`
- [Booking pages](https://github.com/nivin-sithija/hotel-skynest/tree/main/frontend/src/pages): `frontend/src/pages`
- [Role dashboards](https://github.com/nivin-sithija/hotel-skynest/tree/main/frontend/src/pages/dashboards): `frontend/src/pages/dashboards`
- [Service workflows](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/pages/ServiceRequests.jsx): `frontend/src/pages/ServiceRequests.jsx`
- [Finance pages](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/pages/PaymentGateway.jsx): `frontend/src/pages/PaymentGateway.jsx`
- [Reporting page](https://github.com/nivin-sithija/hotel-skynest/blob/main/frontend/src/pages/Reports.jsx): `frontend/src/pages/Reports.jsx`

### API and access

- [API server](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/server.js): `backend/server.js`
- [Auth routes](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [JWT access](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Authentication](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`

### Hotel operations

- [Booking and rooms](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Guest management](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/guestController.js): `backend/controllers/guestController.js`
- [Service requests](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/serviceRequestController.js): `backend/controllers/serviceRequestController.js`

### Finance and insights

- [Payment processing](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/paymentController.js): `backend/controllers/paymentController.js`
- [Fees and tax rules](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/taxDiscountController.js): `backend/controllers/taxDiscountController.js`
- [Business reports](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/controllers/reportController.js): `backend/controllers/reportController.js`

### Persistence

- [MySQL database](https://github.com/nivin-sithija/hotel-skynest/blob/main/backend/config/database.js): `backend/config/database.js`

### Other components

- **Hotel user**

## Connections

- Hotel user → Role-based app: uses
- Role-based app → Auth context: provides auth (evidence: `frontend/src/App.jsx`)
- Role-based app → Role dashboards: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app → Booking pages: routes to (evidence: `frontend/src/App.jsx`)
- Auth context → API server: auth requests (evidence: `frontend/src/context/AuthContext.jsx`)
- Booking pages → API client: calls (evidence: `frontend/src/pages/ServiceRequests.jsx`)
- Service workflows → API client: calls (evidence: `frontend/src/pages/ServiceRequests.jsx`)
- Finance pages → API client: calls
- Reporting page → API client: calls
- API client → API server: HTTP requests
- API server → Auth routes: mounts (evidence: `backend/server.js`)
- Auth routes → Authentication: dispatches (evidence: `backend/routes/authRoutes.js`)
- Auth routes → JWT access: verifies token (evidence: `backend/routes/authRoutes.js`)
- API server → Booking and rooms: routes requests (evidence: `backend/server.js`)
- API server → Guest management: routes requests (evidence: `backend/server.js`)
- API server → Service requests: routes requests (evidence: `backend/server.js`)
- API server → Payment processing: routes requests (evidence: `backend/server.js`)
- API server → Fees and tax rules: routes requests (evidence: `backend/server.js`)
- API server → Business reports: routes requests (evidence: `backend/server.js`)
- Authentication → MySQL database: queries (evidence: `backend/controllers/authController.js`)
- Booking and rooms → MySQL database: queries (evidence: `backend/controllers/bookingController.js`)
- Payment processing → MySQL database: queries (evidence: `backend/controllers/paymentController.js`)
- Fees and tax rules → MySQL database: queries (evidence: `backend/controllers/taxDiscountController.js`)
- Guest management → MySQL database: uses database
- Service requests → MySQL database: uses database
- Business reports → MySQL database: uses database
