# tanmayagrawal21/roomwizard-reserve-ai architecture

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

- Interactive diagram: https://gitdiagram.com/tanmayagrawal21/roomwizard-reserve-ai
- Repository: https://github.com/tanmayagrawal21/roomwizard-reserve-ai

## Overview

RoomWizard Reserve AI combines a browser-based room picker and booking manager with a network-local relay that reads and writes RoomWizard appliances. The main flow is: users browse fleet availability or search for a slot, choose a room and time, then create, edit, or cancel a booking through the relay. A chat assistant can also query room and slot information and manage bookings. The graph preserves these product branches and the relay’s appliance, configuration, and conversation-state layers. Some subsystem links come from README statements or SOURCE INDEX references; unsampled implementations are not assumed to have been inspected.

Main entry points: [`web/src/App.tsx`](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/App.tsx) (Picker application), [`relay/src/app.ts`](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/app.ts) (HTTP routes), [`relay/src/tools.ts`](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/tools.ts) (Assistant tools), [`web/src/api.ts`](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/api.ts) (Relay API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser experience"]
  node_app["Picker application<br/>[App.tsx]"]
  node_api["Relay API client<br/>[api.ts]"]
  node_roomrow["Room timelines<br/>[RoomRow.tsx]"]
  node_bookingui["Booking forms<br/>[BookingModal.tsx]"]
  node_bookingfields["Booking fields<br/>[BookingFields.tsx]"]
  node_slotui["Slot finder UI<br/>[SlotFinder.tsx]"]
  node_chatui["Chat panel<br/>[ChatPanel.tsx]"]
  node_filters["Room filters<br/>[filters.ts]"]
  node_localbookings[("Remembered bookings<br/>[myBookings.ts]")]
end

subgraph group_relay["Relay services"]
  node_http["HTTP routes<br/>[app.ts]"]
  node_fleet["Fleet roster<br/>[rooms.ts]"]
  node_availability["Availability<br/>[availability.ts]"]
  node_slotsearch["Ranked slot search<br/>[slots.ts]"]
  node_booking["Booking operations<br/>[booking.ts]"]
  node_config["Site configuration<br/>[config.ts]"]
end

subgraph group_appliance["Appliance access"]
  node_apiclient["RoomWizard client<br/>[roomwizard.ts]"]
  node_session["Appliance session<br/>[session.ts]"]
end

subgraph group_assistant["Assistant and state"]
  node_agent["Assistant orchestration<br/>[agent.ts]"]
  node_llm["LLM client<br/>[llm.ts]"]
  node_tools["Assistant tools<br/>[tools.ts]"]
  node_chatstore[("Conversation history<br/>[chatStore.ts]")]
  node_bookingstore[("Booking ownership state<br/>[bookingStore.ts]")]
end

node_user(("Room-booking user"))
node_appliances{{"RoomWizard appliances"}}
node_model{{"Local or compatible LLM"}}

node_user -->|"uses"| node_app
node_app -->|"fetches fleet and availability"| node_api
node_app -->|"renders rooms"| node_roomrow
node_app -->|"filters rooms"| node_filters
node_roomrow -.->|"opens booking"| node_bookingui
node_bookingui -->|"renders fields"| node_bookingfields
node_bookingui -->|"submits booking changes"| node_api
node_bookingui -->|"remembers booking"| node_localbookings
node_app -->|"opens finder"| node_slotui
node_slotui -->|"searches slots"| node_api
node_app -->|"shows chat"| node_chatui
node_chatui -->|"streams chat"| node_api
node_chatui -->|"reads bookings"| node_localbookings
node_api -->|"calls relay endpoints"| node_http
node_http -->|"loads roster"| node_fleet
node_http -->|"serves availability"| node_availability
node_http -->|"serves slot search"| node_slotsearch
node_http -->|"routes booking changes"| node_booking
node_http -->|"runs assistant turns"| node_agent
node_fleet -->|"fetches roster"| node_apiclient
node_availability -->|"reads schedules"| node_apiclient
node_booking -->|"submits appliance forms"| node_session
node_slotsearch -->|"uses free time"| node_availability
node_agent -->|"dispatches tools"| node_tools
node_agent -->|"requests completions"| node_llm
node_agent -->|"loads and saves history"| node_chatstore
node_tools -->|"queries rooms"| node_fleet
node_tools -->|"searches slots"| node_slotsearch
node_tools -->|"manages bookings"| node_booking
node_tools -->|"uses ownership state"| node_bookingstore
node_apiclient -->|"requests roster and schedules"| node_appliances
node_session -->|"sends booking forms"| node_appliances
node_llm -->|"sends chat requests"| node_model
node_config -.->|"configures fleet"| node_fleet
node_config -.->|"configures provider"| node_llm

click node_app "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/App.tsx"
click node_api "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/api.ts"
click node_roomrow "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/RoomRow.tsx"
click node_bookingui "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/BookingModal.tsx"
click node_bookingfields "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/BookingFields.tsx"
click node_slotui "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/SlotFinder.tsx"
click node_chatui "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/ChatPanel.tsx"
click node_filters "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/lib/filters.ts"
click node_localbookings "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/lib/myBookings.ts"
click node_http "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/app.ts"
click node_fleet "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/rooms.ts"
click node_availability "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/availability.ts"
click node_slotsearch "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/slots.ts"
click node_booking "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/booking.ts"
click node_config "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/config.ts"
click node_apiclient "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/roomwizard.ts"
click node_session "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/session.ts"
click node_agent "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/agent.ts"
click node_llm "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/llm.ts"
click node_tools "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/tools.ts"
click node_chatstore "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/chatStore.ts"
click node_bookingstore "https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/bookingStore.ts"

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_api,node_roomrow,node_bookingui,node_bookingfields,node_slotui,node_chatui,node_filters,node_localbookings,node_user toneBlue
class node_http,node_fleet,node_availability,node_slotsearch,node_booking,node_config toneAmber
class node_apiclient,node_session toneMint
class node_agent,node_llm,node_tools,node_chatstore,node_bookingstore toneRose
class node_appliances,node_model toneIndigo
```

## Components

### Browser experience

- [Picker application](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Relay API client](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/api.ts): `web/src/api.ts`
- [Room timelines](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/RoomRow.tsx): `web/src/components/RoomRow.tsx`
- [Booking forms](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/BookingModal.tsx): `web/src/components/BookingModal.tsx`
- [Booking fields](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/BookingFields.tsx): `web/src/components/BookingFields.tsx`
- [Slot finder UI](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/SlotFinder.tsx): `web/src/components/SlotFinder.tsx`
- [Chat panel](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/components/ChatPanel.tsx): `web/src/components/ChatPanel.tsx`
- [Room filters](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/lib/filters.ts): `web/src/lib/filters.ts`
- [Remembered bookings](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/web/src/lib/myBookings.ts): `web/src/lib/myBookings.ts`

### Relay services

- [HTTP routes](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/app.ts): `relay/src/app.ts`
- [Fleet roster](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/rooms.ts): `relay/src/rooms.ts`
- [Availability](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/availability.ts): `relay/src/availability.ts`
- [Ranked slot search](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/slots.ts): `relay/src/slots.ts`
- [Booking operations](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/booking.ts): `relay/src/booking.ts`
- [Site configuration](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/config.ts): `relay/src/config.ts`

### Appliance access

- [RoomWizard client](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/roomwizard.ts): `relay/src/roomwizard.ts`
- [Appliance session](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/session.ts): `relay/src/session.ts`

### Assistant and state

- [Assistant orchestration](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/agent.ts): `relay/src/agent.ts`
- [LLM client](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/llm.ts): `relay/src/llm.ts`
- [Assistant tools](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/tools.ts): `relay/src/tools.ts`
- [Conversation history](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/chatStore.ts): `relay/src/chatStore.ts`
- [Booking ownership state](https://github.com/tanmayagrawal21/roomwizard-reserve-ai/blob/main/relay/src/bookingStore.ts): `relay/src/bookingStore.ts`

### Other components

- **Room-booking user**
- **RoomWizard appliances**
- **Local or compatible LLM**

## Connections

- Room-booking user → Picker application: uses (evidence: `README.md`)
- Picker application → Relay API client: fetches fleet and availability (evidence: `web/src/App.tsx`)
- Picker application → Room timelines: renders rooms (evidence: `web/src/App.tsx`)
- Picker application → Room filters: filters rooms (evidence: `web/src/App.tsx`)
- Room timelines → Booking forms: opens booking
- Booking forms → Booking fields: renders fields (evidence: `web/src/components/BookingModal.tsx`)
- Booking forms → Relay API client: submits booking changes (evidence: `web/src/components/BookingModal.tsx`)
- Booking forms → Remembered bookings: remembers booking (evidence: `web/src/components/BookingModal.tsx`)
- Picker application → Slot finder UI: opens finder (evidence: `web/src/App.tsx`)
- Slot finder UI → Relay API client: searches slots (evidence: `web/src/components/SlotFinder.tsx`)
- Picker application → Chat panel: shows chat (evidence: `web/src/App.tsx`)
- Chat panel → Relay API client: streams chat (evidence: `web/src/components/ChatPanel.tsx`)
- Chat panel → Remembered bookings: reads bookings (evidence: `web/src/components/ChatPanel.tsx`)
- Relay API client → HTTP routes: calls relay endpoints (evidence: `README.md`)
- HTTP routes → Fleet roster: loads roster (evidence: `relay/src/app.ts`)
- HTTP routes → Availability: serves availability (evidence: `relay/src/app.ts`)
- HTTP routes → Ranked slot search: serves slot search (evidence: `relay/src/app.ts`)
- HTTP routes → Booking operations: routes booking changes (evidence: `relay/src/app.ts`)
- HTTP routes → Assistant orchestration: runs assistant turns (evidence: `relay/src/app.ts`)
- Fleet roster → RoomWizard client: fetches roster (evidence: `relay/src/rooms.ts`)
- Availability → RoomWizard client: reads schedules (evidence: `relay/src/availability.ts`)
- Booking operations → Appliance session: submits appliance forms (evidence: `relay/src/booking.ts`)
- Ranked slot search → Availability: uses free time (evidence: `relay/src/slots.ts`)
- Assistant orchestration → Assistant tools: dispatches tools (evidence: `relay/src/agent.ts`)
- Assistant orchestration → LLM client: requests completions (evidence: `relay/src/agent.ts`)
- Assistant orchestration → Conversation history: loads and saves history (evidence: `relay/src/agent.ts`)
- Assistant tools → Fleet roster: queries rooms (evidence: `relay/src/tools.ts`)
- Assistant tools → Ranked slot search: searches slots (evidence: `relay/src/tools.ts`)
- Assistant tools → Booking operations: manages bookings (evidence: `relay/src/tools.ts`)
- Assistant tools → Booking ownership state: uses ownership state (evidence: `relay/src/tools.ts`)
- RoomWizard client → RoomWizard appliances: requests roster and schedules (evidence: `relay/src/roomwizard.ts`)
- Appliance session → RoomWizard appliances: sends booking forms (evidence: `relay/src/session.ts`)
- LLM client → Local or compatible LLM: sends chat requests (evidence: `relay/src/llm.ts`)
- Site configuration → Fleet roster: configures fleet (evidence: `relay/src/rooms.ts`)
- Site configuration → LLM client: configures provider (evidence: `relay/src/llm.ts`)
