# hansajaweerarathna/bahi-tv-preact architecture

> Architecture diagram of the GitHub repository hansajaweerarathna/bahi-tv-preact, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hansajaweerarathna/bahi-tv-preact
- Repository: https://github.com/hansajaweerarathna/bahi-tv-preact

## Overview

Bahi TV is a remote-first hotel guest interface. A guest enters the routed app, navigates from Home to a service, and follows its screen flow; room service includes menu selection, review, and confirmation. Other documented capabilities include offers, alarms, hotel information, guest requests, Arabic/RTL, and demo states. The map shows the app router and remote-navigation layer alongside representative domain state. Some pages and integrations are unsampled; their inclusion reflects documented capabilities, while uncertain implementation links are omitted.

Main entry points: [`src/app/App.tsx`](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/app/App.tsx) (App router), [`src/pages/home`](https://github.com/hansajaweerarathna/bahi-tv-preact/tree/main/src/pages/home) (Home screen), [`src/pages/room-service/RoomServicePage.tsx`](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/RoomServicePage.tsx) (Room service), [`src/features/demo-tools/demo-actions.ts`](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/demo-tools/demo-actions.ts) (Demo tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_app["App router<br/>[App.tsx]"]
  node_documentprefs["Document preferences"]
  node_demo["Demo tools<br/>[demo-actions.ts]"]
end

subgraph group_experience["Guest experience"]
  node_home["Home screen"]
  node_tiles["Service tiles<br/>[tiles.ts]"]
  node_greeting["Greeting band"]
  node_notices["Notice strip<br/>[NoticeStrip.tsx]"]
  node_offers["Offer spotlight<br/>[OfferSpotlight.tsx]"]
end

subgraph group_services["Guest services"]
  node_roomservice["Room service"]
  node_servicecatalog["Service rows<br/>[rows.ts]"]
  node_menuitem["Menu item<br/>[MenuItemPage.tsx]"]
  node_orderreview["Order review"]
  node_orderdone["Order confirmation<br/>[OrderDonePage.tsx]"]
  node_alarms["Alarm feature<br/>[model.ts]"]
  node_otherpages["Other guest pages"]
end

subgraph group_state["Domain state"]
  node_offerstate["Offer state<br/>[model.ts]"]
  node_foodorder["Food order state<br/>[model.ts]"]
  node_housekeeping["Housekeeping requests<br/>[model.ts]"]
  node_alarmstate["Alarm state<br/>[model.ts]"]
  node_guestdata["Guest data<br/>[model.ts]"]
  node_messages["Guest messages<br/>[model.ts]"]
  node_preferences["Display preferences<br/>[model.ts]"]
end

subgraph group_navigation["Remote navigation"]
  node_remote["Remote control<br/>[RemoteControl.tsx]"]
  node_keyhandlers["Key handler registry<br/>[key-handlers.ts]"]
  node_focus["Focus registry<br/>[focus-registry.ts]"]
end

node_guest(("Hotel guest"))

node_guest -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_roomservice
node_app -->|"starts alarms"| node_alarms
node_app -->|"applies preferences"| node_documentprefs
node_app -->|"renders"| node_remote
node_app -->|"shows in demo"| node_demo
node_app -->|"routes to"| node_otherpages
node_home -->|"presents"| node_tiles
node_home -->|"presents"| node_greeting
node_home -->|"shows notices"| node_notices
node_home -->|"shows promotions"| node_offers
node_offers -->|"reads offers"| node_offerstate
node_roomservice -->|"builds rows"| node_servicecatalog
node_servicecatalog -->|"uses order feature"| node_foodorder
node_servicecatalog -->|"uses request feature"| node_housekeeping
node_guest -->|"selects item"| node_menuitem
node_menuitem -->|"reviews order"| node_orderreview
node_orderreview -->|"confirms order"| node_orderdone
node_alarms -->|"uses alarm state"| node_alarmstate
node_documentprefs -->|"reads preferences"| node_preferences
node_remote -->|"dispatches keys"| node_keyhandlers
node_roomservice -->|"sets focus"| node_focus
node_roomservice -->|"registers handler"| node_keyhandlers
node_demo -->|"updates demo state"| node_guestdata
node_demo -->|"updates demo state"| node_messages

click node_app "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/app/App.tsx"
click node_home "https://github.com/hansajaweerarathna/bahi-tv-preact/tree/main/src/pages/home"
click node_tiles "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/widgets/service-tiles/tiles.ts"
click node_greeting "https://github.com/hansajaweerarathna/bahi-tv-preact/tree/main/src/widgets/greeting-band"
click node_notices "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/widgets/notice-strip/NoticeStrip.tsx"
click node_offers "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/widgets/offer-spotlight/OfferSpotlight.tsx"
click node_offerstate "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/offer/model.ts"
click node_roomservice "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/RoomServicePage.tsx"
click node_servicecatalog "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/rows.ts"
click node_foodorder "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/order-food/model.ts"
click node_housekeeping "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/request-housekeeping/model.ts"
click node_menuitem "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/MenuItemPage.tsx"
click node_orderreview "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/OrderReviewPage.tsx"
click node_orderdone "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/OrderDonePage.tsx"
click node_alarms "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/alarms/model.ts"
click node_alarmstate "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/alarm/model.ts"
click node_guestdata "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/guest/model.ts"
click node_messages "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/message/model.ts"
click node_preferences "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/preferences/model.ts"
click node_documentprefs "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/app/useDocumentPreferences.ts"
click node_remote "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/shared/remote-navigation/ui/RemoteControl.tsx"
click node_keyhandlers "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/shared/remote-navigation/model/key-handlers.ts"
click node_focus "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/shared/remote-navigation/model/focus-registry.ts"
click node_demo "https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/demo-tools/demo-actions.ts"
click node_otherpages "https://github.com/hansajaweerarathna/bahi-tv-preact/tree/main/src/pages"

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_documentprefs,node_demo toneBlue
class node_home,node_tiles,node_greeting,node_notices,node_offers toneAmber
class node_roomservice,node_servicecatalog,node_menuitem,node_orderreview,node_orderdone,node_alarms,node_otherpages toneMint
class node_offerstate,node_foodorder,node_housekeeping,node_alarmstate,node_guestdata,node_messages,node_preferences toneRose
class node_remote,node_keyhandlers,node_focus,node_guest toneIndigo
```

## Components

### App shell

- [App router](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Document preferences](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/app/useDocumentPreferences.ts): `src/app/useDocumentPreferences.ts`
- [Demo tools](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/demo-tools/demo-actions.ts): `src/features/demo-tools/demo-actions.ts`

### Guest experience

- [Home screen](https://github.com/hansajaweerarathna/bahi-tv-preact/tree/main/src/pages/home): `src/pages/home`
- [Service tiles](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/widgets/service-tiles/tiles.ts): `src/widgets/service-tiles/tiles.ts`
- [Greeting band](https://github.com/hansajaweerarathna/bahi-tv-preact/tree/main/src/widgets/greeting-band): `src/widgets/greeting-band`
- [Notice strip](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/widgets/notice-strip/NoticeStrip.tsx): `src/widgets/notice-strip/NoticeStrip.tsx`
- [Offer spotlight](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/widgets/offer-spotlight/OfferSpotlight.tsx): `src/widgets/offer-spotlight/OfferSpotlight.tsx`

### Guest services

- [Room service](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/RoomServicePage.tsx): `src/pages/room-service/RoomServicePage.tsx`
- [Service rows](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/rows.ts): `src/pages/room-service/rows.ts`
- [Menu item](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/MenuItemPage.tsx): `src/pages/room-service/MenuItemPage.tsx`
- [Order review](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/OrderReviewPage.tsx): `src/pages/room-service/OrderReviewPage.tsx`
- [Order confirmation](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/pages/room-service/OrderDonePage.tsx): `src/pages/room-service/OrderDonePage.tsx`
- [Alarm feature](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/alarms/model.ts): `src/features/alarms/model.ts`
- [Other guest pages](https://github.com/hansajaweerarathna/bahi-tv-preact/tree/main/src/pages): `src/pages`

### Domain state

- [Offer state](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/offer/model.ts): `src/entities/offer/model.ts`
- [Food order state](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/order-food/model.ts): `src/features/order-food/model.ts`
- [Housekeeping requests](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/features/request-housekeeping/model.ts): `src/features/request-housekeeping/model.ts`
- [Alarm state](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/alarm/model.ts): `src/entities/alarm/model.ts`
- [Guest data](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/guest/model.ts): `src/entities/guest/model.ts`
- [Guest messages](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/message/model.ts): `src/entities/message/model.ts`
- [Display preferences](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/entities/preferences/model.ts): `src/entities/preferences/model.ts`

### Remote navigation

- [Remote control](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/shared/remote-navigation/ui/RemoteControl.tsx): `src/shared/remote-navigation/ui/RemoteControl.tsx`
- [Key handler registry](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/shared/remote-navigation/model/key-handlers.ts): `src/shared/remote-navigation/model/key-handlers.ts`
- [Focus registry](https://github.com/hansajaweerarathna/bahi-tv-preact/blob/main/src/shared/remote-navigation/model/focus-registry.ts): `src/shared/remote-navigation/model/focus-registry.ts`

### Other components

- **Hotel guest**

## Connections

- Hotel guest → App router: uses
- App router → Home screen: routes to (evidence: `src/app/App.tsx`)
- App router → Room service: routes to (evidence: `src/app/App.tsx`)
- App router → Alarm feature: starts alarms (evidence: `src/app/App.tsx`)
- App router → Document preferences: applies preferences (evidence: `src/app/App.tsx`)
- App router → Remote control: renders (evidence: `src/app/App.tsx`)
- App router → Demo tools: shows in demo (evidence: `src/app/App.tsx`)
- App router → Other guest pages: routes to (evidence: `src/app/App.tsx`)
- Home screen → Service tiles: presents
- Home screen → Greeting band: presents
- Home screen → Notice strip: shows notices (evidence: `src/widgets/notice-strip/NoticeStrip.tsx`)
- Home screen → Offer spotlight: shows promotions
- Offer spotlight → Offer state: reads offers (evidence: `src/widgets/offer-spotlight/OfferSpotlight.tsx`)
- Room service → Service rows: builds rows (evidence: `src/pages/room-service/RoomServicePage.tsx`)
- Service rows → Food order state: uses order feature (evidence: `src/pages/room-service/rows.ts`)
- Service rows → Housekeeping requests: uses request feature (evidence: `src/pages/room-service/rows.ts`)
- Hotel guest → Menu item: selects item
- Menu item → Order review: reviews order
- Order review → Order confirmation: confirms order
- Alarm feature → Alarm state: uses alarm state (evidence: `src/features/alarms/model.ts`)
- Document preferences → Display preferences: reads preferences (evidence: `src/app/useDocumentPreferences.ts`)
- Remote control → Key handler registry: dispatches keys (evidence: `src/shared/remote-navigation/index.ts`)
- Room service → Focus registry: sets focus (evidence: `src/pages/room-service/RoomServicePage.tsx`)
- Room service → Key handler registry: registers handler (evidence: `src/pages/room-service/RoomServicePage.tsx`)
- Demo tools → Guest data: updates demo state (evidence: `src/features/demo-tools/demo-actions.ts`)
- Demo tools → Guest messages: updates demo state (evidence: `src/features/demo-tools/demo-actions.ts`)
