# dotruc1526/suchill architecture

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

- Interactive diagram: https://gitdiagram.com/dotruc1526/suchill
- Repository: https://github.com/dotruc1526/suchill

## Overview

Sử Chill is a mobile-first Vietnamese history-learning app. Its main flow is chapter discovery → lesson (short-form story or scripted Visual Novel) → completion → chapter quiz → result, with XP tracked in app state. The README also describes video lessons, practice, an AI assistant, profiles, streaks, and achievements. Those feature areas appear in the tree, but their internal wiring was not sampled; the graph shows them as app-rendered screens without speculative service links.

Main entry points: [`src/App.tsx`](https://github.com/dotruc1526/suchill/blob/main/src/App.tsx) (App), [`src/features/home/HomeScreen.tsx`](https://github.com/dotruc1526/suchill/blob/main/src/features/home/HomeScreen.tsx) (Home and journey), [`src/features/learning/ChapterScreen.tsx`](https://github.com/dotruc1526/suchill/blob/main/src/features/learning/ChapterScreen.tsx) (Chapter screen), [`src/features/learning/LessonScreen.tsx`](https://github.com/dotruc1526/suchill/blob/main/src/features/learning/LessonScreen.tsx) (Lesson screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_app["App<br/>[App.tsx]"]
  node_navigation["Navigation bars<br/>[BottomNav.tsx]"]
end

subgraph group_learning["Learning flow"]
  node_home["Home and journey<br/>[HomeScreen.tsx]"]
  node_chapter["Chapter screen<br/>[ChapterScreen.tsx]"]
  node_lesson["Lesson screen<br/>[LessonScreen.tsx]"]
  node_lesson_done["Lesson completion"]
  node_vn_player["Visual Novel player"]
  node_quiz["Chapter quiz<br/>[QuizScreen.tsx]"]
  node_quiz_result["Quiz result"]
end

subgraph group_engagement["Engagement features"]
  node_practice["Practice<br/>[PracticeScreen.tsx]"]
  node_assistant["AI assistant<br/>[AIScreen.tsx]"]
  node_profile["Profile<br/>[ProfileScreen.tsx]"]
end

subgraph group_content["Content and state"]
  node_stories["Story scripts<br/>[index.ts]"]
  node_chapter_data["Chapter content<br/>[index.ts]"]
  node_user_stats["User stats and achievements<br/>[index.ts]"]
  node_chapter_service["Chapter service<br/>[chapterService.ts]"]
  node_user_service["User service<br/>[userService.ts]"]
  node_progress_service["Progress storage service<br/>[progressService.ts]"]
end

node_learner(("Learner"))
node_browser_storage[("Browser local storage")]

node_learner -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_home
node_app -->|"renders"| node_practice
node_app -->|"renders"| node_assistant
node_app -->|"renders"| node_profile
node_app -->|"renders"| node_chapter
node_app -->|"renders"| node_lesson
node_app -->|"renders"| node_lesson_done
node_app -->|"renders"| node_quiz
node_app -->|"renders"| node_quiz_result
node_app -->|"reads"| node_chapter_data
node_app -->|"reads"| node_user_stats
node_app -->|"resolves story"| node_stories
node_app -->|"renders"| node_vn_player
node_home -->|"requests navigation"| node_app
node_chapter -->|"requests navigation"| node_app
node_lesson -->|"reports completion"| node_app
node_vn_player -->|"reports completion"| node_app
node_lesson_done -->|"requests next step"| node_app
node_quiz -->|"reports score"| node_app
node_quiz_result -->|"requests retry or home"| node_app
node_progress_service -->|"reads and writes"| node_browser_storage
node_chapter_service -->|"reads"| node_chapter_data
node_user_service -->|"reads"| node_user_stats

click node_app "https://github.com/dotruc1526/suchill/blob/main/src/App.tsx"
click node_navigation "https://github.com/dotruc1526/suchill/blob/main/src/components/layout/BottomNav.tsx"
click node_home "https://github.com/dotruc1526/suchill/blob/main/src/features/home/HomeScreen.tsx"
click node_chapter "https://github.com/dotruc1526/suchill/blob/main/src/features/learning/ChapterScreen.tsx"
click node_lesson "https://github.com/dotruc1526/suchill/blob/main/src/features/learning/LessonScreen.tsx"
click node_lesson_done "https://github.com/dotruc1526/suchill/blob/main/src/features/learning/LessonCompleteScreen.tsx"
click node_vn_player "https://github.com/dotruc1526/suchill/blob/main/src/features/visual-novel/VisualNovelPlayer.tsx"
click node_stories "https://github.com/dotruc1526/suchill/blob/main/src/features/visual-novel/stories/index.ts"
click node_quiz "https://github.com/dotruc1526/suchill/blob/main/src/features/quiz/QuizScreen.tsx"
click node_quiz_result "https://github.com/dotruc1526/suchill/blob/main/src/features/quiz/QuizResultScreen.tsx"
click node_practice "https://github.com/dotruc1526/suchill/blob/main/src/features/practice/PracticeScreen.tsx"
click node_assistant "https://github.com/dotruc1526/suchill/blob/main/src/features/ai-assistant/AIScreen.tsx"
click node_profile "https://github.com/dotruc1526/suchill/blob/main/src/features/profile/ProfileScreen.tsx"
click node_chapter_data "https://github.com/dotruc1526/suchill/blob/main/src/data/index.ts"
click node_user_stats "https://github.com/dotruc1526/suchill/blob/main/src/data/index.ts"
click node_chapter_service "https://github.com/dotruc1526/suchill/blob/main/src/services/chapterService.ts"
click node_user_service "https://github.com/dotruc1526/suchill/blob/main/src/services/userService.ts"
click node_progress_service "https://github.com/dotruc1526/suchill/blob/main/src/services/progressService.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_app,node_navigation toneBlue
class node_home,node_chapter,node_lesson,node_lesson_done,node_vn_player,node_quiz,node_quiz_result,node_browser_storage toneAmber
class node_practice,node_assistant,node_profile toneMint
class node_stories,node_chapter_data,node_user_stats,node_chapter_service,node_user_service,node_progress_service toneRose
class node_learner toneIndigo
```

## Components

### App navigation

- [App](https://github.com/dotruc1526/suchill/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation bars](https://github.com/dotruc1526/suchill/blob/main/src/components/layout/BottomNav.tsx): `src/components/layout/BottomNav.tsx`

### Learning flow

- [Home and journey](https://github.com/dotruc1526/suchill/blob/main/src/features/home/HomeScreen.tsx): `src/features/home/HomeScreen.tsx`
- [Chapter screen](https://github.com/dotruc1526/suchill/blob/main/src/features/learning/ChapterScreen.tsx): `src/features/learning/ChapterScreen.tsx`
- [Lesson screen](https://github.com/dotruc1526/suchill/blob/main/src/features/learning/LessonScreen.tsx): `src/features/learning/LessonScreen.tsx`
- [Lesson completion](https://github.com/dotruc1526/suchill/blob/main/src/features/learning/LessonCompleteScreen.tsx): `src/features/learning/LessonCompleteScreen.tsx`
- [Visual Novel player](https://github.com/dotruc1526/suchill/blob/main/src/features/visual-novel/VisualNovelPlayer.tsx): `src/features/visual-novel/VisualNovelPlayer.tsx`
- [Chapter quiz](https://github.com/dotruc1526/suchill/blob/main/src/features/quiz/QuizScreen.tsx): `src/features/quiz/QuizScreen.tsx`
- [Quiz result](https://github.com/dotruc1526/suchill/blob/main/src/features/quiz/QuizResultScreen.tsx): `src/features/quiz/QuizResultScreen.tsx`

### Engagement features

- [Practice](https://github.com/dotruc1526/suchill/blob/main/src/features/practice/PracticeScreen.tsx): `src/features/practice/PracticeScreen.tsx`
- [AI assistant](https://github.com/dotruc1526/suchill/blob/main/src/features/ai-assistant/AIScreen.tsx): `src/features/ai-assistant/AIScreen.tsx`
- [Profile](https://github.com/dotruc1526/suchill/blob/main/src/features/profile/ProfileScreen.tsx): `src/features/profile/ProfileScreen.tsx`

### Content and state

- [Story scripts](https://github.com/dotruc1526/suchill/blob/main/src/features/visual-novel/stories/index.ts): `src/features/visual-novel/stories/index.ts`
- [Chapter content](https://github.com/dotruc1526/suchill/blob/main/src/data/index.ts): `src/data/index.ts`
- [User stats and achievements](https://github.com/dotruc1526/suchill/blob/main/src/data/index.ts): `src/data/index.ts`
- [Chapter service](https://github.com/dotruc1526/suchill/blob/main/src/services/chapterService.ts): `src/services/chapterService.ts`
- [User service](https://github.com/dotruc1526/suchill/blob/main/src/services/userService.ts): `src/services/userService.ts`
- [Progress storage service](https://github.com/dotruc1526/suchill/blob/main/src/services/progressService.ts): `src/services/progressService.ts`

### Other components

- **Learner**
- **Browser local storage**

## Connections

- Learner → App: uses
- App → Navigation bars: renders
- App → Home and journey: renders
- App → Practice: renders
- App → AI assistant: renders
- App → Profile: renders
- App → Chapter screen: renders
- App → Lesson screen: renders
- App → Lesson completion: renders
- App → Chapter quiz: renders
- App → Quiz result: renders
- App → Chapter content: reads
- App → User stats and achievements: reads
- App → Story scripts: resolves story
- App → Visual Novel player: renders
- Home and journey → App: requests navigation
- Chapter screen → App: requests navigation
- Lesson screen → App: reports completion
- Visual Novel player → App: reports completion
- Lesson completion → App: requests next step
- Chapter quiz → App: reports score
- Quiz result → App: requests retry or home
- Progress storage service → Browser local storage: reads and writes
- Chapter service → Chapter content: reads
- User service → User stats and achievements: reads
