# yaswanthkillampalli/stayhopsai architecture

> Architecture diagram of the GitHub repository yaswanthkillampalli/stayhopsai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yaswanthkillampalli/stayhopsai
- Repository: https://github.com/yaswanthkillampalli/stayhopsai

## Overview

StayOps AI coordinates hotel bookings and guest-facing check-in with operational departments, staff tasks, and Telegram self-service. The principal path is guest/admin interaction through the frontend and REST API into booking/check-in and operational workflows, with MongoDB-backed records and optional notifications. The README documents broader capabilities than the sampled excerpts; those are represented at subsystem level. Some route and frontend API details were not sampled, so those links are omitted rather than inferred.

Main entry points: [`backend/models`](https://github.com/yaswanthkillampalli/stayhopsai/tree/main/backend/models) (Operational records), [`backend/controllers/checkinController.js`](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/checkinController.js) (Check-in and checkout), [`backend/routes`](https://github.com/yaswanthkillampalli/stayhopsai/tree/main/backend/routes) (API routes), [`backend/controllers/roomController.js`](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/roomController.js) (Room operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_frontend["Web application<br/>[App.jsx]"]
  node_guest_pages["Guest experience"]
  node_operations_pages["Operations dashboard"]
end

subgraph group_api["API and access"]
  node_api_entry["REST API<br/>[app.js]"]
  node_route_handlers["API routes"]
  node_authentication["Authentication<br/>[authMiddleware.js]"]
end

subgraph group_guest_ops["Guest operations"]
  node_booking["Booking lifecycle"]
  node_checkin["Check-in and checkout"]
  node_room_ops["Room operations<br/>[roomController.js]"]
  node_parking["Parking workflows<br/>[parkingService.js]"]
  node_luggage["Luggage workflows<br/>[luggageService.js]"]
  node_food["Food orders"]
  node_complaints["Complaints"]
  node_maintenance["Maintenance"]
end

subgraph group_staff_ops["Staff operations"]
  node_staff_management["Staff management<br/>[staffController.js]"]
  node_task_workflows["Task workflows<br/>[taskService.js]"]
  node_analytics["Operational analytics<br/>[adminController.js]"]
end

subgraph group_platform["Data and integrations"]
  node_telegram["Telegram interaction"]
  node_records[("Operational records")]
  node_id_generation["ID generation<br/>[generateId.js]"]
  node_email["Email notifications<br/>[emailService.js]"]
  node_telegram_service["Telegram service<br/>[telegramService.js]"]
end

node_guest(("Guest"))
node_hotel_staff(("Hotel staff"))
node_telegram_platform["Telegram"]

node_guest -->|"uses"| node_frontend
node_hotel_staff -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_guest_pages
node_frontend -->|"routes to"| node_operations_pages
node_api_entry -->|"mounts"| node_route_handlers
node_route_handlers -->|"applies"| node_authentication
node_route_handlers -->|"calls"| node_complaints
node_route_handlers -->|"calls"| node_maintenance
node_route_handlers -->|"calls"| node_room_ops
node_checkin -->|"invokes"| node_parking
node_checkin -->|"invokes"| node_luggage
node_checkin -->|"invokes"| node_task_workflows
node_room_ops -->|"creates tasks"| node_task_workflows
node_room_ops -->|"creates"| node_complaints
node_room_ops -->|"reads requests"| node_maintenance
node_parking -->|"reads and writes"| node_records
node_luggage -->|"reads and writes"| node_records
node_task_workflows -->|"reads and writes"| node_records
node_checkin -->|"reads and writes"| node_records
node_complaints -->|"uses records"| node_records
node_maintenance -->|"uses records"| node_records
node_analytics -->|"aggregates"| node_records
node_task_workflows -->|"generates IDs"| node_id_generation
node_parking -->|"notifies"| node_telegram_service
node_luggage -->|"notifies"| node_telegram_service
node_telegram -->|"reads and writes"| node_records
node_telegram -->|"serves commands"| node_telegram_platform
node_booking -.->|"sends confirmations"| node_email
node_booking -.->|"persists bookings"| node_records
node_booking -.->|"allocates rooms"| node_room_ops
node_checkin -->|"links guest access"| node_telegram

click node_frontend "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/frontend/src/App.jsx"
click node_guest_pages "https://github.com/yaswanthkillampalli/stayhopsai/tree/main/frontend/src/pages"
click node_operations_pages "https://github.com/yaswanthkillampalli/stayhopsai/tree/main/frontend/src/pages"
click node_api_entry "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/app.js"
click node_route_handlers "https://github.com/yaswanthkillampalli/stayhopsai/tree/main/backend/routes"
click node_authentication "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/middlewares/authMiddleware.js"
click node_booking "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/bookingController.js"
click node_checkin "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/checkinController.js"
click node_room_ops "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/roomController.js"
click node_parking "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/parkingService.js"
click node_luggage "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/luggageService.js"
click node_food "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/foodOrderController.js"
click node_complaints "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/complaintController.js"
click node_maintenance "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/maintenanceController.js"
click node_staff_management "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/staffController.js"
click node_task_workflows "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/taskService.js"
click node_analytics "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/adminController.js"
click node_telegram "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/telegramController.js"
click node_records "https://github.com/yaswanthkillampalli/stayhopsai/tree/main/backend/models"
click node_id_generation "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/utils/generateId.js"
click node_email "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/emailService.js"
click node_telegram_service "https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/telegramService.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_frontend,node_guest_pages,node_operations_pages toneBlue
class node_api_entry,node_route_handlers,node_authentication toneAmber
class node_booking,node_checkin,node_room_ops,node_parking,node_luggage,node_food,node_complaints,node_maintenance toneMint
class node_staff_management,node_task_workflows,node_analytics toneRose
class node_telegram,node_records,node_id_generation,node_email,node_telegram_service,node_guest,node_hotel_staff,node_telegram_platform toneIndigo
```

## Components

### Client experience

- [Web application](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Guest experience](https://github.com/yaswanthkillampalli/stayhopsai/tree/main/frontend/src/pages): `frontend/src/pages`
- [Operations dashboard](https://github.com/yaswanthkillampalli/stayhopsai/tree/main/frontend/src/pages): `frontend/src/pages`

### API and access

- [REST API](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/app.js): `backend/app.js`
- [API routes](https://github.com/yaswanthkillampalli/stayhopsai/tree/main/backend/routes): `backend/routes`
- [Authentication](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/middlewares/authMiddleware.js): `backend/middlewares/authMiddleware.js`

### Guest operations

- [Booking lifecycle](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Check-in and checkout](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/checkinController.js): `backend/controllers/checkinController.js`
- [Room operations](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/roomController.js): `backend/controllers/roomController.js`
- [Parking workflows](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/parkingService.js): `backend/services/parkingService.js`
- [Luggage workflows](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/luggageService.js): `backend/services/luggageService.js`
- [Food orders](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/foodOrderController.js): `backend/controllers/foodOrderController.js`
- [Complaints](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/complaintController.js): `backend/controllers/complaintController.js`
- [Maintenance](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/maintenanceController.js): `backend/controllers/maintenanceController.js`

### Staff operations

- [Staff management](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/staffController.js): `backend/controllers/staffController.js`
- [Task workflows](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/taskService.js): `backend/services/taskService.js`
- [Operational analytics](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`

### Data and integrations

- [Telegram interaction](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/controllers/telegramController.js): `backend/controllers/telegramController.js`
- [Operational records](https://github.com/yaswanthkillampalli/stayhopsai/tree/main/backend/models): `backend/models`
- [ID generation](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/utils/generateId.js): `backend/utils/generateId.js`
- [Email notifications](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/emailService.js): `backend/services/emailService.js`
- [Telegram service](https://github.com/yaswanthkillampalli/stayhopsai/blob/main/backend/services/telegramService.js): `backend/services/telegramService.js`

### Other components

- **Guest**
- **Hotel staff**
- **Telegram**

## Connections

- Guest → Web application: uses (evidence: `README.md`)
- Hotel staff → Web application: uses (evidence: `README.md`)
- Web application → Guest experience: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Operations dashboard: routes to (evidence: `frontend/src/App.jsx`)
- REST API → API routes: mounts (evidence: `backend/app.js`)
- API routes → Authentication: applies (evidence: `backend/routes/complaintRoutes.js`)
- API routes → Complaints: calls (evidence: `backend/routes/complaintRoutes.js`)
- API routes → Maintenance: calls (evidence: `backend/routes/maintenanceRoutes.js`)
- API routes → Room operations: calls (evidence: `backend/routes/roomRoutes.js`)
- Check-in and checkout → Parking workflows: invokes (evidence: `backend/controllers/checkinController.js`)
- Check-in and checkout → Luggage workflows: invokes (evidence: `backend/controllers/checkinController.js`)
- Check-in and checkout → Task workflows: invokes (evidence: `backend/controllers/checkinController.js`)
- Room operations → Task workflows: creates tasks (evidence: `backend/controllers/roomController.js`)
- Room operations → Complaints: creates (evidence: `backend/controllers/roomController.js`)
- Room operations → Maintenance: reads requests (evidence: `backend/controllers/roomController.js`)
- Parking workflows → Operational records: reads and writes (evidence: `backend/services/parkingService.js`)
- Luggage workflows → Operational records: reads and writes (evidence: `backend/services/luggageService.js`)
- Task workflows → Operational records: reads and writes (evidence: `backend/services/taskService.js`)
- Check-in and checkout → Operational records: reads and writes (evidence: `backend/controllers/checkinController.js`)
- Complaints → Operational records: uses records (evidence: `backend/routes/complaintRoutes.js`)
- Maintenance → Operational records: uses records (evidence: `backend/routes/maintenanceRoutes.js`)
- Operational analytics → Operational records: aggregates (evidence: `backend/controllers/adminController.js`)
- Task workflows → ID generation: generates IDs (evidence: `backend/services/taskService.js`)
- Parking workflows → Telegram service: notifies (evidence: `backend/services/parkingService.js`)
- Luggage workflows → Telegram service: notifies (evidence: `backend/services/luggageService.js`)
- Telegram interaction → Operational records: reads and writes (evidence: `backend/controllers/telegramController.js`)
- Telegram interaction → Telegram: serves commands (evidence: `README.md`)
- Booking lifecycle → Email notifications: sends confirmations
- Booking lifecycle → Operational records: persists bookings
- Booking lifecycle → Room operations: allocates rooms (evidence: `README.md`)
- Check-in and checkout → Telegram interaction: links guest access (evidence: `backend/controllers/checkinController.js`)
