# lamduychuclinh19/do_an_dich_thuat architecture

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

- Interactive diagram: https://gitdiagram.com/lamduychuclinh19/do_an_dich_thuat
- Repository: https://github.com/lamduychuclinh19/do_an_dich_thuat

## Overview

This repository implements a multilingual audio-guide system: an admin web app manages points of interest (POIs) and translations, while a FastAPI backend exposes admin and public APIs and serves audio. The main workflow is admin authentication, POI and narration management, audio generation and persistence, then public guide retrieval. Admin staff management is also present in the service layer. Edges reflect the shown route registrations, service calls, and documented imports; frontend-to-backend request details and unsampled implementations are not inferred.

Main entry points: [`app/main.py`](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/main.py) (FastAPI application), [`app/services/translation_service.py`](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/translation_service.py) (Translation service), [`admin-web/src/App.jsx`](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/App.jsx) (Web app routes), [`app/services/guide_service.py`](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/guide_service.py) (Guide service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Admin web"]
  node_app["Web app routes<br/>[App.jsx]"]
  node_login_ui["Login page<br/>[LoginPage.jsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_poi_ui["POI management<br/>[PoiPage.jsx]"]
  node_translation_ui["Translation management"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[auth_router.py]"]
  node_auth["Authentication service<br/>[auth_service.py]"]
  node_auth_guard["Admin authorization<br/>[auth_dependency.py]"]
  node_poi_routes["POI routes"]
  node_public_poi_routes["Public POI routes"]
  node_translation_routes["Translation routes"]
  node_public_translation_routes["Public translation routes"]
  node_guide_routes["Guide routes<br/>[guide_router.py]"]
end

subgraph group_domain["Guide domain"]
  node_poi_service["POI service<br/>[poi_service.py]"]
  node_translation_service["Translation service"]
  node_guide_service["Guide service<br/>[guide_service.py]"]
  node_admin_management["Staff management"]
end

subgraph group_storage["Persistence and audio"]
  node_poi_repo["POI repository<br/>[poi_repository.py]"]
  node_translation_repo["Translation repository"]
  node_admin_repo["Admin repository"]
  node_database[("SQL Server database<br/>[database.py]")]
  node_audio["Audio service<br/>[audio_service.py]"]
end

node_admin(("Administrator"))

node_admin -.->|"uses"| node_app
node_app -->|"routes to"| node_login_ui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_poi_ui
node_app -->|"routes to"| node_translation_ui
node_backend -->|"registers"| node_auth_routes
node_backend -->|"registers"| node_poi_routes
node_backend -->|"registers"| node_public_poi_routes
node_backend -->|"registers"| node_translation_routes
node_backend -->|"registers"| node_public_translation_routes
node_backend -->|"registers"| node_guide_routes
node_auth_routes -->|"calls"| node_auth
node_poi_routes -->|"requires"| node_auth_guard
node_translation_routes -->|"requires"| node_auth_guard
node_translation_routes -->|"calls"| node_translation_service
node_public_translation_routes -->|"calls"| node_translation_service
node_public_poi_routes -->|"calls"| node_poi_service
node_guide_routes -->|"calls"| node_guide_service
node_auth_guard -->|"verifies token"| node_auth
node_auth -->|"reads and updates"| node_admin_repo
node_poi_service -->|"queries"| node_poi_repo
node_translation_service -->|"checks POIs"| node_poi_repo
node_translation_service -->|"reads and writes"| node_translation_repo
node_translation_service -->|"generates audio"| node_audio
node_guide_service -->|"uses"| node_poi_service
node_guide_service -->|"uses"| node_translation_service
node_guide_service -->|"queries guides"| node_translation_repo
node_admin_management -->|"uses"| node_admin_repo
node_poi_repo -->|"queries"| node_database
node_translation_repo -->|"queries"| node_database
node_admin_repo -->|"queries"| node_database
node_backend -->|"mounts audio"| node_audio
node_login_ui -->|"uses"| node_api_client
node_dashboard -->|"uses"| node_api_client
node_poi_ui -->|"uses"| node_api_client
node_translation_ui -->|"uses"| node_api_client

click node_app "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/App.jsx"
click node_login_ui "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/LoginPage.jsx"
click node_dashboard "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/DashboardPage.jsx"
click node_poi_ui "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/PoiPage.jsx"
click node_translation_ui "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/TranslationPage.jsx"
click node_api_client "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/services/api.js"
click node_backend "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/main.py"
click node_auth_routes "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/auth_router.py"
click node_auth "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/auth_service.py"
click node_auth_guard "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/dependencies/auth_dependency.py"
click node_poi_routes "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/admin_poi_router.py"
click node_public_poi_routes "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/public_poi_router.py"
click node_translation_routes "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/admin_translation_router.py"
click node_public_translation_routes "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/public_translation_router.py"
click node_guide_routes "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/guide_router.py"
click node_poi_service "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/poi_service.py"
click node_translation_service "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/translation_service.py"
click node_guide_service "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/guide_service.py"
click node_admin_management "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/admin_management_service.py"
click node_poi_repo "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/repositaries/poi_repository.py"
click node_translation_repo "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/repositaries/translation_repository.py"
click node_admin_repo "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/repositaries/admin_repository.py"
click node_database "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/database.py"
click node_audio "https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/audio_service.py"

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_login_ui,node_dashboard,node_poi_ui,node_translation_ui,node_api_client toneBlue
class node_backend,node_auth_routes,node_auth,node_auth_guard,node_poi_routes,node_public_poi_routes,node_translation_routes,node_public_translation_routes,node_guide_routes toneAmber
class node_poi_service,node_translation_service,node_guide_service,node_admin_management toneMint
class node_poi_repo,node_translation_repo,node_admin_repo,node_database,node_audio toneRose
class node_admin toneIndigo
```

## Components

### Admin web

- [Web app routes](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/App.jsx): `admin-web/src/App.jsx`
- [Login page](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/LoginPage.jsx): `admin-web/src/pages/LoginPage.jsx`
- [Dashboard](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/DashboardPage.jsx): `admin-web/src/pages/DashboardPage.jsx`
- [POI management](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/PoiPage.jsx): `admin-web/src/pages/PoiPage.jsx`
- [Translation management](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/pages/TranslationPage.jsx): `admin-web/src/pages/TranslationPage.jsx`
- [API client](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/admin-web/src/services/api.js): `admin-web/src/services/api.js`

### API and access

- [FastAPI application](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/main.py): `app/main.py`
- [Authentication routes](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/auth_router.py): `app/routers/auth_router.py`
- [Authentication service](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/auth_service.py): `app/services/auth_service.py`
- [Admin authorization](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/dependencies/auth_dependency.py): `app/dependencies/auth_dependency.py`
- [POI routes](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/admin_poi_router.py): `app/routers/admin_poi_router.py`
- [Public POI routes](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/public_poi_router.py): `app/routers/public_poi_router.py`
- [Translation routes](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/admin_translation_router.py): `app/routers/admin_translation_router.py`
- [Public translation routes](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/public_translation_router.py): `app/routers/public_translation_router.py`
- [Guide routes](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/routers/guide_router.py): `app/routers/guide_router.py`

### Guide domain

- [POI service](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/poi_service.py): `app/services/poi_service.py`
- [Translation service](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/translation_service.py): `app/services/translation_service.py`
- [Guide service](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/guide_service.py): `app/services/guide_service.py`
- [Staff management](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/admin_management_service.py): `app/services/admin_management_service.py`

### Persistence and audio

- [POI repository](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/repositaries/poi_repository.py): `app/repositaries/poi_repository.py`
- [Translation repository](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/repositaries/translation_repository.py): `app/repositaries/translation_repository.py`
- [Admin repository](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/repositaries/admin_repository.py): `app/repositaries/admin_repository.py`
- [SQL Server database](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/database.py): `app/database.py`
- [Audio service](https://github.com/lamduychuclinh19/do_an_dich_thuat/blob/main/app/services/audio_service.py): `app/services/audio_service.py`

### Other components

- **Administrator**

## Connections

- Administrator → Web app routes: uses
- Web app routes → Login page: routes to (evidence: `admin-web/src/App.jsx`)
- Web app routes → Dashboard: routes to (evidence: `admin-web/src/App.jsx`)
- Web app routes → POI management: routes to (evidence: `admin-web/src/App.jsx`)
- Web app routes → Translation management: routes to (evidence: `admin-web/src/App.jsx`)
- FastAPI application → Authentication routes: registers (evidence: `app/main.py`)
- FastAPI application → POI routes: registers (evidence: `app/main.py`)
- FastAPI application → Public POI routes: registers (evidence: `app/main.py`)
- FastAPI application → Translation routes: registers (evidence: `app/main.py`)
- FastAPI application → Public translation routes: registers (evidence: `app/main.py`)
- FastAPI application → Guide routes: registers (evidence: `app/main.py`)
- Authentication routes → Authentication service: calls (evidence: `app/routers/auth_router.py`)
- POI routes → Admin authorization: requires (evidence: `app/routers/admin_poi_router.py`)
- Translation routes → Admin authorization: requires (evidence: `app/routers/admin_translation_router.py`)
- Translation routes → Translation service: calls (evidence: `app/routers/admin_translation_router.py`)
- Public translation routes → Translation service: calls (evidence: `app/routers/public_translation_router.py`)
- Public POI routes → POI service: calls (evidence: `app/routers/public_poi_router.py`)
- Guide routes → Guide service: calls (evidence: `app/routers/guide_router.py`)
- Admin authorization → Authentication service: verifies token (evidence: `app/dependencies/auth_dependency.py`)
- Authentication service → Admin repository: reads and updates (evidence: `app/services/auth_service.py`)
- POI service → POI repository: queries (evidence: `app/services/poi_service.py`)
- Translation service → POI repository: checks POIs (evidence: `app/services/translation_service.py`)
- Translation service → Translation repository: reads and writes (evidence: `app/services/translation_service.py`)
- Translation service → Audio service: generates audio (evidence: `app/services/translation_service.py`)
- Guide service → POI service: uses (evidence: `app/services/guide_service.py`)
- Guide service → Translation service: uses (evidence: `app/services/guide_service.py`)
- Guide service → Translation repository: queries guides (evidence: `app/services/guide_service.py`)
- Staff management → Admin repository: uses (evidence: `app/services/admin_management_service.py`)
- POI repository → SQL Server database: queries (evidence: `app/repositaries/poi_repository.py`)
- Translation repository → SQL Server database: queries (evidence: `app/repositaries/translation_repository.py`)
- Admin repository → SQL Server database: queries (evidence: `app/repositaries/admin_repository.py`)
- FastAPI application → Audio service: mounts audio (evidence: `app/main.py`)
- Login page → API client: uses (evidence: `admin-web/src/pages/LoginPage.jsx`)
- Dashboard → API client: uses (evidence: `admin-web/src/pages/DashboardPage.jsx`)
- POI management → API client: uses (evidence: `admin-web/src/pages/PoiPage.jsx`)
- Translation management → API client: uses (evidence: `admin-web/src/pages/TranslationPage.jsx`)
