# zaintahir2025/lingu_ai architecture

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

- Interactive diagram: https://gitdiagram.com/zaintahir2025/lingu_ai
- Repository: https://github.com/zaintahir2025/lingu_ai

## Overview

LinguAI is a cross-platform Flutter language-learning app. A learner enters through authentication and onboarding, then uses the home dashboard to reach lessons, quizzes, spaced-repetition reviews, and an AI tutor; progress and profile features support that study loop. The graph also preserves the README’s major capabilities, including localization, speech, administration, and monetization. The supplied excerpts do not include Dart implementation files, so feature connections rely on README statements; backend implementation paths are absent from the tree and are not represented.

Main entry points: [`lib/features/home`](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/home) (Home Dashboard), [`lib/features/learn`](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/learn) (Lessons and Vocabulary), [`lib/features/quiz`](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/quiz) (Quizzes), [`lib/features/review`](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/review) (Review Sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and Accounts"]
  node_app_entry["App Entry<br/>[main.dart]"]
  node_routing["App Routing<br/>[app_router.dart]"]
  node_auth["Authentication"]
  node_onboarding["Onboarding"]
  node_home["Home Dashboard"]
  node_user_profile["User Profile"]
end

subgraph group_learning["Learning Experience"]
  node_learn["Lessons and Vocabulary"]
  node_quiz["Quizzes"]
  node_review["Review Sessions"]
  node_srs["SM-2 Scheduling<br/>[srs_service.dart]"]
  node_tutor["AI Tutor"]
end

subgraph group_progress["Progress and Support"]
  node_progress_ui["Progress and Achievements"]
  node_game_state["XP Hearts Streaks"]
  node_admin["Admin Panel"]
  node_support["Support"]
end

subgraph group_services["Platform Services"]
  node_local_db[("Local Database<br/>[database.dart]")]
  node_network["Network Client<br/>[dio_client.dart]"]
  node_tts["Speech Synthesis<br/>[tts_service.dart]"]
  node_localization["English Urdu Localization"]
  node_payments["Payment Management"]
  node_ads["Ad Service<br/>[ad_service.dart]"]
end

node_learner(("Learner"))
node_gemini["Gemini API"]
node_stripe["Stripe"]

node_learner -->|"opens"| node_app_entry
node_app_entry -.->|"starts"| node_routing
node_routing -->|"routes to"| node_auth
node_auth -.->|"continues to"| node_onboarding
node_onboarding -.->|"completes into"| node_home
node_home -->|"opens lessons"| node_learn
node_home -->|"opens quizzes"| node_quiz
node_home -->|"opens review"| node_review
node_home -->|"opens tutor"| node_tutor
node_learn -.->|"uses local data"| node_local_db
node_review -->|"schedules reviews"| node_srs
node_tutor -->|"requests tutoring"| node_gemini
node_tutor -.->|"sends requests"| node_network
node_home -->|"offers profile"| node_user_profile
node_quiz -.->|"updates progress"| node_game_state
node_review -.->|"updates progress"| node_game_state
node_home -->|"shows progress"| node_progress_ui
node_progress_ui -.->|"uses study state"| node_game_state
node_admin -->|"manages tickets"| node_support
node_admin -.->|"accesses services"| node_network
node_learn -->|"supports pronunciation"| node_tts
node_quiz -->|"localizes interface"| node_localization
node_home -->|"localizes interface"| node_localization
node_payments -->|"handles checkout"| node_stripe
node_home -.->|"offers subscription"| node_payments
node_home -.->|"may show ads"| node_ads

click node_app_entry "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/main.dart"
click node_routing "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/router/app_router.dart"
click node_auth "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/auth"
click node_onboarding "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/onboarding"
click node_home "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/home"
click node_user_profile "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/user"
click node_learn "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/learn"
click node_quiz "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/quiz"
click node_review "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/review"
click node_srs "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/srs/srs_service.dart"
click node_tutor "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/tutor"
click node_progress_ui "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/progress"
click node_game_state "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/game_state/game_state_provider.dart"
click node_admin "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/admin"
click node_support "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/features/progress/data/support_repository.dart"
click node_local_db "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/database/database.dart"
click node_network "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/network/dio_client.dart"
click node_tts "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/audio/tts_service.dart"
click node_localization "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/l10n"
click node_payments "https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/payment"
click node_ads "https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/ads/ad_service.dart"

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_entry,node_routing,node_auth,node_onboarding,node_home,node_user_profile toneBlue
class node_learn,node_quiz,node_review,node_srs,node_tutor toneAmber
class node_progress_ui,node_game_state,node_admin,node_support,node_gemini toneMint
class node_local_db,node_network,node_tts,node_localization,node_payments,node_ads toneRose
class node_learner,node_stripe toneIndigo
```

## Components

### App and Accounts

- [App Entry](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/main.dart): `lib/main.dart`
- [App Routing](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/router/app_router.dart): `lib/core/router/app_router.dart`
- [Authentication](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/auth): `lib/features/auth`
- [Onboarding](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/onboarding): `lib/features/onboarding`
- [Home Dashboard](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/home): `lib/features/home`
- [User Profile](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/user): `lib/features/user`

### Learning Experience

- [Lessons and Vocabulary](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/learn): `lib/features/learn`
- [Quizzes](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/quiz): `lib/features/quiz`
- [Review Sessions](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/review): `lib/features/review`
- [SM-2 Scheduling](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/srs/srs_service.dart): `lib/core/srs/srs_service.dart`
- [AI Tutor](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/tutor): `lib/features/tutor`

### Progress and Support

- [Progress and Achievements](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/progress): `lib/features/progress`
- [XP Hearts Streaks](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/game_state/game_state_provider.dart): `lib/core/game_state/game_state_provider.dart`
- [Admin Panel](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/admin): `lib/features/admin`
- [Support](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/features/progress/data/support_repository.dart): `lib/features/progress/data/support_repository.dart`

### Platform Services

- [Local Database](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/database/database.dart): `lib/core/database/database.dart`
- [Network Client](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/network/dio_client.dart): `lib/core/network/dio_client.dart`
- [Speech Synthesis](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/audio/tts_service.dart): `lib/core/audio/tts_service.dart`
- [English Urdu Localization](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/l10n): `lib/l10n`
- [Payment Management](https://github.com/zaintahir2025/lingu_ai/tree/main/lib/features/payment): `lib/features/payment`
- [Ad Service](https://github.com/zaintahir2025/lingu_ai/blob/main/lib/core/ads/ad_service.dart): `lib/core/ads/ad_service.dart`

### Other components

- **Learner**
- **Gemini API**
- **Stripe**

## Connections

- Learner → App Entry: opens (evidence: `README.md`)
- App Entry → App Routing: starts
- App Routing → Authentication: routes to (evidence: `README.md`)
- Authentication → Onboarding: continues to
- Onboarding → Home Dashboard: completes into
- Home Dashboard → Lessons and Vocabulary: opens lessons (evidence: `README.md`)
- Home Dashboard → Quizzes: opens quizzes (evidence: `README.md`)
- Home Dashboard → Review Sessions: opens review (evidence: `README.md`)
- Home Dashboard → AI Tutor: opens tutor (evidence: `README.md`)
- Lessons and Vocabulary → Local Database: uses local data
- Review Sessions → SM-2 Scheduling: schedules reviews (evidence: `README.md`)
- AI Tutor → Gemini API: requests tutoring (evidence: `README.md`)
- AI Tutor → Network Client: sends requests
- Home Dashboard → User Profile: offers profile (evidence: `README.md`)
- Quizzes → XP Hearts Streaks: updates progress
- Review Sessions → XP Hearts Streaks: updates progress
- Home Dashboard → Progress and Achievements: shows progress (evidence: `README.md`)
- Progress and Achievements → XP Hearts Streaks: uses study state
- Admin Panel → Support: manages tickets (evidence: `README.md`)
- Admin Panel → Network Client: accesses services
- Lessons and Vocabulary → Speech Synthesis: supports pronunciation (evidence: `README.md`)
- Quizzes → English Urdu Localization: localizes interface (evidence: `README.md`)
- Home Dashboard → English Urdu Localization: localizes interface (evidence: `README.md`)
- Payment Management → Stripe: handles checkout (evidence: `README.md`)
- Home Dashboard → Payment Management: offers subscription
- Home Dashboard → Ad Service: may show ads
