# avnipahal624/sahyaak- architecture

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

- Interactive diagram: https://gitdiagram.com/avnipahal624/sahyaak-
- Repository: https://github.com/avnipahal624/sahyaak-

## Overview

Sahaayak is a bilingual (English/Hindi) augmentative communication app: users build phrases from scene-based word tiles, then speak them aloud; the board adapts suggestions using usage and correction history. The tree also shows learning, progress, insights, care, settings, exploration and help experiences, plus authentication. The app entry point establishes shared providers and routing. BoardProvider’s excerpt supports its ties to event logging, custom scenes and speech; its imports also identify ranking, vocabulary and preferences. Several page implementations and backend behavior were not sampled, so their internal connections are omitted.

Main entry points: [`main.tsx`](https://github.com/avnipahal624/sahyaak-/blob/main/main.tsx) (App routes), [`components/board/BoardProvider.tsx`](https://github.com/avnipahal624/sahyaak-/blob/main/components/board/BoardProvider.tsx) (Board state), [`lib/eventLog.ts`](https://github.com/avnipahal624/sahyaak-/blob/main/lib/eventLog.ts) (Usage and repairs), [`lib/progress.ts`](https://github.com/avnipahal624/sahyaak-/blob/main/lib/progress.ts) (Progress tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_entry["App routes<br/>[main.tsx]"]
  node_auth["Sign-in<br/>[Auth.tsx]"]
  node_guard["Route guard<br/>[RequireAuth.tsx]"]
  node_authhook["Auth hook<br/>[use-auth.ts]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_backend["Convex services"]
  node_ui["UI primitives"]
end

subgraph group_communication["Communication board"]
  node_board["Phrase board<br/>[Board.tsx]"]
  node_boardstate["Board state<br/>[BoardProvider.tsx]"]
  node_tiles["Scene and word tiles"]
  node_vocabulary["Bilingual vocabulary<br/>[vocabulary.ts]"]
  node_speech["Text-to-speech<br/>[tts.ts]"]
end

subgraph group_learning["Learning and support"]
  node_learning["Learning<br/>[Learn.tsx]"]
  node_care["Care support<br/>[Care.tsx]"]
  node_explore["Explore<br/>[Explore.tsx]"]
  node_help["Help<br/>[Help.tsx]"]
end

subgraph group_personalization["Personalization and insights"]
  node_events["Usage and repairs<br/>[eventLog.ts]"]
  node_ranking["Word ranking<br/>[ranking.ts]"]
  node_progress["Progress tracking<br/>[progress.ts]"]
  node_insights["Insights<br/>[Insights.tsx]"]
  node_preferences["Preferences<br/>[PrefsProvider.tsx]"]
  node_customscenes["Custom scenes<br/>[customScenes.ts]"]
end

node_visitor(("User"))

node_visitor -->|"opens app"| node_entry
node_entry -->|"routes to"| node_auth
node_entry -->|"protects routes"| node_guard
node_guard -->|"checks session"| node_authhook
node_auth -->|"uses auth"| node_authhook
node_entry -->|"provides state"| node_boardstate
node_boardstate -->|"loads and logs"| node_events
node_boardstate -->|"loads scenes"| node_customscenes
node_boardstate -->|"speaks phrase"| node_speech
node_boardstate -->|"ranks words"| node_ranking
node_boardstate -->|"uses words"| node_vocabulary
node_boardstate -->|"reads preferences"| node_preferences
node_tiles -->|"reads board state"| node_boardstate
node_events -->|"supplies usage"| node_ranking
node_progress -->|"reads activity"| node_events
node_progress -->|"uses vocabulary"| node_vocabulary
node_entry -->|"routes to"| node_dashboard
node_entry -->|"routes to"| node_learning
node_entry -->|"routes to"| node_care
node_entry -->|"routes to"| node_explore
node_entry -->|"routes to"| node_help
node_entry -->|"renders toaster"| node_ui

click node_entry "https://github.com/avnipahal624/sahyaak-/blob/main/main.tsx"
click node_auth "https://github.com/avnipahal624/sahyaak-/blob/main/Auth.tsx"
click node_guard "https://github.com/avnipahal624/sahyaak-/blob/main/components/RequireAuth.tsx"
click node_authhook "https://github.com/avnipahal624/sahyaak-/blob/main/hooks/use-auth.ts"
click node_board "https://github.com/avnipahal624/sahyaak-/blob/main/Board.tsx"
click node_boardstate "https://github.com/avnipahal624/sahyaak-/blob/main/components/board/BoardProvider.tsx"
click node_tiles "https://github.com/avnipahal624/sahyaak-/tree/main/components/board"
click node_vocabulary "https://github.com/avnipahal624/sahyaak-/blob/main/lib/vocabulary.ts"
click node_speech "https://github.com/avnipahal624/sahyaak-/blob/main/lib/tts.ts"
click node_events "https://github.com/avnipahal624/sahyaak-/blob/main/lib/eventLog.ts"
click node_ranking "https://github.com/avnipahal624/sahyaak-/blob/main/lib/ranking.ts"
click node_progress "https://github.com/avnipahal624/sahyaak-/blob/main/lib/progress.ts"
click node_insights "https://github.com/avnipahal624/sahyaak-/blob/main/Insights.tsx"
click node_preferences "https://github.com/avnipahal624/sahyaak-/blob/main/components/PrefsProvider.tsx"
click node_customscenes "https://github.com/avnipahal624/sahyaak-/blob/main/lib/customScenes.ts"
click node_learning "https://github.com/avnipahal624/sahyaak-/blob/main/Learn.tsx"
click node_care "https://github.com/avnipahal624/sahyaak-/blob/main/Care.tsx"
click node_explore "https://github.com/avnipahal624/sahyaak-/blob/main/Explore.tsx"
click node_help "https://github.com/avnipahal624/sahyaak-/blob/main/Help.tsx"
click node_dashboard "https://github.com/avnipahal624/sahyaak-/blob/main/Dashboard.tsx"
click node_backend "https://github.com/avnipahal624/sahyaak-/tree/main/convex"
click node_ui "https://github.com/avnipahal624/sahyaak-/tree/main/components/ui"

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_entry,node_auth,node_guard,node_authhook,node_dashboard,node_backend,node_ui,node_visitor toneBlue
class node_board,node_boardstate,node_tiles,node_vocabulary,node_speech toneAmber
class node_learning,node_care,node_explore,node_help toneMint
class node_events,node_ranking,node_progress,node_insights,node_preferences,node_customscenes toneRose
```

## Components

### App and access

- [App routes](https://github.com/avnipahal624/sahyaak-/blob/main/main.tsx): `main.tsx`
- [Sign-in](https://github.com/avnipahal624/sahyaak-/blob/main/Auth.tsx): `Auth.tsx`
- [Route guard](https://github.com/avnipahal624/sahyaak-/blob/main/components/RequireAuth.tsx): `components/RequireAuth.tsx`
- [Auth hook](https://github.com/avnipahal624/sahyaak-/blob/main/hooks/use-auth.ts): `hooks/use-auth.ts`
- [Dashboard](https://github.com/avnipahal624/sahyaak-/blob/main/Dashboard.tsx): `Dashboard.tsx`
- [Convex services](https://github.com/avnipahal624/sahyaak-/tree/main/convex): `convex`
- [UI primitives](https://github.com/avnipahal624/sahyaak-/tree/main/components/ui): `components/ui`

### Communication board

- [Phrase board](https://github.com/avnipahal624/sahyaak-/blob/main/Board.tsx): `Board.tsx`
- [Board state](https://github.com/avnipahal624/sahyaak-/blob/main/components/board/BoardProvider.tsx): `components/board/BoardProvider.tsx`
- [Scene and word tiles](https://github.com/avnipahal624/sahyaak-/tree/main/components/board): `components/board`
- [Bilingual vocabulary](https://github.com/avnipahal624/sahyaak-/blob/main/lib/vocabulary.ts): `lib/vocabulary.ts`
- [Text-to-speech](https://github.com/avnipahal624/sahyaak-/blob/main/lib/tts.ts): `lib/tts.ts`

### Learning and support

- [Learning](https://github.com/avnipahal624/sahyaak-/blob/main/Learn.tsx): `Learn.tsx`
- [Care support](https://github.com/avnipahal624/sahyaak-/blob/main/Care.tsx): `Care.tsx`
- [Explore](https://github.com/avnipahal624/sahyaak-/blob/main/Explore.tsx): `Explore.tsx`
- [Help](https://github.com/avnipahal624/sahyaak-/blob/main/Help.tsx): `Help.tsx`

### Personalization and insights

- [Usage and repairs](https://github.com/avnipahal624/sahyaak-/blob/main/lib/eventLog.ts): `lib/eventLog.ts`
- [Word ranking](https://github.com/avnipahal624/sahyaak-/blob/main/lib/ranking.ts): `lib/ranking.ts`
- [Progress tracking](https://github.com/avnipahal624/sahyaak-/blob/main/lib/progress.ts): `lib/progress.ts`
- [Insights](https://github.com/avnipahal624/sahyaak-/blob/main/Insights.tsx): `Insights.tsx`
- [Preferences](https://github.com/avnipahal624/sahyaak-/blob/main/components/PrefsProvider.tsx): `components/PrefsProvider.tsx`
- [Custom scenes](https://github.com/avnipahal624/sahyaak-/blob/main/lib/customScenes.ts): `lib/customScenes.ts`

### Other components

- **User**

## Connections

- User → App routes: opens app (evidence: `main.tsx`)
- App routes → Sign-in: routes to (evidence: `main.tsx`)
- App routes → Route guard: protects routes (evidence: `main.tsx`)
- Route guard → Auth hook: checks session (evidence: `components/RequireAuth.tsx`)
- Sign-in → Auth hook: uses auth (evidence: `Auth.tsx`)
- App routes → Board state: provides state (evidence: `main.tsx`)
- Board state → Usage and repairs: loads and logs (evidence: `components/board/BoardProvider.tsx`)
- Board state → Custom scenes: loads scenes (evidence: `components/board/BoardProvider.tsx`)
- Board state → Text-to-speech: speaks phrase (evidence: `components/board/BoardProvider.tsx`)
- Board state → Word ranking: ranks words (evidence: `components/board/BoardProvider.tsx`)
- Board state → Bilingual vocabulary: uses words (evidence: `components/board/BoardProvider.tsx`)
- Board state → Preferences: reads preferences (evidence: `components/board/BoardProvider.tsx`)
- Scene and word tiles → Board state: reads board state (evidence: `components/board/SceneTabs.tsx`)
- Usage and repairs → Word ranking: supplies usage (evidence: `lib/eventLog.ts`)
- Progress tracking → Usage and repairs: reads activity (evidence: `lib/progress.ts`)
- Progress tracking → Bilingual vocabulary: uses vocabulary (evidence: `lib/progress.ts`)
- App routes → Dashboard: routes to (evidence: `main.tsx`)
- App routes → Learning: routes to (evidence: `main.tsx`)
- App routes → Care support: routes to (evidence: `main.tsx`)
- App routes → Explore: routes to (evidence: `main.tsx`)
- App routes → Help: routes to (evidence: `main.tsx`)
- App routes → UI primitives: renders toaster (evidence: `main.tsx`)
