# faisalkazi123-code/umrah architecture

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

- Interactive diagram: https://gitdiagram.com/faisalkazi123-code/umrah
- Repository: https://github.com/faisalkazi123-code/umrah

## Overview

Umrah Companion guides a pilgrim through the ritual stages, with offline-capable guidance, checklists, duas and persistent progress. The client validates and saves journey actions locally, then queues them for API sync; the server applies the same journey rules and scopes persisted data to a guest session. The README also describes Arabic/RTL support and broader guide content. Server-side routes and several page implementations were not excerpted, so their internal links are omitted where evidence is insufficient.

Main entry points: [`src/App.tsx`](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/App.tsx) (App routes), [`src/store/journeyStore.ts`](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/store/journeyStore.ts) (Journey state), [`server/app.ts`](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/app.ts) (Express API), [`server/db/client.ts`](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/db/client.ts) (Database client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Pilgrim app"]
  node_routing["App routes<br/>[App.tsx]"]
  node_shell["App shell<br/>[AppShell.tsx]"]
  node_ritual_pages["Ritual stages"]
  node_guide_pages["Guide and checklist<br/>[Guide.tsx]"]
  node_dua_pages["Dua library<br/>[Duas.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
  node_dua_ui["Dua display<br/>[Dua.tsx]"]
end

subgraph group_content["Guidance content"]
  node_content_loader["Content loader<br/>[index.ts]"]
  node_content_schema["Content schema<br/>[schema.ts]"]
end

subgraph group_journey["Journey rules"]
  node_journey_store["Journey state<br/>[journeyStore.ts]"]
  node_bookmark_store["Bookmarks<br/>[bookmarkStore.ts]"]
  node_journey_rules["Journey machine<br/>[journeyMachine.ts]"]
  node_round_rules["Round machine<br/>[roundMachine.ts]"]
  node_saee_rules["Sa'ee direction<br/>[saeeDirection.ts]"]
end

subgraph group_offline["Offline and sync"]
  node_local_db[("Device database<br/>[db.ts]")]
  node_sync["Outbox sync<br/>[sync.ts]"]
  node_service_worker["Service worker<br/>[sw-template.js]"]
end

subgraph group_server["API and persistence"]
  node_api["Express API<br/>[app.ts]"]
  node_guest_session["Guest sessions<br/>[guestSession.ts]"]
  node_journey_routes["Journey routes<br/>[journeys.ts]"]
  node_content_routes["Content routes<br/>[content.ts]"]
  node_db_schema["Database schema<br/>[schema.ts]"]
  node_db_client[("Database client<br/>[client.ts]")]
end

node_pilgrim(("Pilgrim"))
node_browser(("Browser"))
node_postgres[("PostgreSQL")]

node_pilgrim -->|"uses"| node_routing
node_routing -->|"wraps screens"| node_shell
node_routing -->|"routes to"| node_ritual_pages
node_routing -->|"routes to"| node_dua_pages
node_routing -->|"routes to"| node_guide_pages
node_routing -->|"routes to"| node_settings
node_guide_pages -->|"updates checklist"| node_journey_store
node_dua_pages -->|"renders"| node_dua_ui
node_dua_ui -->|"toggles bookmarks"| node_bookmark_store
node_content_loader -->|"validates with"| node_content_schema
node_journey_store -->|"applies transitions"| node_journey_rules
node_journey_rules -->|"uses round rules"| node_round_rules
node_ritual_pages -.->|"records actions"| node_journey_store
node_journey_store -->|"persists progress"| node_local_db
node_journey_store -->|"queues changes"| node_sync
node_bookmark_store -->|"stores bookmarks"| node_local_db
node_bookmark_store -->|"queues changes"| node_sync
node_browser -.->|"runs offline"| node_service_worker
node_sync -->|"sends API requests"| node_api
node_api -->|"mounts router"| node_content_routes
node_api -->|"installs middleware"| node_guest_session
node_api -->|"mounts router"| node_journey_routes
node_journey_routes -->|"applies transitions"| node_journey_rules
node_journey_routes -.->|"queries through"| node_db_client
node_content_routes -->|"queries through"| node_db_client
node_db_client -->|"configures ORM"| node_db_schema
node_db_client -.->|"connects"| node_postgres

click node_routing "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/App.tsx"
click node_shell "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/components/AppShell.tsx"
click node_ritual_pages "https://github.com/faisalkazi123-code/umrah/tree/claude/new-session-9u6tfh/src/pages/journey"
click node_guide_pages "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/pages/guide/Guide.tsx"
click node_dua_pages "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/pages/Duas.tsx"
click node_settings "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/pages/Settings.tsx"
click node_dua_ui "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/components/Dua.tsx"
click node_content_loader "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/content/index.ts"
click node_content_schema "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/content/schema.ts"
click node_journey_store "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/store/journeyStore.ts"
click node_bookmark_store "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/store/bookmarkStore.ts"
click node_journey_rules "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/domain/journey/journeyMachine.ts"
click node_round_rules "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/domain/rounds/roundMachine.ts"
click node_saee_rules "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/domain/saee/saeeDirection.ts"
click node_local_db "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/lib/db.ts"
click node_sync "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/lib/sync.ts"
click node_service_worker "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/pwa/sw-template.js"
click node_api "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/app.ts"
click node_guest_session "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/middleware/guestSession.ts"
click node_journey_routes "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/routes/journeys.ts"
click node_content_routes "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/routes/content.ts"
click node_db_schema "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/db/schema.ts"
click node_db_client "https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/db/client.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_routing,node_shell,node_ritual_pages,node_guide_pages,node_dua_pages,node_settings,node_dua_ui,node_browser toneBlue
class node_content_loader,node_content_schema,node_postgres toneAmber
class node_journey_store,node_bookmark_store,node_journey_rules,node_round_rules,node_saee_rules toneMint
class node_local_db,node_sync,node_service_worker toneRose
class node_api,node_guest_session,node_journey_routes,node_content_routes,node_db_schema,node_db_client,node_pilgrim toneIndigo
```

## Components

### Pilgrim app

- [App routes](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/App.tsx): `src/App.tsx`
- [App shell](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/components/AppShell.tsx): `src/components/AppShell.tsx`
- [Ritual stages](https://github.com/faisalkazi123-code/umrah/tree/claude/new-session-9u6tfh/src/pages/journey): `src/pages/journey`
- [Guide and checklist](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/pages/guide/Guide.tsx): `src/pages/guide/Guide.tsx`
- [Dua library](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/pages/Duas.tsx): `src/pages/Duas.tsx`
- [Settings](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/pages/Settings.tsx): `src/pages/Settings.tsx`
- [Dua display](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/components/Dua.tsx): `src/components/Dua.tsx`

### Guidance content

- [Content loader](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/content/index.ts): `shared/content/index.ts`
- [Content schema](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/content/schema.ts): `shared/content/schema.ts`

### Journey rules

- [Journey state](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/store/journeyStore.ts): `src/store/journeyStore.ts`
- [Bookmarks](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/store/bookmarkStore.ts): `src/store/bookmarkStore.ts`
- [Journey machine](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/domain/journey/journeyMachine.ts): `shared/domain/journey/journeyMachine.ts`
- [Round machine](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/domain/rounds/roundMachine.ts): `shared/domain/rounds/roundMachine.ts`
- [Sa'ee direction](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/shared/domain/saee/saeeDirection.ts): `shared/domain/saee/saeeDirection.ts`

### Offline and sync

- [Device database](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/lib/db.ts): `src/lib/db.ts`
- [Outbox sync](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/src/lib/sync.ts): `src/lib/sync.ts`
- [Service worker](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/pwa/sw-template.js): `pwa/sw-template.js`

### API and persistence

- [Express API](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/app.ts): `server/app.ts`
- [Guest sessions](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/middleware/guestSession.ts): `server/middleware/guestSession.ts`
- [Journey routes](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/routes/journeys.ts): `server/routes/journeys.ts`
- [Content routes](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/routes/content.ts): `server/routes/content.ts`
- [Database schema](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/db/schema.ts): `server/db/schema.ts`
- [Database client](https://github.com/faisalkazi123-code/umrah/blob/claude/new-session-9u6tfh/server/db/client.ts): `server/db/client.ts`

### Other components

- **Pilgrim**
- **Browser**
- **PostgreSQL**

## Connections

- Pilgrim → App routes: uses (evidence: `src/App.tsx`)
- App routes → App shell: wraps screens (evidence: `src/App.tsx`)
- App routes → Ritual stages: routes to (evidence: `src/App.tsx`)
- App routes → Dua library: routes to (evidence: `src/App.tsx`)
- App routes → Guide and checklist: routes to (evidence: `src/App.tsx`)
- App routes → Settings: routes to (evidence: `src/App.tsx`)
- Guide and checklist → Journey state: updates checklist (evidence: `src/pages/guide/Guide.tsx`)
- Dua library → Dua display: renders (evidence: `src/pages/Duas.tsx`)
- Dua display → Bookmarks: toggles bookmarks (evidence: `src/components/Dua.tsx`)
- Content loader → Content schema: validates with (evidence: `shared/content/index.ts`)
- Journey state → Journey machine: applies transitions (evidence: `src/store/journeyStore.ts`)
- Journey machine → Round machine: uses round rules (evidence: `shared/domain/journey/journeyMachine.ts`)
- Ritual stages → Journey state: records actions (evidence: `src/pages/journey/useRoundActions.ts`)
- Journey state → Device database: persists progress (evidence: `src/store/journeyStore.ts`)
- Journey state → Outbox sync: queues changes (evidence: `src/store/journeyStore.ts`)
- Bookmarks → Device database: stores bookmarks (evidence: `src/store/bookmarkStore.ts`)
- Bookmarks → Outbox sync: queues changes (evidence: `src/store/bookmarkStore.ts`)
- Browser → Service worker: runs offline
- Outbox sync → Express API: sends API requests (evidence: `src/lib/sync.ts`)
- Express API → Content routes: mounts router (evidence: `server/app.ts`)
- Express API → Guest sessions: installs middleware (evidence: `server/app.ts`)
- Express API → Journey routes: mounts router (evidence: `server/app.ts`)
- Journey routes → Journey machine: applies transitions (evidence: `server/routes/journeys.ts`)
- Journey routes → Database client: queries through (evidence: `server/routes/journeys.ts`)
- Content routes → Database client: queries through (evidence: `server/routes/content.ts`)
- Database client → Database schema: configures ORM (evidence: `server/db/client.ts`)
- Database client → PostgreSQL: connects
