# leminhai2007/ts-web-exercise architecture

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

- Interactive diagram: https://gitdiagram.com/leminhai2007/ts-web-exercise
- Repository: https://github.com/leminhai2007/ts-web-exercise

## Overview

This React application brings several standalone games and productivity tools together behind a home-page catalog and routed project pages. Users choose a tool, interact with its page, and (for Sudoku) can request puzzles through an app API endpoint backed by the You Do Sudoku service. The README and project catalog also identify habit tracking, Pomodoro timers, flash cards, the lucky wheel, 2048, and cross-project data export/import. Core page-to-route relationships are shown from the sampled App source; unsampled page internals and persistence wiring are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/App.tsx) (Router and theme), [`src/components/HomePage.tsx`](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/HomePage.tsx) (Tool catalog), [`src/components/ProjectLayout.tsx`](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/ProjectLayout.tsx) (Project page shell), [`src/components/AppIcons.tsx`](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/AppIcons.tsx) (Shared icons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_app["Router and theme<br/>[App.tsx]"]
  node_home["Tool catalog<br/>[HomePage.tsx]"]
  node_project_layout["Project page shell<br/>[ProjectLayout.tsx]"]
  node_projects["Project registry<br/>[projects.ts]"]
  node_background["Animated backdrop"]
  node_icons["Shared icons<br/>[AppIcons.tsx]"]
end

subgraph group_games["Games"]
  node_game2048["2048 game<br/>[Game2048.tsx]"]
  node_sudoku["Sudoku game<br/>[Sudoku.tsx]"]
  node_sudoku_board["Sudoku board<br/>[SudokuBoard.tsx]"]
  node_lucky_wheel["Lucky wheel<br/>[LuckyWheel.tsx]"]
end

subgraph group_tools["Productivity tools"]
  node_flash_cards["Flash cards<br/>[FlashCards.tsx]"]
  node_data_manager["Data manager<br/>[DataManager.tsx]"]
  node_habit_tracker["Habit tracker<br/>[HabitTracker.tsx]"]
  node_pomodoro["Pomodoro clock<br/>[PomodoroClock.tsx]"]
end

subgraph group_sudoku_service["Sudoku service"]
  node_sudoku_api["Puzzle API client<br/>[sudokuApi.ts]"]
  node_api_handler["Puzzle API handler<br/>[youdosudoku.ts]"]
end

node_visitor(("Visitor"))
node_puzzle_service(("You Do Sudoku"))

node_visitor -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_game2048
node_app -->|"routes to"| node_sudoku
node_app -->|"routes to"| node_lucky_wheel
node_app -->|"routes to"| node_flash_cards
node_app -->|"routes to"| node_data_manager
node_app -.->|"routes to"| node_habit_tracker
node_app -.->|"routes to"| node_pomodoro
node_app -->|"renders"| node_background
node_home -->|"reads catalog"| node_projects
node_home -.->|"links to"| node_game2048
node_home -.->|"links to"| node_sudoku
node_home -.->|"links to"| node_lucky_wheel
node_home -.->|"links to"| node_flash_cards
node_home -.->|"links to"| node_data_manager
node_home -.->|"links to"| node_habit_tracker
node_home -.->|"links to"| node_pomodoro
node_sudoku -->|"requests puzzle"| node_sudoku_api
node_sudoku -.->|"renders board"| node_sudoku_board
node_sudoku_api -.->|"posts request"| node_api_handler
node_api_handler -.->|"requests puzzle"| node_puzzle_service
node_game2048 -->|"uses shell"| node_project_layout
node_sudoku -->|"uses shell"| node_project_layout
node_lucky_wheel -->|"uses shell"| node_project_layout
node_flash_cards -->|"uses shell"| node_project_layout
node_data_manager -->|"uses shell"| node_project_layout
node_habit_tracker -->|"uses shell"| node_project_layout
node_pomodoro -->|"uses shell"| node_project_layout
node_project_layout -->|"imports icon"| node_icons
node_game2048 -->|"imports icons"| node_icons
node_sudoku -->|"imports icons"| node_icons
node_lucky_wheel -->|"imports icons"| node_icons
node_flash_cards -->|"imports icons"| node_icons
node_data_manager -->|"imports icons"| node_icons
node_habit_tracker -->|"imports icons"| node_icons
node_pomodoro -->|"imports icons"| node_icons

click node_app "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/App.tsx"
click node_home "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/HomePage.tsx"
click node_project_layout "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/ProjectLayout.tsx"
click node_projects "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/data/projects.ts"
click node_background "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/AnimatedBackground.tsx"
click node_icons "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/AppIcons.tsx"
click node_game2048 "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/Game2048.tsx"
click node_sudoku "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/Sudoku.tsx"
click node_sudoku_board "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/SudokuBoard.tsx"
click node_lucky_wheel "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/LuckyWheel.tsx"
click node_flash_cards "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/FlashCards.tsx"
click node_data_manager "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/DataManager.tsx"
click node_habit_tracker "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/HabitTracker.tsx"
click node_pomodoro "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/PomodoroClock.tsx"
click node_sudoku_api "https://github.com/leminhai2007/ts-web-exercise/blob/main/src/api/sudokuApi.ts"
click node_api_handler "https://github.com/leminhai2007/ts-web-exercise/blob/main/api/youdosudoku.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_home,node_project_layout,node_projects,node_background,node_icons toneBlue
class node_game2048,node_sudoku,node_sudoku_board,node_lucky_wheel toneAmber
class node_flash_cards,node_data_manager,node_habit_tracker,node_pomodoro toneMint
class node_sudoku_api,node_api_handler toneRose
class node_visitor,node_puzzle_service toneIndigo
```

## Components

### App navigation

- [Router and theme](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/App.tsx): `src/App.tsx`
- [Tool catalog](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/HomePage.tsx): `src/components/HomePage.tsx`
- [Project page shell](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/ProjectLayout.tsx): `src/components/ProjectLayout.tsx`
- [Project registry](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/data/projects.ts): `src/data/projects.ts`
- [Animated backdrop](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/AnimatedBackground.tsx): `src/components/AnimatedBackground.tsx`
- [Shared icons](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/AppIcons.tsx): `src/components/AppIcons.tsx`

### Games

- [2048 game](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/Game2048.tsx): `src/components/Game2048.tsx`
- [Sudoku game](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/Sudoku.tsx): `src/components/Sudoku.tsx`
- [Sudoku board](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/SudokuBoard.tsx): `src/components/SudokuBoard.tsx`
- [Lucky wheel](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/LuckyWheel.tsx): `src/components/LuckyWheel.tsx`

### Productivity tools

- [Flash cards](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/FlashCards.tsx): `src/components/FlashCards.tsx`
- [Data manager](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/DataManager.tsx): `src/components/DataManager.tsx`
- [Habit tracker](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/HabitTracker.tsx): `src/components/HabitTracker.tsx`
- [Pomodoro clock](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/components/PomodoroClock.tsx): `src/components/PomodoroClock.tsx`

### Sudoku service

- [Puzzle API client](https://github.com/leminhai2007/ts-web-exercise/blob/main/src/api/sudokuApi.ts): `src/api/sudokuApi.ts`
- [Puzzle API handler](https://github.com/leminhai2007/ts-web-exercise/blob/main/api/youdosudoku.ts): `api/youdosudoku.ts`

### Other components

- **Visitor**
- **You Do Sudoku**

## Connections

- Visitor → Router and theme: opens app (evidence: `src/App.tsx`)
- Router and theme → Tool catalog: routes to (evidence: `src/App.tsx`)
- Router and theme → 2048 game: routes to (evidence: `src/App.tsx`)
- Router and theme → Sudoku game: routes to (evidence: `src/App.tsx`)
- Router and theme → Lucky wheel: routes to (evidence: `src/App.tsx`)
- Router and theme → Flash cards: routes to (evidence: `src/App.tsx`)
- Router and theme → Data manager: routes to (evidence: `src/App.tsx`)
- Router and theme → Habit tracker: routes to (evidence: `src/App.tsx`)
- Router and theme → Pomodoro clock: routes to (evidence: `src/App.tsx`)
- Router and theme → Animated backdrop: renders (evidence: `src/App.tsx`)
- Tool catalog → Project registry: reads catalog (evidence: `src/components/HomePage.tsx`)
- Tool catalog → 2048 game: links to
- Tool catalog → Sudoku game: links to
- Tool catalog → Lucky wheel: links to
- Tool catalog → Flash cards: links to
- Tool catalog → Data manager: links to
- Tool catalog → Habit tracker: links to
- Tool catalog → Pomodoro clock: links to
- Sudoku game → Puzzle API client: requests puzzle (evidence: `src/components/Sudoku.tsx`)
- Sudoku game → Sudoku board: renders board (evidence: `src/components/Sudoku.tsx`)
- Puzzle API client → Puzzle API handler: posts request
- Puzzle API handler → You Do Sudoku: requests puzzle
- 2048 game → Project page shell: uses shell (evidence: `src/components/Game2048.tsx`)
- Sudoku game → Project page shell: uses shell (evidence: `src/components/Sudoku.tsx`)
- Lucky wheel → Project page shell: uses shell (evidence: `src/components/LuckyWheel.tsx`)
- Flash cards → Project page shell: uses shell (evidence: `src/components/FlashCards.tsx`)
- Data manager → Project page shell: uses shell (evidence: `src/components/DataManager.tsx`)
- Habit tracker → Project page shell: uses shell (evidence: `src/components/HabitTracker.tsx`)
- Pomodoro clock → Project page shell: uses shell (evidence: `src/components/PomodoroClock.tsx`)
- Project page shell → Shared icons: imports icon (evidence: `src/components/ProjectLayout.tsx`)
- 2048 game → Shared icons: imports icons (evidence: `src/components/Game2048.tsx`)
- Sudoku game → Shared icons: imports icons (evidence: `src/components/Sudoku.tsx`)
- Lucky wheel → Shared icons: imports icons (evidence: `src/components/LuckyWheel.tsx`)
- Flash cards → Shared icons: imports icons (evidence: `src/components/FlashCards.tsx`)
- Data manager → Shared icons: imports icons (evidence: `src/components/DataManager.tsx`)
- Habit tracker → Shared icons: imports icons (evidence: `src/components/HabitTracker.tsx`)
- Pomodoro clock → Shared icons: imports icons (evidence: `src/components/PomodoroClock.tsx`)
