# tanmaygupta-18/sthala architecture

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

- Interactive diagram: https://gitdiagram.com/tanmaygupta-18/sthala
- Repository: https://github.com/tanmaygupta-18/sthala

## Overview

Sthala is a temple-heritage discovery app that adapts sourced readings to a visitor’s interests. Visitors browse the archive, open a temple reading, and can explore its plan, hear speech, save temples, or personalize recommendations; signed-in users can also manage a profile and social connections. The graph shows evidenced route-to-service and component-to-helper links. Several major capabilities are represented by their source paths, but their internal connections are omitted where the excerpts do not establish them.

Main entry points: [`src/routes/temples/$slug/index.tsx`](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/temples/%24slug/index.tsx) (Temple reading), [`src/lib/heritage/fns.ts`](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/fns.ts) (Heritage services), [`src/routes/index.tsx`](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/index.tsx) (Landing page), [`src/routes/temples/$slug/explore.tsx`](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/temples/%24slug/explore.tsx) (Temple exploration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Archive and discovery"]
  node_landing["Landing page<br/>[index.tsx]"]
  node_discovery_pages["Discovery pages"]
  node_app_frame["App frame<br/>[frame.tsx]"]
end

subgraph group_heritage["Heritage experience"]
  node_temple_reading["Temple reading<br/>[index.tsx]"]
  node_explore["Temple exploration<br/>[explore.tsx]"]
  node_heritage_api["Heritage services<br/>[fns.ts]"]
  node_archive_store[("Heritage archive<br/>[store.server.ts]")]
  node_recommendation_engine["Reading and ranking<br/>[engine.ts]"]
  node_temple_facts["Temple facts<br/>[temple-facts.ts]"]
  node_facts_loader["Facts loader"]
  node_temple_visuals["Plan and models<br/>[massing.tsx]"]
  node_speech_player["Speech player"]
  node_speech_client["Speech client<br/>[speech-client.ts]"]
end

subgraph group_identity["Identity and profile"]
  node_auth_gates["Sign-in gates<br/>[gates.tsx]"]
  node_current_user["Current user"]
  node_auth_client["Auth client<br/>[client.ts]"]
  node_auth_server["Auth server<br/>[server.ts]"]
  node_auth_endpoint["Auth endpoint<br/>[$.ts]"]
  node_profile["Profile and preferences<br/>[profile.tsx]"]
end

subgraph group_platform["Social integrations"]
  node_social_services["Social connections<br/>[social.server.ts]"]
  node_social_callbacks["Social callbacks"]
  node_app_database[("Application database<br/>[db.ts]")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_landing
node_landing -->|"loads archive"| node_heritage_api
node_heritage_api -->|"reads temples"| node_archive_store
node_visitor -.->|"browses"| node_discovery_pages
node_visitor -->|"opens temple"| node_temple_reading
node_temple_reading -->|"requests reading"| node_heritage_api
node_temple_reading -->|"renders facts"| node_facts_loader
node_facts_loader -->|"loads facts"| node_temple_facts
node_visitor -.->|"explores plan"| node_explore
node_explore -->|"renders plan"| node_temple_visuals
node_temple_reading -->|"offers speech"| node_speech_player
node_speech_player -->|"requests audio"| node_speech_client
node_app_frame -->|"renders gates"| node_auth_gates
node_auth_gates -->|"reads user"| node_current_user
node_current_user -->|"reads session"| node_auth_client
node_visitor -.->|"manages profile"| node_profile
node_profile -->|"updates preferences"| node_heritage_api
node_auth_endpoint -->|"dispatches auth"| node_auth_server
node_social_callbacks -->|"handles callbacks"| node_social_services
node_social_services -->|"queries connections"| node_app_database

click node_landing "https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/index.tsx"
click node_discovery_pages "https://github.com/tanmaygupta-18/sthala/tree/main/src/routes"
click node_temple_reading "https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/temples/%24slug/index.tsx"
click node_explore "https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/temples/%24slug/explore.tsx"
click node_heritage_api "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/fns.ts"
click node_archive_store "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/store.server.ts"
click node_recommendation_engine "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/engine.ts"
click node_temple_facts "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/temple-facts.ts"
click node_facts_loader "https://github.com/tanmaygupta-18/sthala/blob/main/src/components/temple-facts-loader.tsx"
click node_temple_visuals "https://github.com/tanmaygupta-18/sthala/blob/main/src/components/massing.tsx"
click node_speech_player "https://github.com/tanmaygupta-18/sthala/blob/main/src/components/temple-speech-player.tsx"
click node_speech_client "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/speech-client.ts"
click node_app_frame "https://github.com/tanmaygupta-18/sthala/blob/main/src/components/frame.tsx"
click node_auth_gates "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/gates.tsx"
click node_current_user "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/use-current-user.ts"
click node_auth_client "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/client.ts"
click node_auth_server "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/server.ts"
click node_auth_endpoint "https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/api/auth/%24.ts"
click node_profile "https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/profile.tsx"
click node_social_services "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/social.server.ts"
click node_social_callbacks "https://github.com/tanmaygupta-18/sthala/tree/main/src/routes/api/social"
click node_app_database "https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/db.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_landing,node_discovery_pages,node_app_frame toneBlue
class node_temple_reading,node_explore,node_heritage_api,node_archive_store,node_recommendation_engine,node_temple_facts,node_facts_loader,node_temple_visuals,node_speech_player,node_speech_client toneAmber
class node_auth_gates,node_current_user,node_auth_client,node_auth_server,node_auth_endpoint,node_profile toneMint
class node_social_services,node_social_callbacks,node_app_database toneRose
class node_visitor toneIndigo
```

## Components

### Archive and discovery

- [Landing page](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Discovery pages](https://github.com/tanmaygupta-18/sthala/tree/main/src/routes): `src/routes`
- [App frame](https://github.com/tanmaygupta-18/sthala/blob/main/src/components/frame.tsx): `src/components/frame.tsx`

### Heritage experience

- [Temple reading](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/temples/%24slug/index.tsx): `src/routes/temples/$slug/index.tsx`
- [Temple exploration](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/temples/%24slug/explore.tsx): `src/routes/temples/$slug/explore.tsx`
- [Heritage services](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/fns.ts): `src/lib/heritage/fns.ts`
- [Heritage archive](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/store.server.ts): `src/lib/heritage/store.server.ts`
- [Reading and ranking](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/engine.ts): `src/lib/heritage/engine.ts`
- [Temple facts](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/temple-facts.ts): `src/lib/heritage/temple-facts.ts`
- [Facts loader](https://github.com/tanmaygupta-18/sthala/blob/main/src/components/temple-facts-loader.tsx): `src/components/temple-facts-loader.tsx`
- [Plan and models](https://github.com/tanmaygupta-18/sthala/blob/main/src/components/massing.tsx): `src/components/massing.tsx`
- [Speech player](https://github.com/tanmaygupta-18/sthala/blob/main/src/components/temple-speech-player.tsx): `src/components/temple-speech-player.tsx`
- [Speech client](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/speech-client.ts): `src/lib/heritage/speech-client.ts`

### Identity and profile

- [Sign-in gates](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/gates.tsx): `src/lib/auth/gates.tsx`
- [Current user](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/use-current-user.ts): `src/lib/auth/use-current-user.ts`
- [Auth client](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/client.ts): `src/lib/auth/client.ts`
- [Auth server](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/auth/server.ts): `src/lib/auth/server.ts`
- [Auth endpoint](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/api/auth/%24.ts): `src/routes/api/auth/$.ts`
- [Profile and preferences](https://github.com/tanmaygupta-18/sthala/blob/main/src/routes/profile.tsx): `src/routes/profile.tsx`

### Social integrations

- [Social connections](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/heritage/social.server.ts): `src/lib/heritage/social.server.ts`
- [Social callbacks](https://github.com/tanmaygupta-18/sthala/tree/main/src/routes/api/social): `src/routes/api/social`
- [Application database](https://github.com/tanmaygupta-18/sthala/blob/main/src/lib/db.ts): `src/lib/db.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Landing page: opens (evidence: `src/routes/index.tsx`)
- Landing page → Heritage services: loads archive (evidence: `src/routes/index.tsx`)
- Heritage services → Heritage archive: reads temples (evidence: `src/lib/heritage/fns.ts`)
- Visitor → Discovery pages: browses
- Visitor → Temple reading: opens temple (evidence: `src/routes/temples/$slug/index.tsx`)
- Temple reading → Heritage services: requests reading (evidence: `src/routes/temples/$slug/index.tsx`)
- Temple reading → Facts loader: renders facts (evidence: `src/routes/temples/$slug/index.tsx`)
- Facts loader → Temple facts: loads facts (evidence: `src/components/temple-facts-loader.tsx`)
- Visitor → Temple exploration: explores plan
- Temple exploration → Plan and models: renders plan (evidence: `src/routes/temples/$slug/explore.tsx`)
- Temple reading → Speech player: offers speech (evidence: `src/routes/temples/$slug/index.tsx`)
- Speech player → Speech client: requests audio (evidence: `src/components/temple-speech-player.tsx`)
- App frame → Sign-in gates: renders gates (evidence: `src/components/frame.tsx`)
- Sign-in gates → Current user: reads user (evidence: `src/lib/auth/gates.tsx`)
- Current user → Auth client: reads session (evidence: `src/lib/auth/use-current-user.ts`)
- Visitor → Profile and preferences: manages profile
- Profile and preferences → Heritage services: updates preferences (evidence: `src/routes/profile.tsx`)
- Auth endpoint → Auth server: dispatches auth (evidence: `src/routes/api/auth/$.ts`)
- Social callbacks → Social connections: handles callbacks (evidence: `src/routes/api/social/instagram/callback.ts`)
- Social connections → Application database: queries connections (evidence: `src/lib/heritage/social.server.ts`)
