# shashwat1213/the-living-canvas-pms architecture

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

- Interactive diagram: https://gitdiagram.com/shashwat1213/the-living-canvas-pms
- Repository: https://github.com/shashwat1213/the-living-canvas-pms

## Overview

The Living Canvas is a multi-tenant hospitality PMS. Staff sign in, select a property, and use the SPA to manage bookings and day-to-day operations; property-scoped API handlers authorize requests and serve domain workflows. Reservations, folios and payments form a central business path, alongside property setup, operations, reporting, CRM, audit and notifications. AI marketing and the read-only assistant are additional capabilities. The README documents overall architecture; some domain modules were not sampled, so their internal call paths are not asserted.

Main entry points: [`backend/src/modules/reservations/routes.ts`](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/reservations/routes.ts) (Reservations), [`backend/src/lib/prisma.ts`](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/lib/prisma.ts) (PostgreSQL data), [`frontend/src/AppRouter.tsx`](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/AppRouter.tsx) (React SPA), [`frontend/src/lib/api.ts`](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Staff application"]
  node_spa["React SPA<br/>[AppRouter.tsx]"]
  node_authui["Session UI<br/>[session.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_booking_ui["Reservations UI"]
  node_calendar_ui["Calendar UI<br/>[CalendarPage.tsx]"]
end

subgraph group_access["Identity and tenancy"]
  node_identity["Authentication<br/>[routes.ts]"]
  node_session_service["Session service<br/>[session-service.ts]"]
  node_tenant_auth["Tenant authentication<br/>[middleware.ts]"]
  node_rbac["Permission guards<br/>[guard.ts]"]
end

subgraph group_hotel["Property workflows"]
  node_property["Property setup<br/>[routes.ts]"]
  node_room_rates["Rooms and rates"]
  node_reservations["Reservations<br/>[routes.ts]"]
  node_folios["Folios and payments<br/>[routes.ts]"]
  node_guest_crm["Guest CRM"]
  node_calendar["Availability and calendar"]
end

subgraph group_operations["Operations and insight"]
  node_ops["Hotel operations"]
  node_pos["Point of sale"]
  node_insight["Dashboard and reports"]
  node_marketing["AI marketing"]
  node_assistant["AI assistant"]
  node_audit_notify["Audit and notifications"]
end

subgraph group_platform["Shared platform"]
  node_database[("PostgreSQL data<br/>[prisma.ts]")]
  node_payment_gateway["Payment gateway"]
  node_ai_provider["AI provider seam<br/>[registry.ts]"]
  node_job_queue["Background jobs<br/>[queue.ts]"]
end

node_staff(("Hotel staff"))

node_staff -->|"uses"| node_spa
node_spa -->|"derives session"| node_authui
node_spa -->|"routes to"| node_booking_ui
node_spa -->|"routes to"| node_calendar_ui
node_booking_ui -->|"requests data"| node_api_client
node_calendar_ui -->|"requests data"| node_api_client
node_api_client -->|"refreshes token"| node_identity
node_api_client -.->|"calls API"| node_reservations
node_staff -->|"signs in"| node_identity
node_identity -->|"manages sessions"| node_session_service
node_session_service -->|"reads and writes"| node_database
node_tenant_auth -->|"sets request context"| node_rbac
node_reservations -->|"guards routes"| node_rbac
node_reservations -->|"scoped persistence"| node_database
node_folios -->|"guards routes"| node_rbac
node_folios -->|"opens payment intents"| node_payment_gateway
node_reservations -->|"bills stays"| node_folios
node_pos -->|"settles to room folios"| node_folios
node_room_rates -->|"belongs to property"| node_property
node_calendar -->|"shows booking timeline"| node_reservations
node_insight -.->|"reads business data"| node_database
node_marketing -->|"generates copy"| node_ai_provider
node_assistant -->|"answers questions"| node_ai_provider
node_assistant -->|"grounds responses"| node_insight
node_audit_notify -->|"uses queued jobs"| node_job_queue
node_reservations -->|"audits mutations"| node_audit_notify
node_ops -.->|"persists operations"| node_database
node_guest_crm -.->|"persists guest records"| node_database

click node_spa "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/AppRouter.tsx"
click node_authui "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/auth/session.ts"
click node_api_client "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/lib/api.ts"
click node_booking_ui "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/features/reservations/ReservationsPage.tsx"
click node_calendar_ui "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/features/calendar/CalendarPage.tsx"
click node_identity "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/auth/routes.ts"
click node_session_service "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/auth/session-service.ts"
click node_tenant_auth "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/tenancy/middleware.ts"
click node_rbac "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/rbac/guard.ts"
click node_property "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/properties/routes.ts"
click node_room_rates "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/rooms"
click node_reservations "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/reservations/routes.ts"
click node_folios "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/folios/routes.ts"
click node_guest_crm "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/guests"
click node_calendar "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/calendar"
click node_ops "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/housekeeping"
click node_pos "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/pos"
click node_insight "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/reports"
click node_marketing "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/marketing"
click node_assistant "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/assistant"
click node_audit_notify "https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/audit"
click node_database "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/lib/prisma.ts"
click node_payment_gateway "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/payments/razorpay-provider.ts"
click node_ai_provider "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/ai/registry.ts"
click node_job_queue "https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/jobs/queue.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_spa,node_authui,node_api_client,node_booking_ui,node_calendar_ui toneBlue
class node_identity,node_session_service,node_tenant_auth,node_rbac toneAmber
class node_property,node_room_rates,node_reservations,node_folios,node_guest_crm,node_calendar toneMint
class node_ops,node_pos,node_insight,node_marketing,node_assistant,node_audit_notify toneRose
class node_database,node_payment_gateway,node_ai_provider,node_job_queue,node_staff toneIndigo
```

## Components

### Staff application

- [React SPA](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/AppRouter.tsx): `frontend/src/AppRouter.tsx`
- [Session UI](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/auth/session.ts): `frontend/src/auth/session.ts`
- [API client](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Reservations UI](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/features/reservations/ReservationsPage.tsx): `frontend/src/features/reservations/ReservationsPage.tsx`
- [Calendar UI](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/frontend/src/features/calendar/CalendarPage.tsx): `frontend/src/features/calendar/CalendarPage.tsx`

### Identity and tenancy

- [Authentication](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/auth/routes.ts): `backend/src/modules/auth/routes.ts`
- [Session service](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/auth/session-service.ts): `backend/src/platform/auth/session-service.ts`
- [Tenant authentication](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/tenancy/middleware.ts): `backend/src/platform/tenancy/middleware.ts`
- [Permission guards](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/rbac/guard.ts): `backend/src/platform/rbac/guard.ts`

### Property workflows

- [Property setup](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/properties/routes.ts): `backend/src/modules/properties/routes.ts`
- [Rooms and rates](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/rooms): `backend/src/modules/rooms`
- [Reservations](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/reservations/routes.ts): `backend/src/modules/reservations/routes.ts`
- [Folios and payments](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/modules/folios/routes.ts): `backend/src/modules/folios/routes.ts`
- [Guest CRM](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/guests): `backend/src/modules/guests`
- [Availability and calendar](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/calendar): `backend/src/modules/calendar`

### Operations and insight

- [Hotel operations](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/housekeeping): `backend/src/modules/housekeeping`
- [Point of sale](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/pos): `backend/src/modules/pos`
- [Dashboard and reports](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/reports): `backend/src/modules/reports`
- [AI marketing](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/marketing): `backend/src/modules/marketing`
- [AI assistant](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/assistant): `backend/src/modules/assistant`
- [Audit and notifications](https://github.com/shashwat1213/the-living-canvas-pms/tree/main/backend/src/modules/audit): `backend/src/modules/audit`

### Shared platform

- [PostgreSQL data](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/lib/prisma.ts): `backend/src/lib/prisma.ts`
- [Payment gateway](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/payments/razorpay-provider.ts): `backend/src/platform/payments/razorpay-provider.ts`
- [AI provider seam](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/ai/registry.ts): `backend/src/platform/ai/registry.ts`
- [Background jobs](https://github.com/shashwat1213/the-living-canvas-pms/blob/main/backend/src/platform/jobs/queue.ts): `backend/src/platform/jobs/queue.ts`

### Other components

- **Hotel staff**

## Connections

- Hotel staff → React SPA: uses
- React SPA → Session UI: derives session (evidence: `frontend/src/auth/session.ts`)
- React SPA → Reservations UI: routes to (evidence: `frontend/src/AppRouter.tsx`)
- React SPA → Calendar UI: routes to (evidence: `frontend/src/AppRouter.tsx`)
- Reservations UI → API client: requests data (evidence: `frontend/src/features/reservations/ReservationsPage.tsx`)
- Calendar UI → API client: requests data (evidence: `frontend/src/features/calendar/CalendarPage.tsx`)
- API client → Authentication: refreshes token (evidence: `frontend/src/lib/api.ts`)
- API client → Reservations: calls API
- Hotel staff → Authentication: signs in
- Authentication → Session service: manages sessions (evidence: `backend/src/modules/auth/routes.ts`)
- Session service → PostgreSQL data: reads and writes (evidence: `backend/src/platform/auth/session-service.ts`)
- Tenant authentication → Permission guards: sets request context (evidence: `backend/src/platform/tenancy/middleware.ts`)
- Reservations → Permission guards: guards routes (evidence: `backend/src/modules/reservations/routes.ts`)
- Reservations → PostgreSQL data: scoped persistence
- Folios and payments → Permission guards: guards routes (evidence: `backend/src/modules/folios/routes.ts`)
- Folios and payments → Payment gateway: opens payment intents (evidence: `backend/src/modules/folios/routes.ts`)
- Reservations → Folios and payments: bills stays
- Point of sale → Folios and payments: settles to room folios
- Rooms and rates → Property setup: belongs to property
- Availability and calendar → Reservations: shows booking timeline
- Dashboard and reports → PostgreSQL data: reads business data
- AI marketing → AI provider seam: generates copy
- AI assistant → AI provider seam: answers questions
- AI assistant → Dashboard and reports: grounds responses
- Audit and notifications → Background jobs: uses queued jobs
- Reservations → Audit and notifications: audits mutations
- Hotel operations → PostgreSQL data: persists operations
- Guest CRM → PostgreSQL data: persists guest records
