# adarshsahu69-dev/bharat-darshan-app architecture

> Architecture diagram of the GitHub repository adarshsahu69-dev/bharat-darshan-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adarshsahu69-dev/bharat-darshan-app
- Repository: https://github.com/adarshsahu69-dev/bharat-darshan-app

## Overview

Bharat Darshan is an Android-first heritage discovery and trip-planning app. Visitors browse or search monuments, open details, and save places or add them to itineraries; signed-in users can sync saved places and trips, while profile and settings provide account and preference management. React Query mediates monument fetches and local fallback data; Zustand stores support offline trips and other persisted state. Several screens and API modules were not excerpted, so their documented responsibilities are shown, but unverified internal calls are omitted.

Main entry points: [`src/lib/supabase.ts`](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/lib/supabase.ts) (Supabase), [`src/data/useMonuments.ts`](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/useMonuments.ts) (Monument queries), [`app/(tabs)/trips.tsx`](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/trips.tsx) (Trip planner), [`src/context/AuthContext.tsx`](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/context/AuthContext.tsx) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Heritage discovery"]
  node_home["Home<br/>[index.tsx]"]
  node_explore["Explore<br/>[explore.tsx]"]
  node_saved["Saved places<br/>[saved.tsx]"]
  node_detail["Monument detail<br/>[&#91;id&#93;.tsx]"]
end

subgraph group_planning["Trip planning"]
  node_trips_screen["Trip planner<br/>[trips.tsx]"]
  node_trip_store[("Trip state<br/>[tripStore.ts]")]
  node_trip_model["Trip model<br/>[trips.ts]"]
  node_budget["Budget calculations<br/>[tripBudget.ts]"]
end

subgraph group_identity["Account and profile"]
  node_auth_screens["Sign in and sign up<br/>[login.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_profile["Profile management<br/>[profile.tsx]"]
  node_profile_api["Profile API<br/>[profileApi.ts]"]
  node_settings["App settings<br/>[settings.tsx]"]
end

subgraph group_data["Data and persistence"]
  node_monument_query["Monument queries<br/>[useMonuments.ts]"]
  node_monument_api["Monument API<br/>[monumentsApi.ts]"]
  node_monument_seed[("Monument catalog<br/>[monuments.ts]")]
  node_supabase["Supabase<br/>[supabase.ts]"]
  node_remote_db[("Supabase data")]
  node_bookmarks[("Bookmark state<br/>[bookmarkStore.ts]")]
  node_settings_store[("Settings state<br/>[settingsStore.ts]")]
  node_secure_storage["Secure auth storage<br/>[secureStorage.ts]"]
end

subgraph group_shared["Shared presentation"]
  node_theme["Theme provider<br/>[ThemeProvider.tsx]"]
  node_components["Reusable UI"]
end

node_traveler(("Traveler"))

node_traveler -->|"opens app"| node_home
node_traveler -->|"browses places"| node_explore
node_home -->|"loads monuments"| node_monument_query
node_explore -->|"searches catalog"| node_monument_query
node_saved -.->|"reads saved IDs"| node_bookmarks
node_detail -->|"loads detail"| node_monument_query
node_detail -->|"toggles bookmark"| node_bookmarks
node_monument_query -->|"fetches rows"| node_monument_api
node_monument_query -->|"fallback data"| node_monument_seed
node_monument_api -.->|"queries monuments"| node_supabase
node_supabase -->|"reads and writes"| node_remote_db
node_bookmarks -->|"syncs saved places"| node_supabase
node_traveler -->|"plans itinerary"| node_trips_screen
node_trips_screen -->|"edits itinerary"| node_trip_store
node_trip_store -->|"builds trip data"| node_trip_model
node_trip_store -->|"syncs user trips"| node_supabase
node_trips_screen -->|"calculates budget"| node_budget
node_traveler -->|"authenticates"| node_auth_screens
node_auth_screens -->|"calls auth actions"| node_auth
node_auth -->|"manages session"| node_supabase
node_auth -->|"syncs on sign-in"| node_bookmarks
node_auth -->|"syncs on sign-in"| node_trip_store
node_traveler -->|"manages profile"| node_profile
node_profile -->|"updates profile"| node_profile_api
node_profile_api -->|"accesses account data"| node_supabase
node_traveler -->|"changes preferences"| node_settings
node_settings -->|"persists preferences"| node_settings_store
node_theme -->|"reads theme choice"| node_settings_store
node_supabase -->|"persists auth session"| node_secure_storage
node_home -->|"renders shared UI"| node_components
node_detail -->|"renders detail UI"| node_components
node_trips_screen -->|"renders planner UI"| node_components

click node_home "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/index.tsx"
click node_explore "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/explore.tsx"
click node_saved "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/saved.tsx"
click node_detail "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/monument/%5Bid%5D.tsx"
click node_monument_query "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/useMonuments.ts"
click node_monument_api "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/monumentsApi.ts"
click node_monument_seed "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/monuments.ts"
click node_supabase "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/lib/supabase.ts"
click node_bookmarks "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/store/bookmarkStore.ts"
click node_trips_screen "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/trips.tsx"
click node_trip_store "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/store/tripStore.ts"
click node_trip_model "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/trips.ts"
click node_budget "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/lib/tripBudget.ts"
click node_auth_screens "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(auth)/login.tsx"
click node_auth "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/context/AuthContext.tsx"
click node_profile "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/profile.tsx"
click node_profile_api "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/profileApi.ts"
click node_settings "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/settings.tsx"
click node_settings_store "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/store/settingsStore.ts"
click node_theme "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/theme/ThemeProvider.tsx"
click node_components "https://github.com/adarshsahu69-dev/bharat-darshan-app/tree/main/src/components"
click node_secure_storage "https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/lib/secureStorage.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_home,node_explore,node_saved,node_detail toneBlue
class node_trips_screen,node_trip_store,node_trip_model,node_budget toneAmber
class node_auth_screens,node_auth,node_profile,node_profile_api,node_settings toneMint
class node_monument_query,node_monument_api,node_monument_seed,node_supabase,node_remote_db,node_bookmarks,node_settings_store,node_secure_storage toneRose
class node_theme,node_components,node_traveler toneIndigo
```

## Components

### Heritage discovery

- [Home](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/index.tsx): `app/(tabs)/index.tsx`
- [Explore](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/explore.tsx): `app/(tabs)/explore.tsx`
- [Saved places](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/saved.tsx): `app/(tabs)/saved.tsx`
- [Monument detail](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/monument/%5Bid%5D.tsx): `app/monument/[id].tsx`

### Trip planning

- [Trip planner](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(tabs)/trips.tsx): `app/(tabs)/trips.tsx`
- [Trip state](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/store/tripStore.ts): `src/store/tripStore.ts`
- [Trip model](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/trips.ts): `src/data/trips.ts`
- [Budget calculations](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/lib/tripBudget.ts): `src/lib/tripBudget.ts`

### Account and profile

- [Sign in and sign up](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/(auth)/login.tsx): `app/(auth)/login.tsx`
- [Authentication](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Profile management](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/profile.tsx): `app/profile.tsx`
- [Profile API](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/profileApi.ts): `src/data/profileApi.ts`
- [App settings](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/app/settings.tsx): `app/settings.tsx`

### Data and persistence

- [Monument queries](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/useMonuments.ts): `src/data/useMonuments.ts`
- [Monument API](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/monumentsApi.ts): `src/data/monumentsApi.ts`
- [Monument catalog](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/data/monuments.ts): `src/data/monuments.ts`
- [Supabase](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase data**
- [Bookmark state](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/store/bookmarkStore.ts): `src/store/bookmarkStore.ts`
- [Settings state](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/store/settingsStore.ts): `src/store/settingsStore.ts`
- [Secure auth storage](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/lib/secureStorage.ts): `src/lib/secureStorage.ts`

### Shared presentation

- [Theme provider](https://github.com/adarshsahu69-dev/bharat-darshan-app/blob/main/src/theme/ThemeProvider.tsx): `src/theme/ThemeProvider.tsx`
- [Reusable UI](https://github.com/adarshsahu69-dev/bharat-darshan-app/tree/main/src/components): `src/components`

### Other components

- **Traveler**

## Connections

- Traveler → Home: opens app (evidence: `README.md`)
- Traveler → Explore: browses places (evidence: `README.md`)
- Home → Monument queries: loads monuments (evidence: `app/(tabs)/index.tsx`)
- Explore → Monument queries: searches catalog (evidence: `README.md`)
- Saved places → Bookmark state: reads saved IDs
- Monument detail → Monument queries: loads detail (evidence: `app/monument/[id].tsx`)
- Monument detail → Bookmark state: toggles bookmark (evidence: `app/monument/[id].tsx`)
- Monument queries → Monument API: fetches rows (evidence: `src/data/useMonuments.ts`)
- Monument queries → Monument catalog: fallback data (evidence: `src/data/useMonuments.ts`)
- Monument API → Supabase: queries monuments
- Supabase → Supabase data: reads and writes (evidence: `README.md`)
- Bookmark state → Supabase: syncs saved places (evidence: `src/store/bookmarkStore.ts`)
- Traveler → Trip planner: plans itinerary (evidence: `README.md`)
- Trip planner → Trip state: edits itinerary (evidence: `app/(tabs)/trips.tsx`)
- Trip state → Trip model: builds trip data (evidence: `src/store/tripStore.ts`)
- Trip state → Supabase: syncs user trips (evidence: `src/store/tripStore.ts`)
- Trip planner → Budget calculations: calculates budget (evidence: `app/(tabs)/trips.tsx`)
- Traveler → Sign in and sign up: authenticates (evidence: `README.md`)
- Sign in and sign up → Authentication: calls auth actions (evidence: `app/(auth)/login.tsx`)
- Authentication → Supabase: manages session (evidence: `src/context/AuthContext.tsx`)
- Authentication → Bookmark state: syncs on sign-in (evidence: `src/context/AuthContext.tsx`)
- Authentication → Trip state: syncs on sign-in (evidence: `src/context/AuthContext.tsx`)
- Traveler → Profile management: manages profile (evidence: `README.md`)
- Profile management → Profile API: updates profile (evidence: `app/profile.tsx`)
- Profile API → Supabase: accesses account data (evidence: `src/data/profileApi.ts`)
- Traveler → App settings: changes preferences (evidence: `README.md`)
- App settings → Settings state: persists preferences (evidence: `app/settings.tsx`)
- Theme provider → Settings state: reads theme choice (evidence: `src/theme/ThemeProvider.tsx`)
- Supabase → Secure auth storage: persists auth session (evidence: `src/lib/supabase.ts`)
- Home → Reusable UI: renders shared UI (evidence: `app/(tabs)/index.tsx`)
- Monument detail → Reusable UI: renders detail UI (evidence: `app/monument/[id].tsx`)
- Trip planner → Reusable UI: renders planner UI (evidence: `app/(tabs)/trips.tsx`)
