# bbn-ai-lab-2026/hon_su_trong_canh architecture

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

- Interactive diagram: https://gitdiagram.com/bbn-ai-lab-2026/hon_su_trong_canh
- Repository: https://github.com/bbn-ai-lab-2026/hon_su_trong_canh

## Overview

Ditich Viet is a Vietnamese heritage discovery and learning app. Visitors upload a monument image, review an AI identification, then explore supporting learning stages such as mind maps, quizzes, stories, and VR tours; they can also browse monument collections and search. Administrators manage heritage content, learning materials, settings, and VR configurations. The excerpts support the main routing, recognition, authentication, and selected storage relationships; several feature-page internals are unsampled, so their links are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/App.tsx) (App routing), [`src/pages/AdminPage.tsx`](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/AdminPage.tsx) (Admin workspace), [`src/features/admin/services/adminService.ts`](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/services/adminService.ts) (Admin content service), [`src/pages/RecognitionPage.tsx`](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/RecognitionPage.tsx) (Recognition workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell &amp; identity"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_storage[("Local storage<br/>[storage.ts]")]
  node_home["Home page<br/>[HomePage.tsx]"]
end

subgraph group_discovery["Heritage discovery"]
  node_recognition["Recognition workflow"]
  node_image["Image upload<br/>[ImageUploader.tsx]"]
  node_ml["Image identification<br/>[mlService.ts]"]
  node_inference["Inference server<br/>[server.ts]"]
  node_collection["Collection map"]
  node_search["Monument search"]
end

subgraph group_learning["Learning &amp; immersion"]
  node_mindmap["Mind maps"]
  node_quiz["Quizzes"]
  node_stories["Heritage stories"]
  node_vr["VR tours<br/>[VrTourPage.tsx]"]
end

subgraph group_admin["Administration"]
  node_adminpage["Admin workspace<br/>[AdminPage.tsx]"]
  node_adminservice["Admin content service<br/>[adminService.ts]"]
  node_vradmin["VR configuration"]
  node_vrmanager["VR tour manager<br/>[VrTourManager.tsx]"]
  node_mindmanager["Mind map manager<br/>[MindMapManager.tsx]"]
  node_audioadmin["Narration manager"]
  node_storyadmin["Story manager<br/>[StoryManager.tsx]"]
  node_quizadmin["Quiz manager<br/>[QuizManager.tsx]"]
  node_settings["System settings"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_recognition
node_app -.->|"routes to"| node_collection
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_vr
node_app -->|"guards route"| node_adminpage
node_app -->|"provides state"| node_auth
node_auth -->|"reads and writes"| node_storage
node_recognition -->|"renders upload"| node_image
node_image -->|"identifies image"| node_ml
node_recognition -->|"renders stage"| node_mindmap
node_recognition -->|"renders stage"| node_quiz
node_ml -.->|"requests inference"| node_inference
node_adminpage -->|"uses service"| node_adminservice
node_adminpage -->|"renders manager"| node_vrmanager
node_adminpage -->|"renders manager"| node_mindmanager
node_adminpage -->|"renders manager"| node_audioadmin
node_adminpage -->|"renders manager"| node_storyadmin
node_adminpage -->|"renders manager"| node_quizadmin
node_adminpage -->|"renders manager"| node_settings
node_adminservice -->|"reads and writes"| node_storage
node_adminservice -->|"uses configuration"| node_vradmin
node_vrmanager -->|"manages tours"| node_vradmin
node_vradmin -->|"reads and writes"| node_storage
node_storyadmin -->|"manages stories"| node_adminservice
node_mindmanager -.->|"saves content"| node_adminservice

click node_app "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/App.tsx"
click node_auth "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/core/contexts/AuthContext.tsx"
click node_storage "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/core/services/storage.ts"
click node_home "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/HomePage.tsx"
click node_recognition "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/RecognitionPage.tsx"
click node_image "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/ImageUploader.tsx"
click node_ml "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/services/mlService.ts"
click node_inference "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/server.ts"
click node_collection "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/CollectionMapPage.tsx"
click node_search "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/FindMonumentPage.tsx"
click node_mindmap "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/KnowledgeMindMapStep.tsx"
click node_quiz "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/QuickFunQuizStep.tsx"
click node_stories "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/HeritageRecordCard.tsx"
click node_vr "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/VrTourPage.tsx"
click node_adminpage "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/AdminPage.tsx"
click node_adminservice "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/services/adminService.ts"
click node_vradmin "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/vr-tour/services/vrTourAdminService.ts"
click node_vrmanager "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/VrTourManager.tsx"
click node_mindmanager "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/MindMapManager.tsx"
click node_audioadmin "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/AudioNarrationManager.tsx"
click node_storyadmin "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/StoryManager.tsx"
click node_quizadmin "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/QuizManager.tsx"
click node_settings "https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/SystemSettingsManager.tsx"

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_auth,node_storage,node_home toneBlue
class node_recognition,node_image,node_ml,node_inference,node_collection,node_search toneAmber
class node_mindmap,node_quiz,node_stories,node_vr toneMint
class node_adminpage,node_adminservice,node_vradmin,node_vrmanager,node_mindmanager,node_audioadmin,node_storyadmin,node_quizadmin,node_settings toneRose
class node_visitor toneIndigo
```

## Components

### App shell & identity

- [App routing](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication state](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/core/contexts/AuthContext.tsx): `src/core/contexts/AuthContext.tsx`
- [Local storage](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/core/services/storage.ts): `src/core/services/storage.ts`
- [Home page](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/HomePage.tsx): `src/pages/HomePage.tsx`

### Heritage discovery

- [Recognition workflow](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/RecognitionPage.tsx): `src/pages/RecognitionPage.tsx`
- [Image upload](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/ImageUploader.tsx): `src/features/recognition/components/ImageUploader.tsx`
- [Image identification](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/services/mlService.ts): `src/features/recognition/services/mlService.ts`
- [Inference server](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/server.ts): `server.ts`
- [Collection map](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/CollectionMapPage.tsx): `src/pages/CollectionMapPage.tsx`
- [Monument search](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/FindMonumentPage.tsx): `src/pages/FindMonumentPage.tsx`

### Learning & immersion

- [Mind maps](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/KnowledgeMindMapStep.tsx): `src/features/recognition/components/KnowledgeMindMapStep.tsx`
- [Quizzes](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/QuickFunQuizStep.tsx): `src/features/recognition/components/QuickFunQuizStep.tsx`
- [Heritage stories](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/recognition/components/HeritageRecordCard.tsx): `src/features/recognition/components/HeritageRecordCard.tsx`
- [VR tours](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/VrTourPage.tsx): `src/pages/VrTourPage.tsx`

### Administration

- [Admin workspace](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/pages/AdminPage.tsx): `src/pages/AdminPage.tsx`
- [Admin content service](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/services/adminService.ts): `src/features/admin/services/adminService.ts`
- [VR configuration](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/vr-tour/services/vrTourAdminService.ts): `src/features/vr-tour/services/vrTourAdminService.ts`
- [VR tour manager](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/VrTourManager.tsx): `src/features/admin/components/VrTourManager.tsx`
- [Mind map manager](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/MindMapManager.tsx): `src/features/admin/components/MindMapManager.tsx`
- [Narration manager](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/AudioNarrationManager.tsx): `src/features/admin/components/AudioNarrationManager.tsx`
- [Story manager](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/StoryManager.tsx): `src/features/admin/components/StoryManager.tsx`
- [Quiz manager](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/QuizManager.tsx): `src/features/admin/components/QuizManager.tsx`
- [System settings](https://github.com/bbn-ai-lab-2026/hon_su_trong_canh/blob/main/src/features/admin/components/SystemSettingsManager.tsx): `src/features/admin/components/SystemSettingsManager.tsx`

### Other components

- **Visitor**

## Connections

- Visitor → App routing: opens (evidence: `src/App.tsx`)
- App routing → Home page: routes to (evidence: `src/App.tsx`)
- App routing → Recognition workflow: routes to (evidence: `src/App.tsx`)
- App routing → Collection map: routes to
- App routing → Monument search: routes to (evidence: `src/App.tsx`)
- App routing → VR tours: routes to (evidence: `src/App.tsx`)
- App routing → Admin workspace: guards route (evidence: `src/App.tsx`)
- App routing → Authentication state: provides state (evidence: `src/App.tsx`)
- Authentication state → Local storage: reads and writes (evidence: `src/core/contexts/AuthContext.tsx`)
- Recognition workflow → Image upload: renders upload (evidence: `src/pages/RecognitionPage.tsx`)
- Image upload → Image identification: identifies image (evidence: `src/features/recognition/components/ImageUploader.tsx`)
- Recognition workflow → Mind maps: renders stage (evidence: `src/pages/RecognitionPage.tsx`)
- Recognition workflow → Quizzes: renders stage (evidence: `src/pages/RecognitionPage.tsx`)
- Image identification → Inference server: requests inference
- Admin workspace → Admin content service: uses service (evidence: `src/pages/AdminPage.tsx`)
- Admin workspace → VR tour manager: renders manager
- Admin workspace → Mind map manager: renders manager
- Admin workspace → Narration manager: renders manager
- Admin workspace → Story manager: renders manager
- Admin workspace → Quiz manager: renders manager
- Admin workspace → System settings: renders manager
- Admin content service → Local storage: reads and writes (evidence: `src/features/admin/services/adminService.ts`)
- Admin content service → VR configuration: uses configuration (evidence: `src/features/admin/services/adminService.ts`)
- VR tour manager → VR configuration: manages tours (evidence: `src/features/admin/components/VrTourManager.tsx`)
- VR configuration → Local storage: reads and writes (evidence: `src/features/vr-tour/services/vrTourAdminService.ts`)
- Story manager → Admin content service: manages stories (evidence: `src/features/admin/components/StoryManager.tsx`)
- Mind map manager → Admin content service: saves content
