# saeed375-gif/sira architecture

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

- Interactive diagram: https://gitdiagram.com/saeed375-gif/sira
- Repository: https://github.com/saeed375-gif/sira

## Overview

Sira is a Jerusalem discovery and storytelling web app: visitors explore place-based history and daily-life stories through maps, routes, search, audio, timelines, and challenges, then can save favorites and game progress. The React app routes those experiences; its local place and life-story data are supplemented by a compatibility mapper for Supabase-managed place fields. An Express API handles public, account, and admin requests, with Supabase as the backend. The README documents the frontend-to-API-to-database architecture and major data capabilities; unsampled implementation details and some client/API wiring are represented only where explicitly documented.

Main entry points: [`src/App.tsx`](https://github.com/saeed375-gif/sira/blob/main/src/App.tsx) (App routing), [`src/views/PlaceDetailView.tsx`](https://github.com/saeed375-gif/sira/blob/main/src/views/PlaceDetailView.tsx) (Place details), [`src/components/LifeExperience.tsx`](https://github.com/saeed375-gif/sira/blob/main/src/components/LifeExperience.tsx) (Life moments), [`server/authApi.ts`](https://github.com/saeed375-gif/sira/blob/main/server/authApi.ts) (Auth API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_home["Home<br/>[HomeView.tsx]"]
  node_explore["Explore<br/>[ExploreView.tsx]"]
  node_place["Place details"]
  node_routes["Routes<br/>[RoutesView.tsx]"]
  node_route_detail["Route details"]
  node_search["Search<br/>[SearchView.tsx]"]
  node_about["About<br/>[AboutView.tsx]"]
  node_life_moments["Life moments<br/>[LifeExperience.tsx]"]
  node_games_auth["Games account<br/>[GamesAuthView.tsx]"]
end

subgraph group_content["Jerusalem content"]
  node_places_data["Place data<br/>[jerusalemData.ts]"]
  node_life_data["Life stories<br/>[lifeData.ts]"]
  node_sira_mapper["Data compatibility<br/>[siraData.ts]"]
end

subgraph group_discovery["Discovery experiences"]
  node_map["Interactive map<br/>[JerusalemMap.tsx]"]
  node_audio["Audio player"]
  node_timeline["Timeline"]
  node_challenge["Place challenge<br/>[PlaceChallenge.tsx]"]
  node_sources["Source citations<br/>[SourcesModal.tsx]"]
  node_games["Games<br/>[GamesView.tsx]"]
  node_kids_game["Kids map game<br/>[KidsMapGame.tsx]"]
  node_game_rewards["Game rewards<br/>[gameRewards.ts]"]
end

subgraph group_services["API and services"]
  node_client_auth["Account service<br/>[auth.ts]"]
  node_api["Express API<br/>[app.ts]"]
  node_public_api["Public API<br/>[publicApi.ts]"]
  node_auth_api["Auth API<br/>[authApi.ts]"]
  node_admin_api["Admin API<br/>[adminApi.ts]"]
  node_server_auth["Server auth<br/>[auth.ts]"]
  node_rate_limit["Rate limiting<br/>[rateLimit.ts]"]
  node_supabase_rest["Supabase REST<br/>[supabaseRest.ts]"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase database")]
node_maps_provider["Google Maps"]

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_explore
node_app -->|"routes to"| node_place
node_app -->|"routes to"| node_routes
node_app -->|"routes to"| node_route_detail
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_life_moments
node_app -->|"routes to"| node_games
node_app -->|"routes to"| node_games_auth
node_app -->|"uses"| node_places_data
node_app -->|"uses"| node_life_data
node_home -->|"renders"| node_map
node_explore -->|"renders"| node_map
node_explore -->|"filters"| node_places_data
node_place -->|"renders"| node_life_moments
node_place -->|"renders"| node_audio
node_place -->|"renders"| node_timeline
node_place -->|"renders"| node_challenge
node_place -->|"renders"| node_sources
node_route_detail -->|"renders"| node_map
node_route_detail -->|"renders"| node_life_moments
node_route_detail -->|"renders"| node_challenge
node_life_moments -->|"renders"| node_audio
node_life_moments -->|"renders"| node_sources
node_life_moments -->|"links places"| node_life_data
node_places_data -->|"provides place links"| node_life_data
node_games -->|"renders"| node_kids_game
node_games -->|"uses"| node_game_rewards
node_games -->|"uses"| node_client_auth
node_games_auth -->|"uses"| node_client_auth
node_client_auth -->|"requests"| node_auth_api
node_map -->|"loads maps"| node_maps_provider
node_api -->|"mounts"| node_public_api
node_api -->|"mounts"| node_auth_api
node_api -->|"mounts"| node_admin_api
node_public_api -->|"requests data"| node_supabase_rest
node_auth_api -->|"uses"| node_server_auth
node_auth_api -->|"checks limits"| node_rate_limit
node_auth_api -->|"requests data"| node_supabase_rest
node_admin_api -->|"uses"| node_server_auth
node_admin_api -->|"checks limits"| node_rate_limit
node_admin_api -->|"requests data"| node_supabase_rest
node_server_auth -->|"validates with"| node_supabase_rest
node_supabase_rest -->|"REST requests"| node_supabase
node_sira_mapper -.->|"overlays fields"| node_supabase

click node_app "https://github.com/saeed375-gif/sira/blob/main/src/App.tsx"
click node_home "https://github.com/saeed375-gif/sira/blob/main/src/views/HomeView.tsx"
click node_explore "https://github.com/saeed375-gif/sira/blob/main/src/views/ExploreView.tsx"
click node_place "https://github.com/saeed375-gif/sira/blob/main/src/views/PlaceDetailView.tsx"
click node_routes "https://github.com/saeed375-gif/sira/blob/main/src/views/RoutesView.tsx"
click node_route_detail "https://github.com/saeed375-gif/sira/blob/main/src/views/RouteDetailView.tsx"
click node_search "https://github.com/saeed375-gif/sira/blob/main/src/views/SearchView.tsx"
click node_about "https://github.com/saeed375-gif/sira/blob/main/src/views/AboutView.tsx"
click node_life_moments "https://github.com/saeed375-gif/sira/blob/main/src/components/LifeExperience.tsx"
click node_places_data "https://github.com/saeed375-gif/sira/blob/main/src/data/jerusalemData.ts"
click node_life_data "https://github.com/saeed375-gif/sira/blob/main/src/data/lifeData.ts"
click node_sira_mapper "https://github.com/saeed375-gif/sira/blob/main/src/services/siraData.ts"
click node_map "https://github.com/saeed375-gif/sira/blob/main/src/components/JerusalemMap.tsx"
click node_audio "https://github.com/saeed375-gif/sira/blob/main/src/components/AudioStoryPlayer.tsx"
click node_timeline "https://github.com/saeed375-gif/sira/blob/main/src/components/InteractiveTimeline.tsx"
click node_challenge "https://github.com/saeed375-gif/sira/blob/main/src/components/PlaceChallenge.tsx"
click node_sources "https://github.com/saeed375-gif/sira/blob/main/src/components/SourcesModal.tsx"
click node_games "https://github.com/saeed375-gif/sira/blob/main/src/views/GamesView.tsx"
click node_kids_game "https://github.com/saeed375-gif/sira/blob/main/src/components/KidsMapGame.tsx"
click node_game_rewards "https://github.com/saeed375-gif/sira/blob/main/src/lib/gameRewards.ts"
click node_games_auth "https://github.com/saeed375-gif/sira/blob/main/src/views/GamesAuthView.tsx"
click node_client_auth "https://github.com/saeed375-gif/sira/blob/main/src/services/auth.ts"
click node_api "https://github.com/saeed375-gif/sira/blob/main/server/app.ts"
click node_public_api "https://github.com/saeed375-gif/sira/blob/main/server/publicApi.ts"
click node_auth_api "https://github.com/saeed375-gif/sira/blob/main/server/authApi.ts"
click node_admin_api "https://github.com/saeed375-gif/sira/blob/main/server/adminApi.ts"
click node_server_auth "https://github.com/saeed375-gif/sira/blob/main/server/auth.ts"
click node_rate_limit "https://github.com/saeed375-gif/sira/blob/main/server/rateLimit.ts"
click node_supabase_rest "https://github.com/saeed375-gif/sira/blob/main/server/supabaseRest.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_home,node_explore,node_place,node_routes,node_route_detail,node_search,node_about,node_life_moments,node_games_auth toneBlue
class node_places_data,node_life_data,node_sira_mapper,node_supabase toneAmber
class node_map,node_audio,node_timeline,node_challenge,node_sources,node_games,node_kids_game,node_game_rewards toneMint
class node_client_auth,node_api,node_public_api,node_auth_api,node_admin_api,node_server_auth,node_rate_limit,node_supabase_rest toneRose
class node_visitor,node_maps_provider toneIndigo
```

## Components

### Web experience

- [App routing](https://github.com/saeed375-gif/sira/blob/main/src/App.tsx): `src/App.tsx`
- [Home](https://github.com/saeed375-gif/sira/blob/main/src/views/HomeView.tsx): `src/views/HomeView.tsx`
- [Explore](https://github.com/saeed375-gif/sira/blob/main/src/views/ExploreView.tsx): `src/views/ExploreView.tsx`
- [Place details](https://github.com/saeed375-gif/sira/blob/main/src/views/PlaceDetailView.tsx): `src/views/PlaceDetailView.tsx`
- [Routes](https://github.com/saeed375-gif/sira/blob/main/src/views/RoutesView.tsx): `src/views/RoutesView.tsx`
- [Route details](https://github.com/saeed375-gif/sira/blob/main/src/views/RouteDetailView.tsx): `src/views/RouteDetailView.tsx`
- [Search](https://github.com/saeed375-gif/sira/blob/main/src/views/SearchView.tsx): `src/views/SearchView.tsx`
- [About](https://github.com/saeed375-gif/sira/blob/main/src/views/AboutView.tsx): `src/views/AboutView.tsx`
- [Life moments](https://github.com/saeed375-gif/sira/blob/main/src/components/LifeExperience.tsx): `src/components/LifeExperience.tsx`
- [Games account](https://github.com/saeed375-gif/sira/blob/main/src/views/GamesAuthView.tsx): `src/views/GamesAuthView.tsx`

### Jerusalem content

- [Place data](https://github.com/saeed375-gif/sira/blob/main/src/data/jerusalemData.ts): `src/data/jerusalemData.ts`
- [Life stories](https://github.com/saeed375-gif/sira/blob/main/src/data/lifeData.ts): `src/data/lifeData.ts`
- [Data compatibility](https://github.com/saeed375-gif/sira/blob/main/src/services/siraData.ts): `src/services/siraData.ts`

### Discovery experiences

- [Interactive map](https://github.com/saeed375-gif/sira/blob/main/src/components/JerusalemMap.tsx): `src/components/JerusalemMap.tsx`
- [Audio player](https://github.com/saeed375-gif/sira/blob/main/src/components/AudioStoryPlayer.tsx): `src/components/AudioStoryPlayer.tsx`
- [Timeline](https://github.com/saeed375-gif/sira/blob/main/src/components/InteractiveTimeline.tsx): `src/components/InteractiveTimeline.tsx`
- [Place challenge](https://github.com/saeed375-gif/sira/blob/main/src/components/PlaceChallenge.tsx): `src/components/PlaceChallenge.tsx`
- [Source citations](https://github.com/saeed375-gif/sira/blob/main/src/components/SourcesModal.tsx): `src/components/SourcesModal.tsx`
- [Games](https://github.com/saeed375-gif/sira/blob/main/src/views/GamesView.tsx): `src/views/GamesView.tsx`
- [Kids map game](https://github.com/saeed375-gif/sira/blob/main/src/components/KidsMapGame.tsx): `src/components/KidsMapGame.tsx`
- [Game rewards](https://github.com/saeed375-gif/sira/blob/main/src/lib/gameRewards.ts): `src/lib/gameRewards.ts`

### API and services

- [Account service](https://github.com/saeed375-gif/sira/blob/main/src/services/auth.ts): `src/services/auth.ts`
- [Express API](https://github.com/saeed375-gif/sira/blob/main/server/app.ts): `server/app.ts`
- [Public API](https://github.com/saeed375-gif/sira/blob/main/server/publicApi.ts): `server/publicApi.ts`
- [Auth API](https://github.com/saeed375-gif/sira/blob/main/server/authApi.ts): `server/authApi.ts`
- [Admin API](https://github.com/saeed375-gif/sira/blob/main/server/adminApi.ts): `server/adminApi.ts`
- [Server auth](https://github.com/saeed375-gif/sira/blob/main/server/auth.ts): `server/auth.ts`
- [Rate limiting](https://github.com/saeed375-gif/sira/blob/main/server/rateLimit.ts): `server/rateLimit.ts`
- [Supabase REST](https://github.com/saeed375-gif/sira/blob/main/server/supabaseRest.ts): `server/supabaseRest.ts`

### Other components

- **Visitor**
- **Supabase database**
- **Google Maps**

## Connections

- Visitor → App routing: opens (evidence: `src/App.tsx`)
- App routing → Home: routes to (evidence: `src/App.tsx`)
- App routing → Explore: routes to (evidence: `src/App.tsx`)
- App routing → Place details: routes to (evidence: `src/App.tsx`)
- App routing → Routes: routes to (evidence: `src/App.tsx`)
- App routing → Route details: routes to (evidence: `src/App.tsx`)
- App routing → Search: routes to (evidence: `src/App.tsx`)
- App routing → About: routes to (evidence: `src/App.tsx`)
- App routing → Life moments: routes to (evidence: `src/App.tsx`)
- App routing → Games: routes to (evidence: `src/App.tsx`)
- App routing → Games account: routes to (evidence: `src/App.tsx`)
- App routing → Place data: uses (evidence: `src/App.tsx`)
- App routing → Life stories: uses (evidence: `src/App.tsx`)
- Home → Interactive map: renders (evidence: `src/views/HomeView.tsx`)
- Explore → Interactive map: renders (evidence: `src/views/ExploreView.tsx`)
- Explore → Place data: filters (evidence: `src/views/ExploreView.tsx`)
- Place details → Life moments: renders (evidence: `src/views/PlaceDetailView.tsx`)
- Place details → Audio player: renders (evidence: `src/views/PlaceDetailView.tsx`)
- Place details → Timeline: renders (evidence: `src/views/PlaceDetailView.tsx`)
- Place details → Place challenge: renders (evidence: `src/views/PlaceDetailView.tsx`)
- Place details → Source citations: renders (evidence: `src/views/PlaceDetailView.tsx`)
- Route details → Interactive map: renders (evidence: `src/views/RouteDetailView.tsx`)
- Route details → Life moments: renders (evidence: `src/views/RouteDetailView.tsx`)
- Route details → Place challenge: renders (evidence: `src/views/RouteDetailView.tsx`)
- Life moments → Audio player: renders (evidence: `src/components/LifeExperience.tsx`)
- Life moments → Source citations: renders (evidence: `src/components/LifeExperience.tsx`)
- Life moments → Life stories: links places (evidence: `src/components/LifeExperience.tsx`)
- Place data → Life stories: provides place links (evidence: `src/data/lifeData.ts`)
- Games → Kids map game: renders (evidence: `src/views/GamesView.tsx`)
- Games → Game rewards: uses (evidence: `src/views/GamesView.tsx`)
- Games → Account service: uses (evidence: `src/views/GamesView.tsx`)
- Games account → Account service: uses (evidence: `src/views/GamesAuthView.tsx`)
- Account service → Auth API: requests (evidence: `src/services/auth.ts`)
- Interactive map → Google Maps: loads maps (evidence: `src/components/JerusalemMap.tsx`)
- Express API → Public API: mounts (evidence: `server/app.ts`)
- Express API → Auth API: mounts (evidence: `server/app.ts`)
- Express API → Admin API: mounts (evidence: `server/app.ts`)
- Public API → Supabase REST: requests data (evidence: `server/publicApi.ts`)
- Auth API → Server auth: uses (evidence: `server/authApi.ts`)
- Auth API → Rate limiting: checks limits (evidence: `server/authApi.ts`)
- Auth API → Supabase REST: requests data (evidence: `server/authApi.ts`)
- Admin API → Server auth: uses (evidence: `server/adminApi.ts`)
- Admin API → Rate limiting: checks limits (evidence: `server/adminApi.ts`)
- Admin API → Supabase REST: requests data (evidence: `server/adminApi.ts`)
- Server auth → Supabase REST: validates with (evidence: `server/auth.ts`)
- Supabase REST → Supabase database: REST requests (evidence: `README.md`)
- Data compatibility → Supabase database: overlays fields (evidence: `README.md`)
