# srinivas-gowda31/restaurant_app architecture

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

- Interactive diagram: https://gitdiagram.com/srinivas-gowda31/restaurant_app
- Repository: https://github.com/srinivas-gowda31/restaurant_app

## Overview

This repository implements a multi-hotel guest concierge: guests identify their hotel and room, then use voice or text to get help, place orders, and request services; hotel staff manage catalogs and fulfill requests. The graph follows the guest-to-backend path and preserves the voice, travel/service, and staff-management branches. Source excerpts and the index establish some internal calls, but the README is empty and several routes and integrations were not sampled, so uncertain connections are omitted or marked dashed.

Main entry points: [`backend/src/server.js`](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/server.js) (HTTP server), [`backend/src/tools.js`](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/tools.js) (Concierge tools), [`backend/src/db.js`](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/db.js) (Hotel database), [`backend/src/voice/call.js`](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/voice/call.js) (Voice call runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest experience"]
  node_guestui["Guest interface<br/>[GuestPage.jsx]"]
  node_identity["Room identity<br/>[useGuestContext.js]"]
  node_clientapi["API client<br/>[api.js]"]
end

subgraph group_backend["Concierge backend"]
  node_sessionroute["Session routes<br/>[session.js]"]
  node_server["HTTP server<br/>[server.js]"]
  node_chatroute["Chat routes<br/>[chat.js]"]
  node_menuroute["Menu routes<br/>[menu.js]"]
  node_cartroute["Cart routes<br/>[cart.js]"]
  node_orderroutes["Order routes<br/>[orders.js]"]
  node_tools["Concierge tools<br/>[tools.js]"]
  node_serviceflows["Service requests<br/>[serviceFlows.js]"]
  node_travel["Travel bookings<br/>[travel.js]"]
  node_tracking["Order tracking<br/>[orderTracking.js]"]
end

subgraph group_operations["Hotel operations"]
  node_adminui["Staff console<br/>[AdminPage.jsx]"]
  node_review["Upload review<br/>[ReviewModal.jsx]"]
  node_adminroutes["Admin routes<br/>[admin.js]"]
  node_traveladmin["Travel admin<br/>[adminTravel.js]"]
end

subgraph group_state["Session and data"]
  node_db[("Hotel database<br/>[db.js]")]
  node_cache["Lookup cache<br/>[cache.js]"]
  node_sessioncontext["Session context<br/>[sessionContext.js]"]
  node_sessionid["Browser session ID<br/>[useSessionId.js]"]
end

subgraph group_voice["Voice interaction"]
  node_voiceui["Live voice hook"]
  node_voicecall["Voice call runtime<br/>[call.js]"]
  node_toolrunner["Voice tool runner<br/>[toolRunner.js]"]
  node_realtime["Realtime proxy<br/>[realtime.js]"]
end

node_guest(("Guest"))

node_guest -->|"uses"| node_guestui
node_guestui -->|"loads identity"| node_identity
node_identity -->|"checks room"| node_clientapi
node_identity -->|"resets session"| node_sessionid
node_guestui -->|"requests data"| node_clientapi
node_clientapi -.->|"HTTP requests"| node_server
node_server -->|"routes requests"| node_sessionroute
node_server -->|"routes requests"| node_chatroute
node_server -->|"routes requests"| node_menuroute
node_server -->|"routes requests"| node_cartroute
node_server -->|"routes requests"| node_orderroutes
node_server -->|"routes requests"| node_adminroutes
node_server -->|"routes requests"| node_traveladmin
node_sessionroute -->|"reads and writes"| node_db
node_sessionroute -->|"builds tracking"| node_tracking
node_db -->|"caches lookups"| node_cache
node_chatroute -.->|"dispatches tools"| node_tools
node_cartroute -.->|"uses tools"| node_tools
node_orderroutes -.->|"serves tracking"| node_tracking
node_tools -->|"queries catalog"| node_db
node_tools -->|"handles bookings"| node_travel
node_tools -.->|"handles requests"| node_serviceflows
node_serviceflows -->|"reads and writes"| node_db
node_serviceflows -->|"updates context"| node_sessioncontext
node_traveladmin -->|"manages travel"| node_travel
node_traveladmin -->|"reads and writes"| node_db
node_adminui -->|"reviews uploads"| node_review
node_review -->|"approves uploads"| node_clientapi
node_adminui -.->|"admin requests"| node_adminroutes
node_voiceui -.->|"opens socket"| node_realtime
node_server -->|"attaches proxy"| node_realtime
node_realtime -.->|"forwards voice"| node_voicecall
node_voicecall -->|"invokes tools"| node_tools
node_voicecall -->|"delegates tools"| node_toolrunner
node_toolrunner -->|"executes tools"| node_tools
node_voicecall -->|"reads and writes"| node_db
node_voicecall -->|"uses context"| node_sessioncontext

click node_guestui "https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/pages/GuestPage.jsx"
click node_identity "https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/hooks/useGuestContext.js"
click node_clientapi "https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/services/api.js"
click node_sessionroute "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/session.js"
click node_server "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/server.js"
click node_chatroute "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/chat.js"
click node_menuroute "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/menu.js"
click node_cartroute "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/cart.js"
click node_orderroutes "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/orders.js"
click node_tools "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/tools.js"
click node_serviceflows "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/serviceFlows.js"
click node_travel "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/travel.js"
click node_tracking "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/orderTracking.js"
click node_adminui "https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/pages/AdminPage.jsx"
click node_review "https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/components/ReviewModal.jsx"
click node_adminroutes "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/admin.js"
click node_traveladmin "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/adminTravel.js"
click node_voiceui "https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/hooks/useRealtimeVoice.js"
click node_voicecall "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/voice/call.js"
click node_toolrunner "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/voice/toolRunner.js"
click node_realtime "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/realtime.js"
click node_db "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/db.js"
click node_cache "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/cache.js"
click node_sessioncontext "https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/sessionContext.js"
click node_sessionid "https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/hooks/useSessionId.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_guestui,node_identity,node_clientapi toneBlue
class node_sessionroute,node_server,node_chatroute,node_menuroute,node_cartroute,node_orderroutes,node_tools,node_serviceflows,node_travel,node_tracking toneAmber
class node_adminui,node_review,node_adminroutes,node_traveladmin toneMint
class node_db,node_cache,node_sessioncontext,node_sessionid toneRose
class node_voiceui,node_voicecall,node_toolrunner,node_realtime,node_guest toneIndigo
```

## Components

### Guest experience

- [Guest interface](https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/pages/GuestPage.jsx): `frontend/src/pages/GuestPage.jsx`
- [Room identity](https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/hooks/useGuestContext.js): `frontend/src/hooks/useGuestContext.js`
- [API client](https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Concierge backend

- [Session routes](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/session.js): `backend/src/routes/session.js`
- [HTTP server](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/server.js): `backend/src/server.js`
- [Chat routes](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/chat.js): `backend/src/routes/chat.js`
- [Menu routes](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/menu.js): `backend/src/routes/menu.js`
- [Cart routes](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/cart.js): `backend/src/routes/cart.js`
- [Order routes](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/orders.js): `backend/src/routes/orders.js`
- [Concierge tools](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/tools.js): `backend/src/tools.js`
- [Service requests](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/serviceFlows.js): `backend/src/serviceFlows.js`
- [Travel bookings](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/travel.js): `backend/src/travel.js`
- [Order tracking](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/orderTracking.js): `backend/src/orderTracking.js`

### Hotel operations

- [Staff console](https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/pages/AdminPage.jsx): `frontend/src/pages/AdminPage.jsx`
- [Upload review](https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/components/ReviewModal.jsx): `frontend/src/components/ReviewModal.jsx`
- [Admin routes](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/admin.js): `backend/src/routes/admin.js`
- [Travel admin](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/routes/adminTravel.js): `backend/src/routes/adminTravel.js`

### Session and data

- [Hotel database](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/db.js): `backend/src/db.js`
- [Lookup cache](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/cache.js): `backend/src/cache.js`
- [Session context](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/sessionContext.js): `backend/src/sessionContext.js`
- [Browser session ID](https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/hooks/useSessionId.js): `frontend/src/hooks/useSessionId.js`

### Voice interaction

- [Live voice hook](https://github.com/srinivas-gowda31/restaurant_app/blob/main/frontend/src/hooks/useRealtimeVoice.js): `frontend/src/hooks/useRealtimeVoice.js`
- [Voice call runtime](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/voice/call.js): `backend/src/voice/call.js`
- [Voice tool runner](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/voice/toolRunner.js): `backend/src/voice/toolRunner.js`
- [Realtime proxy](https://github.com/srinivas-gowda31/restaurant_app/blob/main/backend/src/realtime.js): `backend/src/realtime.js`

### Other components

- **Guest**

## Connections

- Guest → Guest interface: uses
- Guest interface → Room identity: loads identity (evidence: `frontend/src/pages/GuestPage.jsx`)
- Room identity → API client: checks room (evidence: `frontend/src/hooks/useGuestContext.js`)
- Room identity → Browser session ID: resets session (evidence: `frontend/src/hooks/useGuestContext.js`)
- Guest interface → API client: requests data (evidence: `frontend/src/pages/GuestPage.jsx`)
- API client → HTTP server: HTTP requests
- HTTP server → Session routes: routes requests (evidence: `backend/src/server.js`)
- HTTP server → Chat routes: routes requests (evidence: `backend/src/server.js`)
- HTTP server → Menu routes: routes requests (evidence: `backend/src/server.js`)
- HTTP server → Cart routes: routes requests (evidence: `backend/src/server.js`)
- HTTP server → Order routes: routes requests (evidence: `backend/src/server.js`)
- HTTP server → Admin routes: routes requests (evidence: `backend/src/server.js`)
- HTTP server → Travel admin: routes requests (evidence: `backend/src/server.js`)
- Session routes → Hotel database: reads and writes (evidence: `backend/src/routes/session.js`)
- Session routes → Order tracking: builds tracking (evidence: `backend/src/routes/session.js`)
- Hotel database → Lookup cache: caches lookups (evidence: `backend/src/db.js`)
- Chat routes → Concierge tools: dispatches tools
- Cart routes → Concierge tools: uses tools
- Order routes → Order tracking: serves tracking
- Concierge tools → Hotel database: queries catalog (evidence: `backend/src/tools.js`)
- Concierge tools → Travel bookings: handles bookings (evidence: `backend/src/tools.js`)
- Concierge tools → Service requests: handles requests (evidence: `backend/src/tools.js`)
- Service requests → Hotel database: reads and writes (evidence: `backend/src/serviceFlows.js`)
- Service requests → Session context: updates context (evidence: `backend/src/serviceFlows.js`)
- Travel admin → Travel bookings: manages travel (evidence: `backend/src/routes/adminTravel.js`)
- Travel admin → Hotel database: reads and writes (evidence: `backend/src/routes/adminTravel.js`)
- Staff console → Upload review: reviews uploads (evidence: `frontend/src/pages/AdminPage.jsx`)
- Upload review → API client: approves uploads (evidence: `frontend/src/components/ReviewModal.jsx`)
- Staff console → Admin routes: admin requests
- Live voice hook → Realtime proxy: opens socket
- HTTP server → Realtime proxy: attaches proxy (evidence: `backend/src/server.js`)
- Realtime proxy → Voice call runtime: forwards voice
- Voice call runtime → Concierge tools: invokes tools (evidence: `backend/src/voice/call.js`)
- Voice call runtime → Voice tool runner: delegates tools (evidence: `backend/src/voice/call.js`)
- Voice tool runner → Concierge tools: executes tools (evidence: `backend/src/voice/toolRunner.js`)
- Voice call runtime → Hotel database: reads and writes (evidence: `backend/src/voice/call.js`)
- Voice call runtime → Session context: uses context (evidence: `backend/src/voice/call.js`)
