# lnnam123/project_24ct1_lenhatnam architecture

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

- Interactive diagram: https://gitdiagram.com/lnnam123/project_24ct1_lenhatnam
- Repository: https://github.com/lnnam123/project_24ct1_lenhatnam

## Overview

CoinTap combines a Flutter personal-finance mobile app with a React administration portal. The documented mobile workflow covers authentication, recording and transferring money, budgeting and analyzing finances, with Gemini assistance; the portal workflow is administrator login, dashboard monitoring, then managing users, categories, AI records and broadcasts. The supplied tree and excerpts expose the portal but not the mobile source, so mobile capabilities and integrations are represented from the README without inferred implementation links. The desktop runner files are platform shells, not domain components.

Main entry points: [`web_admin/src/App.jsx`](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/App.jsx) (Admin portal), [`web_admin/src/dich_vu/api.js`](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/dich_vu/api.js) (Admin data API), [`web_admin/src/dich_vu/supabase.js`](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/dich_vu/supabase.js) (Supabase client), [`web_admin/src/man_hinh/NhatKyAI.jsx`](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/NhatKyAI.jsx) (AI usage logs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin_app["Admin application"]
  node_admin["Admin portal<br/>[App.jsx]"]
  node_login["Admin login<br/>[DangNhap.jsx]"]
end

subgraph group_admin_ops["Administration"]
  node_dashboard["System dashboard<br/>[TongQuan.jsx]"]
  node_users["User management<br/>[NguoiDung.jsx]"]
  node_admins["Admin management<br/>[QuanTriVien.jsx]"]
  node_categories["Category management<br/>[DanhMuc.jsx]"]
  node_ai_logs["AI usage logs<br/>[NhatKyAI.jsx]"]
  node_notifications["System broadcasts<br/>[ThongBao.jsx]"]
end

subgraph group_shared_services["Admin data services"]
  node_api["Admin data API<br/>[api.js]"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_database[("Supabase database")]
  node_supabase_auth["Supabase Auth"]
end

subgraph group_mobile_product["Mobile finance product"]
  node_mobile["CoinTap mobile"]
  node_finance["Finance tracking"]
  node_budget_reports["Budgets and reports"]
  node_mobile_ai["Mobile AI assistant"]
  node_mobile_auth["Mobile authentication"]
end

node_gemini["Gemini API"]
node_keystream["KeyStream metrics"]
node_ota["GitHub OTA releases"]
node_mailer["OTP mail service"]

node_admin -->|"shows when signed out"| node_login
node_admin -->|"routes to"| node_dashboard
node_admin -->|"routes to"| node_users
node_admin -->|"routes to"| node_admins
node_admin -->|"routes to"| node_categories
node_admin -->|"routes to"| node_ai_logs
node_admin -->|"routes to"| node_notifications
node_admin -->|"signs out through"| node_supabase_client
node_login -->|"authenticates through"| node_supabase_client
node_dashboard -->|"requests metrics"| node_api
node_users -->|"manages users"| node_api
node_admins -->|"manages admins"| node_api
node_categories -->|"manages categories"| node_api
node_ai_logs -->|"loads and deletes sessions"| node_api
node_notifications -->|"manages broadcasts"| node_api
node_api -->|"queries through"| node_supabase_client
node_supabase_client -->|"accesses"| node_database
node_supabase_client -->|"uses"| node_supabase_auth
node_api -->|"fetches local metrics"| node_keystream
node_api -->|"checks model API"| node_gemini
node_mobile -->|"supports"| node_finance
node_mobile -->|"supports"| node_budget_reports
node_mobile -->|"offers"| node_mobile_ai
node_mobile -->|"authenticates with"| node_mobile_auth
node_mobile -->|"syncs with"| node_database
node_mobile -->|"authenticates through"| node_supabase_auth
node_mobile_ai -->|"sends prompts"| node_gemini
node_mobile_auth -->|"sends OTP via"| node_mailer
node_mobile -->|"checks and downloads updates"| node_ota
node_ai_logs -.->|"monitors usage"| node_gemini

click node_admin "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/App.jsx"
click node_login "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/DangNhap.jsx"
click node_dashboard "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/TongQuan.jsx"
click node_users "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/NguoiDung.jsx"
click node_admins "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/QuanTriVien.jsx"
click node_categories "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/DanhMuc.jsx"
click node_ai_logs "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/NhatKyAI.jsx"
click node_notifications "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/ThongBao.jsx"
click node_api "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/dich_vu/api.js"
click node_supabase_client "https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/dich_vu/supabase.js"

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_admin,node_login toneBlue
class node_dashboard,node_users,node_admins,node_categories,node_ai_logs,node_notifications toneAmber
class node_api,node_supabase_client,node_database,node_supabase_auth,node_gemini toneMint
class node_mobile,node_finance,node_budget_reports,node_mobile_ai,node_mobile_auth toneRose
class node_keystream,node_ota,node_mailer toneIndigo
```

## Components

### Admin application

- [Admin portal](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/App.jsx): `web_admin/src/App.jsx`
- [Admin login](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/DangNhap.jsx): `web_admin/src/man_hinh/DangNhap.jsx`

### Administration

- [System dashboard](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/TongQuan.jsx): `web_admin/src/man_hinh/TongQuan.jsx`
- [User management](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/NguoiDung.jsx): `web_admin/src/man_hinh/NguoiDung.jsx`
- [Admin management](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/QuanTriVien.jsx): `web_admin/src/man_hinh/QuanTriVien.jsx`
- [Category management](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/DanhMuc.jsx): `web_admin/src/man_hinh/DanhMuc.jsx`
- [AI usage logs](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/NhatKyAI.jsx): `web_admin/src/man_hinh/NhatKyAI.jsx`
- [System broadcasts](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/man_hinh/ThongBao.jsx): `web_admin/src/man_hinh/ThongBao.jsx`

### Admin data services

- [Admin data API](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/dich_vu/api.js): `web_admin/src/dich_vu/api.js`
- [Supabase client](https://github.com/lnnam123/project_24ct1_lenhatnam/blob/main/web_admin/src/dich_vu/supabase.js): `web_admin/src/dich_vu/supabase.js`
- **Supabase database**
- **Supabase Auth**

### Mobile finance product

- **CoinTap mobile**
- **Finance tracking**
- **Budgets and reports**
- **Mobile AI assistant**
- **Mobile authentication**

### Other components

- **Gemini API**
- **KeyStream metrics**
- **GitHub OTA releases**
- **OTP mail service**

## Connections

- Admin portal → Admin login: shows when signed out (evidence: `web_admin/src/App.jsx`)
- Admin portal → System dashboard: routes to (evidence: `web_admin/src/App.jsx`)
- Admin portal → User management: routes to (evidence: `web_admin/src/App.jsx`)
- Admin portal → Admin management: routes to (evidence: `web_admin/src/App.jsx`)
- Admin portal → Category management: routes to (evidence: `web_admin/src/App.jsx`)
- Admin portal → AI usage logs: routes to (evidence: `web_admin/src/App.jsx`)
- Admin portal → System broadcasts: routes to (evidence: `web_admin/src/App.jsx`)
- Admin portal → Supabase client: signs out through (evidence: `web_admin/src/App.jsx`)
- Admin login → Supabase client: authenticates through (evidence: `web_admin/src/man_hinh/DangNhap.jsx`)
- System dashboard → Admin data API: requests metrics (evidence: `web_admin/src/man_hinh/TongQuan.jsx`)
- User management → Admin data API: manages users (evidence: `web_admin/src/man_hinh/NguoiDung.jsx`)
- Admin management → Admin data API: manages admins (evidence: `web_admin/src/man_hinh/QuanTriVien.jsx`)
- Category management → Admin data API: manages categories (evidence: `web_admin/src/man_hinh/DanhMuc.jsx`)
- AI usage logs → Admin data API: loads and deletes sessions (evidence: `web_admin/src/man_hinh/NhatKyAI.jsx`)
- System broadcasts → Admin data API: manages broadcasts (evidence: `web_admin/src/man_hinh/ThongBao.jsx`)
- Admin data API → Supabase client: queries through (evidence: `web_admin/src/dich_vu/api.js`)
- Supabase client → Supabase database: accesses
- Supabase client → Supabase Auth: uses
- Admin data API → KeyStream metrics: fetches local metrics (evidence: `web_admin/src/dich_vu/api.js`)
- Admin data API → Gemini API: checks model API (evidence: `web_admin/src/dich_vu/api.js`)
- CoinTap mobile → Finance tracking: supports
- CoinTap mobile → Budgets and reports: supports
- CoinTap mobile → Mobile AI assistant: offers
- CoinTap mobile → Mobile authentication: authenticates with
- CoinTap mobile → Supabase database: syncs with
- CoinTap mobile → Supabase Auth: authenticates through
- Mobile AI assistant → Gemini API: sends prompts
- Mobile authentication → OTP mail service: sends OTP via
- CoinTap mobile → GitHub OTA releases: checks and downloads updates
- AI usage logs → Gemini API: monitors usage
