# maihan88/nhom5-ngan-hang architecture

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

- Interactive diagram: https://gitdiagram.com/maihan88/nhom5-ngan-hang
- Repository: https://github.com/maihan88/nhom5-ngan-hang

## Overview

UpBank! is a Streamlit financial-analysis product for eight listed Vietnamese banks. Its main workflow collects and cleans quarterly financial, price, and event data; produces statistical analyses and machine-learning results; then presents the data and results in a web bulletin. The README documents the stages and handoff, while source-index references and excerpts support selected internal calls. Some dashboard pages and pipeline details are unsampled, so their connections are limited to documented relationships.

Main entry points: [`dashboard/web/du_lieu.py`](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/du_lieu.py) (Web data facade), [`Quan/dataset_nhom5/src/run_pipeline.py`](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/run_pipeline.py) (ML pipeline), [`chay_tat_ca.py`](https://github.com/maihan88/nhom5-ngan-hang/blob/main/chay_tat_ca.py) (Project pipeline), [`Han/PTDL_3/run_pipeline.py`](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/run_pipeline.py) (Crawler runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_orchestrator["Project pipeline<br/>[chay_tat_ca.py]"]
  node_crawler_entry["Crawler runner<br/>[run_pipeline.py]"]
  node_http_client["HTTP and cache<br/>[http_client.py]"]
  node_financials["Financial statements<br/>[financials.py]"]
  node_prices["Bank prices<br/>[prices.py]"]
  node_events["News and events<br/>[events.py]"]
  node_dataset_build["Dataset assembly<br/>[build.py]"]
end

subgraph group_statistics["Statistical analysis"]
  node_stats_loader["Analysis data loader<br/>[data_loader.py]"]
  node_stats_config["Analysis conventions<br/>[config.py]"]
  node_descriptive_stats["Descriptive statistics<br/>[thong_ke.py]"]
  node_stat_visuals["Analysis visualizations<br/>[viz.py]"]
end

subgraph group_machine_learning["Machine learning"]
  node_ml_runner["ML pipeline<br/>[run_pipeline.py]"]
  node_ml_validation["Data readiness<br/>[data_validation.py]"]
  node_logistic["Trend prediction<br/>[logistic_model.py]"]
  node_clustering["Bank clustering<br/>[clustering.py]"]
  node_ml_utils["ML data utilities<br/>[utils.py]"]
end

subgraph group_dashboard_data["Dashboard data"]
  node_dashboard_loader["Dashboard data access<br/>[data_loader.py]"]
  node_dashboard_stats["Dashboard statistics<br/>[thong_ke.py]"]
  node_web_data["Web data facade<br/>[du_lieu.py]"]
end

subgraph group_dashboard_ui["Dashboard experience"]
  node_dashboard_app["Streamlit entry<br/>[app.py]"]
  node_web_ui["Page presentation<br/>[giao_dien.py]"]
  node_charts["Interactive charts<br/>[bieu_do.py]"]
  node_models_web["Web models<br/>[mo_hinh.py]"]
  node_bulletin["News bulletin<br/>[ban_tin.py]"]
  node_forecast_page["Forecast page<br/>[du_bao.py]"]
  node_bank_page["Bank profiles<br/>[ngan_hang.py]"]
  node_groups_page["Cluster page<br/>[phan_nhom.py]"]
  node_methods_page["Methods page<br/>[phuong_phap.py]"]
  node_compare_page["Comparison page<br/>[so_sanh.py]"]
end

node_operator(("Research operator"))
node_market_sources(("Financial and news sources"))
node_streamlit_user(("Dashboard reader"))

node_operator -->|"runs stages"| node_orchestrator
node_orchestrator -->|"runs collection"| node_crawler_entry
node_orchestrator -->|"runs analysis"| node_stats_loader
node_orchestrator -->|"runs modeling"| node_ml_runner
node_orchestrator -->|"opens web"| node_dashboard_app
node_crawler_entry -->|"creates client"| node_http_client
node_crawler_entry -->|"builds statements"| node_financials
node_crawler_entry -->|"builds prices"| node_prices
node_crawler_entry -->|"builds events"| node_events
node_crawler_entry -->|"assembles tables"| node_dataset_build
node_financials -->|"requests source data"| node_http_client
node_financials -.->|"fetches statements"| node_market_sources
node_prices -->|"requests price data"| node_http_client
node_prices -.->|"fetches prices"| node_market_sources
node_events -->|"requests news"| node_http_client
node_events -.->|"fetches news"| node_market_sources
node_financials -->|"supplies statements"| node_dataset_build
node_prices -->|"supplies prices"| node_dataset_build
node_events -->|"supplies events"| node_dataset_build
node_dataset_build -->|"exports CSV data"| node_stats_loader
node_stats_loader -->|"uses conventions"| node_stats_config
node_descriptive_stats -->|"uses conventions"| node_stats_config
node_stat_visuals -->|"uses conventions"| node_stats_config
node_stat_visuals -->|"loads analysis data"| node_stats_loader
node_stats_loader -.->|"provides analysis inputs"| node_ml_runner
node_orchestrator -->|"runs ML stage"| node_ml_runner
node_ml_runner -->|"validates readiness"| node_ml_validation
node_ml_runner -->|"trains prediction"| node_logistic
node_ml_runner -->|"computes clusters"| node_clustering
node_ml_runner -->|"uses utilities"| node_ml_utils
node_ml_validation -->|"uses utilities"| node_ml_utils
node_logistic -->|"uses utilities"| node_ml_utils
node_clustering -->|"uses utilities"| node_ml_utils
node_ml_runner -->|"publishes ML results"| node_web_data
node_stats_loader -->|"shares data conventions"| node_dashboard_loader
node_web_data -->|"loads source tables"| node_dashboard_loader
node_web_data -->|"computes indicators"| node_dashboard_stats
node_web_data -->|"loads web models"| node_models_web
node_dashboard_loader -->|"provides analysis data"| node_dashboard_stats
node_dashboard_app -->|"initializes presentation"| node_web_ui
node_bulletin -->|"reads content data"| node_web_data
node_forecast_page -->|"reads forecast data"| node_web_data
node_bank_page -->|"reads bank data"| node_web_data
node_compare_page -->|"reads comparisons"| node_web_data
node_methods_page -->|"reads method data"| node_web_data
node_forecast_page -->|"uses predictions"| node_models_web
node_bank_page -->|"uses bank models"| node_models_web
node_compare_page -->|"uses model results"| node_models_web

click node_orchestrator "https://github.com/maihan88/nhom5-ngan-hang/blob/main/chay_tat_ca.py"
click node_crawler_entry "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/run_pipeline.py"
click node_http_client "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/http_client.py"
click node_financials "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/financials.py"
click node_prices "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/prices.py"
click node_events "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/events.py"
click node_dataset_build "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/build.py"
click node_stats_loader "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/data_loader.py"
click node_stats_config "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/config.py"
click node_descriptive_stats "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/thong_ke.py"
click node_stat_visuals "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/viz.py"
click node_ml_runner "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/run_pipeline.py"
click node_ml_validation "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/data_validation.py"
click node_logistic "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/logistic_model.py"
click node_clustering "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/clustering.py"
click node_ml_utils "https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/utils.py"
click node_dashboard_loader "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/src/data_loader.py"
click node_dashboard_stats "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/src/thong_ke.py"
click node_web_data "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/du_lieu.py"
click node_dashboard_app "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/app.py"
click node_web_ui "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/giao_dien.py"
click node_charts "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/bieu_do.py"
click node_models_web "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/mo_hinh.py"
click node_bulletin "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/ban_tin.py"
click node_forecast_page "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/du_bao.py"
click node_bank_page "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/ngan_hang.py"
click node_groups_page "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/phan_nhom.py"
click node_methods_page "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/phuong_phap.py"
click node_compare_page "https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/so_sanh.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_orchestrator,node_crawler_entry,node_http_client,node_financials,node_prices,node_events,node_dataset_build toneBlue
class node_stats_loader,node_stats_config,node_descriptive_stats,node_stat_visuals toneAmber
class node_ml_runner,node_ml_validation,node_logistic,node_clustering,node_ml_utils toneMint
class node_dashboard_loader,node_dashboard_stats,node_web_data toneRose
class node_dashboard_app,node_web_ui,node_charts,node_models_web,node_bulletin,node_forecast_page,node_bank_page,node_groups_page,node_methods_page,node_compare_page,node_operator,node_market_sources,node_streamlit_user toneIndigo
```

## Components

### Data collection

- [Project pipeline](https://github.com/maihan88/nhom5-ngan-hang/blob/main/chay_tat_ca.py): `chay_tat_ca.py`
- [Crawler runner](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/run_pipeline.py): `Han/PTDL_3/run_pipeline.py`
- [HTTP and cache](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/http_client.py): `Han/PTDL_3/crawler/http_client.py`
- [Financial statements](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/financials.py): `Han/PTDL_3/crawler/financials.py`
- [Bank prices](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/prices.py): `Han/PTDL_3/crawler/prices.py`
- [News and events](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/events.py): `Han/PTDL_3/crawler/events.py`
- [Dataset assembly](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Han/PTDL_3/crawler/build.py): `Han/PTDL_3/crawler/build.py`

### Statistical analysis

- [Analysis data loader](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/data_loader.py): `Nghi/Nhóm5-PTDL/src/data_loader.py`
- [Analysis conventions](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/config.py): `Nghi/Nhóm5-PTDL/src/config.py`
- [Descriptive statistics](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/thong_ke.py): `Nghi/Nhóm5-PTDL/src/thong_ke.py`
- [Analysis visualizations](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Nghi/Nh%C3%B3m5-PTDL/src/viz.py): `Nghi/Nhóm5-PTDL/src/viz.py`

### Machine learning

- [ML pipeline](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/run_pipeline.py): `Quan/dataset_nhom5/src/run_pipeline.py`
- [Data readiness](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/data_validation.py): `Quan/dataset_nhom5/src/data_validation.py`
- [Trend prediction](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/logistic_model.py): `Quan/dataset_nhom5/src/logistic_model.py`
- [Bank clustering](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/clustering.py): `Quan/dataset_nhom5/src/clustering.py`
- [ML data utilities](https://github.com/maihan88/nhom5-ngan-hang/blob/main/Quan/dataset_nhom5/src/utils.py): `Quan/dataset_nhom5/src/utils.py`

### Dashboard data

- [Dashboard data access](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/src/data_loader.py): `dashboard/src/data_loader.py`
- [Dashboard statistics](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/src/thong_ke.py): `dashboard/src/thong_ke.py`
- [Web data facade](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/du_lieu.py): `dashboard/web/du_lieu.py`

### Dashboard experience

- [Streamlit entry](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/app.py): `dashboard/app.py`
- [Page presentation](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/giao_dien.py): `dashboard/web/giao_dien.py`
- [Interactive charts](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/bieu_do.py): `dashboard/web/bieu_do.py`
- [Web models](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/web/mo_hinh.py): `dashboard/web/mo_hinh.py`
- [News bulletin](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/ban_tin.py): `dashboard/trang/ban_tin.py`
- [Forecast page](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/du_bao.py): `dashboard/trang/du_bao.py`
- [Bank profiles](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/ngan_hang.py): `dashboard/trang/ngan_hang.py`
- [Cluster page](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/phan_nhom.py): `dashboard/trang/phan_nhom.py`
- [Methods page](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/phuong_phap.py): `dashboard/trang/phuong_phap.py`
- [Comparison page](https://github.com/maihan88/nhom5-ngan-hang/blob/main/dashboard/trang/so_sanh.py): `dashboard/trang/so_sanh.py`

### Other components

- **Research operator**
- **Financial and news sources**
- **Dashboard reader**

## Connections

- Research operator → Project pipeline: runs stages
- Project pipeline → Crawler runner: runs collection
- Project pipeline → Analysis data loader: runs analysis
- Project pipeline → ML pipeline: runs modeling
- Project pipeline → Streamlit entry: opens web
- Crawler runner → HTTP and cache: creates client (evidence: `Han/PTDL_3/run_pipeline.py`)
- Crawler runner → Financial statements: builds statements (evidence: `Han/PTDL_3/run_pipeline.py`)
- Crawler runner → Bank prices: builds prices (evidence: `Han/PTDL_3/run_pipeline.py`)
- Crawler runner → News and events: builds events (evidence: `Han/PTDL_3/run_pipeline.py`)
- Crawler runner → Dataset assembly: assembles tables (evidence: `Han/PTDL_3/run_pipeline.py`)
- Financial statements → HTTP and cache: requests source data (evidence: `Han/PTDL_3/crawler/financials.py`)
- Financial statements → Financial and news sources: fetches statements
- Bank prices → HTTP and cache: requests price data (evidence: `Han/PTDL_3/crawler/prices.py`)
- Bank prices → Financial and news sources: fetches prices
- News and events → HTTP and cache: requests news (evidence: `Han/PTDL_3/crawler/events.py`)
- News and events → Financial and news sources: fetches news
- Financial statements → Dataset assembly: supplies statements (evidence: `Han/PTDL_3/run_pipeline.py`)
- Bank prices → Dataset assembly: supplies prices (evidence: `Han/PTDL_3/run_pipeline.py`)
- News and events → Dataset assembly: supplies events (evidence: `Han/PTDL_3/run_pipeline.py`)
- Dataset assembly → Analysis data loader: exports CSV data
- Analysis data loader → Analysis conventions: uses conventions (evidence: `Nghi/Nhóm5-PTDL/src/data_loader.py`)
- Descriptive statistics → Analysis conventions: uses conventions (evidence: `Nghi/Nhóm5-PTDL/src/thong_ke.py`)
- Analysis visualizations → Analysis conventions: uses conventions (evidence: `Nghi/Nhóm5-PTDL/src/viz.py`)
- Analysis visualizations → Analysis data loader: loads analysis data (evidence: `Nghi/Nhóm5-PTDL/src/viz.py`)
- Analysis data loader → ML pipeline: provides analysis inputs
- Project pipeline → ML pipeline: runs ML stage (evidence: `Quan/dataset_nhom5/src/run_pipeline.py`)
- ML pipeline → Data readiness: validates readiness (evidence: `Quan/dataset_nhom5/src/run_pipeline.py`)
- ML pipeline → Trend prediction: trains prediction (evidence: `Quan/dataset_nhom5/src/run_pipeline.py`)
- ML pipeline → Bank clustering: computes clusters (evidence: `Quan/dataset_nhom5/src/run_pipeline.py`)
- ML pipeline → ML data utilities: uses utilities (evidence: `Quan/dataset_nhom5/src/run_pipeline.py`)
- Data readiness → ML data utilities: uses utilities (evidence: `Quan/dataset_nhom5/src/data_validation.py`)
- Trend prediction → ML data utilities: uses utilities (evidence: `Quan/dataset_nhom5/src/logistic_model.py`)
- Bank clustering → ML data utilities: uses utilities (evidence: `Quan/dataset_nhom5/src/clustering.py`)
- ML pipeline → Web data facade: publishes ML results
- Analysis data loader → Dashboard data access: shares data conventions (evidence: `Nghi/Nhóm5-PTDL/src/data_loader.py`)
- Web data facade → Dashboard data access: loads source tables (evidence: `dashboard/web/du_lieu.py`)
- Web data facade → Dashboard statistics: computes indicators (evidence: `dashboard/web/du_lieu.py`)
- Web data facade → Web models: loads web models (evidence: `dashboard/web/du_lieu.py`)
- Dashboard data access → Dashboard statistics: provides analysis data (evidence: `dashboard/web/du_lieu.py`)
- Streamlit entry → Page presentation: initializes presentation (evidence: `dashboard/app.py`)
- News bulletin → Web data facade: reads content data (evidence: `dashboard/trang/ban_tin.py`)
- Forecast page → Web data facade: reads forecast data (evidence: `dashboard/trang/du_bao.py`)
- Bank profiles → Web data facade: reads bank data (evidence: `dashboard/trang/ngan_hang.py`)
- Comparison page → Web data facade: reads comparisons (evidence: `dashboard/trang/so_sanh.py`)
- Methods page → Web data facade: reads method data (evidence: `dashboard/trang/phuong_phap.py`)
- Forecast page → Web models: uses predictions (evidence: `dashboard/trang/du_bao.py`)
- Bank profiles → Web models: uses bank models (evidence: `dashboard/trang/ngan_hang.py`)
- Comparison page → Web models: uses model results (evidence: `dashboard/trang/so_sanh.py`)
