# jeevanmgowda/booknfeast architecture

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

- Interactive diagram: https://gitdiagram.com/jeevanmgowda/booknfeast
- Repository: https://github.com/jeevanmgowda/booknfeast

## Overview

BookNFeast is a hotel and restaurant management SPA backed by an Express API and MongoDB, with a localStorage fallback. The principal workflow is an operator using the frontend to manage hotel and restaurant records; the frontend data layer requests API operations, and the server reads or writes MongoDB. Dashboard and reports provide operational summaries, while admin authentication is a separate entry flow. The excerpts show these layers and several domain screens; some page wiring and report data access are unsampled, so those links are marked unverified or omitted.

Main entry points: [`frontend/js/app.js`](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/app.js) (SPA Shell), [`frontend/js/db.js`](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/db.js) (UI Data Layer), [`backend/server.js`](https://github.com/jeevanmgowda/booknfeast/blob/main/backend/server.js) (Express API), [`frontend/js/dashboard.js`](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/dashboard.js) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_spa["SPA Shell<br/>[app.js]"]
  node_home["Home<br/>[home.js]"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_reports["Reports<br/>[reports.js]"]
  node_data["UI Data Layer<br/>[db.js]"]
end

subgraph group_operations["Hotel Operations"]
  node_hotel["Rooms Guests Bookings<br/>[hotel.js]"]
  node_staff["Staff Management<br/>[staff.js]"]
end

subgraph group_restaurant["Restaurant Operations"]
  node_restaurant_ui["Menu Tables Orders<br/>[restaurant.js]"]
end

subgraph group_backend["Backend Data"]
  node_api["Express API<br/>[server.js]"]
  node_mongo_access["Mongo Connection<br/>[db.js]"]
  node_seed["Seed Records<br/>[seed-data.js]"]
  node_mongo[("MongoDB")]
  node_aggregations["Aggregation Examples<br/>[dml_commands.js]"]
end

node_operator(("Hotel Operator"))
node_local[("Browser localStorage")]

node_operator -->|"uses"| node_spa
node_spa -.->|"routes to"| node_home
node_spa -.->|"routes to"| node_dashboard
node_spa -.->|"routes to"| node_hotel
node_spa -.->|"routes to"| node_restaurant_ui
node_spa -.->|"routes to"| node_staff
node_spa -.->|"routes to"| node_reports
node_operator -->|"manages"| node_hotel
node_operator -->|"manages"| node_restaurant_ui
node_operator -->|"manages"| node_staff
node_operator -->|"reviews"| node_dashboard
node_operator -->|"reviews"| node_reports
node_hotel -.->|"updates records"| node_data
node_restaurant_ui -.->|"updates records"| node_data
node_staff -.->|"updates records"| node_data
node_dashboard -.->|"reads records"| node_data
node_reports -.->|"reads records"| node_data
node_data -->|"HTTP requests"| node_api
node_data -->|"persists fallback"| node_local
node_api -->|"gets connection"| node_mongo_access
node_api -->|"imports seed builder"| node_seed
node_api -->|"reads and writes"| node_mongo
node_mongo_access -->|"connects"| node_mongo
node_aggregations -->|"aggregates"| node_mongo

click node_spa "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/app.js"
click node_home "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/home.js"
click node_dashboard "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/dashboard.js"
click node_reports "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/reports.js"
click node_data "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/db.js"
click node_hotel "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/hotel.js"
click node_staff "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/staff.js"
click node_restaurant_ui "https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/restaurant.js"
click node_api "https://github.com/jeevanmgowda/booknfeast/blob/main/backend/server.js"
click node_mongo_access "https://github.com/jeevanmgowda/booknfeast/blob/main/backend/db.js"
click node_seed "https://github.com/jeevanmgowda/booknfeast/blob/main/backend/seed-data.js"
click node_aggregations "https://github.com/jeevanmgowda/booknfeast/blob/main/database/dml_commands.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_spa,node_home,node_dashboard,node_reports,node_data toneBlue
class node_hotel,node_staff,node_local toneAmber
class node_restaurant_ui toneMint
class node_api,node_mongo_access,node_seed,node_mongo,node_aggregations toneRose
class node_operator toneIndigo
```

## Components

### Frontend

- [SPA Shell](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [Home](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/home.js): `frontend/js/home.js`
- [Dashboard](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/dashboard.js): `frontend/js/dashboard.js`
- [Reports](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/reports.js): `frontend/js/reports.js`
- [UI Data Layer](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/db.js): `frontend/js/db.js`

### Hotel Operations

- [Rooms Guests Bookings](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/hotel.js): `frontend/js/hotel.js`
- [Staff Management](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/staff.js): `frontend/js/staff.js`

### Restaurant Operations

- [Menu Tables Orders](https://github.com/jeevanmgowda/booknfeast/blob/main/frontend/js/restaurant.js): `frontend/js/restaurant.js`

### Backend Data

- [Express API](https://github.com/jeevanmgowda/booknfeast/blob/main/backend/server.js): `backend/server.js`
- [Mongo Connection](https://github.com/jeevanmgowda/booknfeast/blob/main/backend/db.js): `backend/db.js`
- [Seed Records](https://github.com/jeevanmgowda/booknfeast/blob/main/backend/seed-data.js): `backend/seed-data.js`
- **MongoDB**
- [Aggregation Examples](https://github.com/jeevanmgowda/booknfeast/blob/main/database/dml_commands.js): `database/dml_commands.js`

### Other components

- **Hotel Operator**
- **Browser localStorage**

## Connections

- Hotel Operator → SPA Shell: uses (evidence: `README.md`)
- SPA Shell → Home: routes to
- SPA Shell → Dashboard: routes to
- SPA Shell → Rooms Guests Bookings: routes to
- SPA Shell → Menu Tables Orders: routes to
- SPA Shell → Staff Management: routes to
- SPA Shell → Reports: routes to
- Hotel Operator → Rooms Guests Bookings: manages (evidence: `README.md`)
- Hotel Operator → Menu Tables Orders: manages (evidence: `README.md`)
- Hotel Operator → Staff Management: manages (evidence: `README.md`)
- Hotel Operator → Dashboard: reviews (evidence: `README.md`)
- Hotel Operator → Reports: reviews (evidence: `README.md`)
- Rooms Guests Bookings → UI Data Layer: updates records
- Menu Tables Orders → UI Data Layer: updates records
- Staff Management → UI Data Layer: updates records
- Dashboard → UI Data Layer: reads records
- Reports → UI Data Layer: reads records
- UI Data Layer → Express API: HTTP requests (evidence: `frontend/js/db.js`)
- UI Data Layer → Browser localStorage: persists fallback (evidence: `frontend/js/db.js`)
- Express API → Mongo Connection: gets connection (evidence: `backend/server.js`)
- Express API → Seed Records: imports seed builder (evidence: `backend/server.js`)
- Express API → MongoDB: reads and writes (evidence: `backend/server.js`)
- Mongo Connection → MongoDB: connects (evidence: `backend/db.js`)
- Aggregation Examples → MongoDB: aggregates (evidence: `database/dml_commands.js`)
