# sushanyn/lingora architecture

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

- Interactive diagram: https://gitdiagram.com/sushanyn/lingora
- Repository: https://github.com/sushanyn/lingora

## Overview

Lingora is a language-learning app whose main workflow is: authenticate, create or clone a dictionary, add vocabulary, then practice and track progress. The graph also preserves the documented translation, public-library, learning-game, analytics, and Stripe capabilities. The excerpts show key data access and routing; some unsampled integrations are represented only where the README documents them, and uncertain connections are omitted.

Main entry points: [`src/App.tsx`](https://github.com/sushanyn/lingora/blob/main/src/App.tsx) (Routes & guards), [`src/lib/supabase.ts`](https://github.com/sushanyn/lingora/blob/main/src/lib/supabase.ts) (Supabase client), [`src/pages/DictionaryView.tsx`](https://github.com/sushanyn/lingora/blob/main/src/pages/DictionaryView.tsx) (Dictionary contents), [`src/pages/Auth.tsx`](https://github.com/sushanyn/lingora/blob/main/src/pages/Auth.tsx) (Sign-in page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_routes["Routes &amp; guards<br/>[App.tsx]"]
  node_shell["App shell<br/>[AppLayout.tsx]"]
  node_supabaseclient["Supabase client<br/>[supabase.ts]"]
  node_home["Learning dashboard<br/>[Home.tsx]"]
end

subgraph group_vocabulary["Vocabulary"]
  node_dictpage["Dictionary manager<br/>[Dictionaries.tsx]"]
  node_dicthook["Dictionary operations<br/>[useDictionaries.ts]"]
  node_dictmodal["Dictionary editor"]
  node_dictview["Dictionary contents<br/>[DictionaryView.tsx]"]
  node_wordhook["Word operations<br/>[useWords.ts]"]
  node_wordmodal["Word editor<br/>[WordModal.tsx]"]
  node_importmodal["Vocabulary import<br/>[ImportModal.tsx]"]
  node_parser["Import parser<br/>[importParser.ts]"]
  node_suggest["Word suggestions"]
  node_translate["Translation endpoint<br/>[translate.ts]"]
  node_librarypage["Public library<br/>[Library.tsx]"]
  node_libraryhook["Dictionary cloning<br/>[useLibrary.ts]"]
end

subgraph group_learning["Learning"]
  node_practicehub["Practice hub<br/>[Practice.tsx]"]
  node_flashcards["Flashcard practice"]
  node_flashcard["Flashcard view<br/>[Flashcard.tsx]"]
  node_quiz["Quiz mode<br/>[QuizMode.tsx]"]
  node_match["Word match<br/>[WordMatch.tsx]"]
  node_listening["Listening challenge"]
  node_immersion["Immersion practice"]
  node_music["Music challenge<br/>[MusicChallenge.tsx]"]
  node_musicapi["Music endpoint<br/>[music.ts]"]
  node_spacedrep["Review scheduling<br/>[sm2.ts]"]
end

subgraph group_account["Account &amp; Insights"]
  node_authpage["Sign-in page<br/>[Auth.tsx]"]
  node_login["Login form<br/>[LoginForm.tsx]"]
  node_authhook["Auth session<br/>[useAuth.ts]"]
  node_profilehook["Profile &amp; streaks<br/>[useProfile.ts]"]
end

subgraph group_payments["Payments"]
end

node_learner(("Learner"))
node_database[("Supabase data store")]
node_translationservice{{"MyMemory API"}}
node_clips{{"Video clip service"}}

node_learner -->|"opens"| node_routes
node_routes -->|"routes to"| node_authpage
node_routes -->|"guards routes"| node_shell
node_routes -->|"routes to"| node_dictpage
node_routes -->|"routes to"| node_dictview
node_routes -->|"routes to"| node_practicehub
node_routes -->|"routes to"| node_flashcards
node_routes -->|"routes to"| node_quiz
node_routes -->|"routes to"| node_match
node_routes -->|"routes to"| node_listening
node_routes -->|"routes to"| node_immersion
node_routes -->|"routes to"| node_music
node_routes -->|"routes to"| node_home
node_authpage -->|"renders"| node_login
node_authpage -->|"checks session"| node_authhook
node_login -->|"authenticates with"| node_supabaseclient
node_authhook -->|"reads session"| node_supabaseclient
node_supabaseclient -->|"connects to"| node_database
node_dictpage -->|"manages dictionaries"| node_dicthook
node_dictpage -->|"opens editor"| node_dictmodal
node_dicthook -->|"gets user"| node_authhook
node_dicthook -->|"reads and writes"| node_supabaseclient
node_dictview -->|"loads words"| node_wordhook
node_dictview -->|"opens editor"| node_wordmodal
node_dictview -->|"opens importer"| node_importmodal
node_dictview -->|"opens suggestions"| node_suggest
node_wordhook -->|"gets user"| node_authhook
node_wordhook -->|"reads and writes"| node_supabaseclient
node_importmodal -->|"parses input"| node_parser
node_wordmodal -.->|"requests translation"| node_translate
node_translate -.->|"translates with"| node_translationservice
node_librarypage -->|"loads public lists"| node_libraryhook
node_libraryhook -->|"clones dictionary"| node_supabaseclient
node_flashcards -.->|"renders cards"| node_flashcard
node_flashcards -.->|"schedules reviews"| node_spacedrep
node_immersion -->|"searches clips"| node_clips
node_music -.->|"loads music data"| node_musicapi
node_home -->|"reads profile"| node_profilehook
node_profilehook -->|"reads and updates"| node_supabaseclient
node_learner -->|"browses"| node_librarypage
node_learner -->|"signs in"| node_authpage

click node_routes "https://github.com/sushanyn/lingora/blob/main/src/App.tsx"
click node_shell "https://github.com/sushanyn/lingora/blob/main/src/layouts/AppLayout.tsx"
click node_authpage "https://github.com/sushanyn/lingora/blob/main/src/pages/Auth.tsx"
click node_login "https://github.com/sushanyn/lingora/blob/main/src/components/LoginForm.tsx"
click node_authhook "https://github.com/sushanyn/lingora/blob/main/src/hooks/useAuth.ts"
click node_supabaseclient "https://github.com/sushanyn/lingora/blob/main/src/lib/supabase.ts"
click node_dictpage "https://github.com/sushanyn/lingora/blob/main/src/pages/Dictionaries.tsx"
click node_dicthook "https://github.com/sushanyn/lingora/blob/main/src/hooks/useDictionaries.ts"
click node_dictmodal "https://github.com/sushanyn/lingora/blob/main/src/components/DictionaryModal.tsx"
click node_dictview "https://github.com/sushanyn/lingora/blob/main/src/pages/DictionaryView.tsx"
click node_wordhook "https://github.com/sushanyn/lingora/blob/main/src/hooks/useWords.ts"
click node_wordmodal "https://github.com/sushanyn/lingora/blob/main/src/components/WordModal.tsx"
click node_importmodal "https://github.com/sushanyn/lingora/blob/main/src/components/ImportModal.tsx"
click node_parser "https://github.com/sushanyn/lingora/blob/main/src/utils/importParser.ts"
click node_suggest "https://github.com/sushanyn/lingora/blob/main/src/components/PandaSuggestModal.tsx"
click node_translate "https://github.com/sushanyn/lingora/blob/main/api/translate.ts"
click node_librarypage "https://github.com/sushanyn/lingora/blob/main/src/pages/Library.tsx"
click node_libraryhook "https://github.com/sushanyn/lingora/blob/main/src/hooks/useLibrary.ts"
click node_practicehub "https://github.com/sushanyn/lingora/blob/main/src/pages/Practice.tsx"
click node_flashcards "https://github.com/sushanyn/lingora/blob/main/src/pages/PracticeFlashcards.tsx"
click node_flashcard "https://github.com/sushanyn/lingora/blob/main/src/components/Flashcard.tsx"
click node_quiz "https://github.com/sushanyn/lingora/blob/main/src/pages/QuizMode.tsx"
click node_match "https://github.com/sushanyn/lingora/blob/main/src/pages/WordMatch.tsx"
click node_listening "https://github.com/sushanyn/lingora/blob/main/src/pages/ListeningChallenge.tsx"
click node_immersion "https://github.com/sushanyn/lingora/blob/main/src/pages/ImmersionPractice.tsx"
click node_music "https://github.com/sushanyn/lingora/blob/main/src/pages/MusicChallenge.tsx"
click node_musicapi "https://github.com/sushanyn/lingora/blob/main/api/music.ts"
click node_spacedrep "https://github.com/sushanyn/lingora/blob/main/src/utils/sm2.ts"
click node_home "https://github.com/sushanyn/lingora/blob/main/src/pages/Home.tsx"
click node_profilehook "https://github.com/sushanyn/lingora/blob/main/src/hooks/useProfile.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_routes,node_shell,node_supabaseclient,node_home toneBlue
class node_dictpage,node_dicthook,node_dictmodal,node_dictview,node_wordhook,node_wordmodal,node_importmodal,node_parser,node_suggest,node_translate,node_librarypage,node_libraryhook,node_database toneAmber
class node_practicehub,node_flashcards,node_flashcard,node_quiz,node_match,node_listening,node_immersion,node_music,node_musicapi,node_spacedrep,node_translationservice toneMint
class node_authpage,node_login,node_authhook,node_profilehook toneRose
class node_learner,node_clips toneIndigo
```

## Components

### Application

- [Routes & guards](https://github.com/sushanyn/lingora/blob/main/src/App.tsx): `src/App.tsx`
- [App shell](https://github.com/sushanyn/lingora/blob/main/src/layouts/AppLayout.tsx): `src/layouts/AppLayout.tsx`
- [Supabase client](https://github.com/sushanyn/lingora/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Learning dashboard](https://github.com/sushanyn/lingora/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`

### Vocabulary

- [Dictionary manager](https://github.com/sushanyn/lingora/blob/main/src/pages/Dictionaries.tsx): `src/pages/Dictionaries.tsx`
- [Dictionary operations](https://github.com/sushanyn/lingora/blob/main/src/hooks/useDictionaries.ts): `src/hooks/useDictionaries.ts`
- [Dictionary editor](https://github.com/sushanyn/lingora/blob/main/src/components/DictionaryModal.tsx): `src/components/DictionaryModal.tsx`
- [Dictionary contents](https://github.com/sushanyn/lingora/blob/main/src/pages/DictionaryView.tsx): `src/pages/DictionaryView.tsx`
- [Word operations](https://github.com/sushanyn/lingora/blob/main/src/hooks/useWords.ts): `src/hooks/useWords.ts`
- [Word editor](https://github.com/sushanyn/lingora/blob/main/src/components/WordModal.tsx): `src/components/WordModal.tsx`
- [Vocabulary import](https://github.com/sushanyn/lingora/blob/main/src/components/ImportModal.tsx): `src/components/ImportModal.tsx`
- [Import parser](https://github.com/sushanyn/lingora/blob/main/src/utils/importParser.ts): `src/utils/importParser.ts`
- [Word suggestions](https://github.com/sushanyn/lingora/blob/main/src/components/PandaSuggestModal.tsx): `src/components/PandaSuggestModal.tsx`
- [Translation endpoint](https://github.com/sushanyn/lingora/blob/main/api/translate.ts): `api/translate.ts`
- [Public library](https://github.com/sushanyn/lingora/blob/main/src/pages/Library.tsx): `src/pages/Library.tsx`
- [Dictionary cloning](https://github.com/sushanyn/lingora/blob/main/src/hooks/useLibrary.ts): `src/hooks/useLibrary.ts`

### Learning

- [Practice hub](https://github.com/sushanyn/lingora/blob/main/src/pages/Practice.tsx): `src/pages/Practice.tsx`
- [Flashcard practice](https://github.com/sushanyn/lingora/blob/main/src/pages/PracticeFlashcards.tsx): `src/pages/PracticeFlashcards.tsx`
- [Flashcard view](https://github.com/sushanyn/lingora/blob/main/src/components/Flashcard.tsx): `src/components/Flashcard.tsx`
- [Quiz mode](https://github.com/sushanyn/lingora/blob/main/src/pages/QuizMode.tsx): `src/pages/QuizMode.tsx`
- [Word match](https://github.com/sushanyn/lingora/blob/main/src/pages/WordMatch.tsx): `src/pages/WordMatch.tsx`
- [Listening challenge](https://github.com/sushanyn/lingora/blob/main/src/pages/ListeningChallenge.tsx): `src/pages/ListeningChallenge.tsx`
- [Immersion practice](https://github.com/sushanyn/lingora/blob/main/src/pages/ImmersionPractice.tsx): `src/pages/ImmersionPractice.tsx`
- [Music challenge](https://github.com/sushanyn/lingora/blob/main/src/pages/MusicChallenge.tsx): `src/pages/MusicChallenge.tsx`
- [Music endpoint](https://github.com/sushanyn/lingora/blob/main/api/music.ts): `api/music.ts`
- [Review scheduling](https://github.com/sushanyn/lingora/blob/main/src/utils/sm2.ts): `src/utils/sm2.ts`

### Account & Insights

- [Sign-in page](https://github.com/sushanyn/lingora/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [Login form](https://github.com/sushanyn/lingora/blob/main/src/components/LoginForm.tsx): `src/components/LoginForm.tsx`
- [Auth session](https://github.com/sushanyn/lingora/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Profile & streaks](https://github.com/sushanyn/lingora/blob/main/src/hooks/useProfile.ts): `src/hooks/useProfile.ts`

### Other components

- **Learner**
- **Supabase data store**
- **MyMemory API**
- **Video clip service**

## Connections

- Learner → Routes & guards: opens (evidence: `src/App.tsx`)
- Routes & guards → Sign-in page: routes to (evidence: `src/App.tsx`)
- Routes & guards → App shell: guards routes (evidence: `src/App.tsx`)
- Routes & guards → Dictionary manager: routes to (evidence: `src/App.tsx`)
- Routes & guards → Dictionary contents: routes to (evidence: `src/App.tsx`)
- Routes & guards → Practice hub: routes to (evidence: `src/App.tsx`)
- Routes & guards → Flashcard practice: routes to (evidence: `src/App.tsx`)
- Routes & guards → Quiz mode: routes to (evidence: `src/App.tsx`)
- Routes & guards → Word match: routes to (evidence: `src/App.tsx`)
- Routes & guards → Listening challenge: routes to (evidence: `src/App.tsx`)
- Routes & guards → Immersion practice: routes to (evidence: `src/App.tsx`)
- Routes & guards → Music challenge: routes to (evidence: `src/App.tsx`)
- Routes & guards → Learning dashboard: routes to (evidence: `src/App.tsx`)
- Sign-in page → Login form: renders (evidence: `src/pages/Auth.tsx`)
- Sign-in page → Auth session: checks session (evidence: `src/pages/Auth.tsx`)
- Login form → Supabase client: authenticates with (evidence: `src/components/LoginForm.tsx`)
- Auth session → Supabase client: reads session (evidence: `src/hooks/useAuth.ts`)
- Supabase client → Supabase data store: connects to (evidence: `src/lib/supabase.ts`)
- Dictionary manager → Dictionary operations: manages dictionaries (evidence: `src/pages/Dictionaries.tsx`)
- Dictionary manager → Dictionary editor: opens editor (evidence: `src/pages/Dictionaries.tsx`)
- Dictionary operations → Auth session: gets user (evidence: `src/hooks/useDictionaries.ts`)
- Dictionary operations → Supabase client: reads and writes (evidence: `src/hooks/useDictionaries.ts`)
- Dictionary contents → Word operations: loads words (evidence: `src/pages/DictionaryView.tsx`)
- Dictionary contents → Word editor: opens editor (evidence: `src/pages/DictionaryView.tsx`)
- Dictionary contents → Vocabulary import: opens importer (evidence: `src/pages/DictionaryView.tsx`)
- Dictionary contents → Word suggestions: opens suggestions (evidence: `src/pages/DictionaryView.tsx`)
- Word operations → Auth session: gets user (evidence: `src/hooks/useWords.ts`)
- Word operations → Supabase client: reads and writes (evidence: `src/hooks/useWords.ts`)
- Vocabulary import → Import parser: parses input (evidence: `src/utils/importParser.ts`)
- Word editor → Translation endpoint: requests translation
- Translation endpoint → MyMemory API: translates with (evidence: `README.md`)
- Public library → Dictionary cloning: loads public lists (evidence: `src/pages/Library.tsx`)
- Dictionary cloning → Supabase client: clones dictionary (evidence: `src/hooks/useLibrary.ts`)
- Flashcard practice → Flashcard view: renders cards
- Flashcard practice → Review scheduling: schedules reviews (evidence: `README.md`)
- Immersion practice → Video clip service: searches clips (evidence: `src/pages/ImmersionPractice.tsx`)
- Music challenge → Music endpoint: loads music data
- Learning dashboard → Profile & streaks: reads profile (evidence: `src/pages/Home.tsx`)
- Profile & streaks → Supabase client: reads and updates (evidence: `src/hooks/useProfile.ts`)
- Learner → Public library: browses (evidence: `src/pages/Library.tsx`)
- Learner → Sign-in page: signs in
