# prorain-hcmus/vuda-chatbot-o1 architecture

> Architecture diagram of the GitHub repository prorain-hcmus/vuda-chatbot-o1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prorain-hcmus/vuda-chatbot-o1
- Repository: https://github.com/prorain-hcmus/vuda-chatbot-o1

## Overview

##### Project type and purpose
- From the file tree and README (“VuDa-Chatbot-o1”), this is a Python-based full-stack data analytics dashboard with an integrated AI chatbot. The presence of pages/*.py, main.py, and AI_Chatbot.py strongly suggests a Streamlit (or similar) multi-page web app for exploratory data analysis (EDA), smart charts, and conversational AI.

##### File structure
- Top-level scripts:
- main.py – likely the entry point/launcher for the app
- AI_Chatbot.py – module driving the conversational interface
- Frontend (pages/):
- pages/1_🧮_Dashboard.py, 3_📂_Dataset_Details.py, 4_📊_Charts_History.py, 5_📋_EDA Report.py, 6_📈_Smart_Charts.py, 📖_About_Project.py
- Data storage:
- data/uploads/… .csv – raw datasets uploaded by users
- db.sqlite – local SQLite for metadata or session storage
- Assets:
- Reports:
- report/*.pdf, .md – generated EDA reports
- Python modules (src/):
- src/models/config.py – configuration constants (API keys, file paths)
- src/models/llms.py – LLM wrapper (e.g. OpenAI, Cohere)
- src/utils.py – shared utilities (data loading, cleaning, plotting)
- src/logger/base.py – logging setup
- Other:
- requirements.txt – dependencies list

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    User["User"]:::actor

    %% Streamlit UI
    subgraph "Streamlit UI" 
        direction TB
        PagesContainer["Pages"]:::frontend
        click PagesContainer "https://github.com/prorain-hcmus/vuda-chatbot-o1/tree/main/pages/"
        subgraph "Pages" 
            direction TB
            Dash["Dashboard"]:::frontend
            click Dash "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/pages/1_🧮_Dashboard.py"
            Dataset["Dataset Details"]:::frontend
            click Dataset "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/pages/3_📂_Dataset_Details.py"
            ChartsHist["Charts History"]:::frontend
            click ChartsHist "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/pages/4_📊_Charts_History.py"
            EDAPage["EDA Report"]:::frontend
            click EDAPage "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/pages/5_📋_EDA Report.py"
            SmartChartsPage["Smart Charts"]:::frontend
            click SmartChartsPage "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/pages/6_📈_Smart_Charts.py"
            About["About Project"]:::frontend
            click About "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/pages/📖_About_Project.py"
        end
    end

    %% Controllers
    MainApp["main.py"]:::backend
    click MainApp "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/main.py"
    AIChatCtrl["AI Chatbot Controller"]:::backend
    click AIChatCtrl "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/AI_Chatbot.py"

    %% AI Engine Modules
    LLMWrapper["LLM Wrapper"]:::ml
    click LLMWrapper "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/src/models/llms.py"
    Config["Configuration"]:::backend
    click Config "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/src/models/config.py"

    %% Utilities & Logging
    Utils["Utilities Module"]:::utility
    click Utils "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/src/utils.py"
    Logger["Logging Service"]:::utility
    click Logger "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/src/logger/base.py"

    %% Data Storage
    Uploads["Raw CSV Uploads"]:::storage
    click Uploads "https://github.com/prorain-hcmus/vuda-chatbot-o1/tree/main/data/uploads/"
    SQLiteDB["SQLite Database"]:::db
    click SQLiteDB "https://github.com/prorain-hcmus/vuda-chatbot-o1/blob/main/db.sqlite"
    Reports["EDA Reports Output"]:::storage
    click Reports "https://github.com/prorain-hcmus/vuda-chatbot-o1/tree/main/report/"
    Assets["Static Assets"]:::storage
    click Assets "https://github.com/prorain-hcmus/vuda-chatbot-o1/tree/main/assets/"

    %% EDA and Smart Charts Engines
    EDAEngine["EDA Module"]:::backend
    SmartEngine["Smart Charts Module"]:::backend

    %% External Services
    ExternalLLM["External LLM API"]:::external

    %% Connections
    User -->|"interacts with"| PagesContainer
    PagesContainer -->|"main.py launch"| MainApp
    MainApp -->|"renders pages"| PagesContainer

    PagesContainer -->|"utils.load_data()"| Utils
    Utils -->|"save CSV"| Uploads
    Utils -->|"DB ops"| SQLiteDB

    PagesContainer -->|"invoke EDA"| EDAEngine
    EDAEngine -->|"generate report"| Reports
    EDAEngine -->|"use utils.plot_*"| Utils

    PagesContainer -->|"invoke smart charts"| SmartEngine
    SmartEngine -->|"use utils.plot_*"| Utils

    PagesContainer -->|"send prompt"| AIChatCtrl
    AIChatCtrl -->|"uses llms.py"| LLMWrapper
    LLMWrapper -->|"API request"| ExternalLLM
    ExternalLLM -->|"response"| LLMWrapper
    LLMWrapper -->|"response"| AIChatCtrl
    AIChatCtrl -->|"display reply"| PagesContainer

    PagesContainer -->|"serve assets"| Assets

    %% Logging flows
    MainApp -->|"log events"| Logger
    AIChatCtrl -->|"log events"| Logger
    Utils -->|"log events"| Logger
    EDAEngine -->|"log events"| Logger
    SmartEngine -->|"log events"| Logger
    Logger -->|"writes to console/file"| SQLiteDB

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#006064,color:#006064;
    classDef backend fill:#E8F5E9,stroke:#2E7D32,color:#2E7D32;
    classDef ml fill:#FFF3E0,stroke:#EF6C00,color:#EF6C00;
    classDef utility fill:#F3E5F5,stroke:#6A1B9A,color:#6A1B9A;
    classDef storage fill:#FFFDE7,stroke:#F9A825,color:#F9A825;
    classDef db fill:#E3F2FD,stroke:#1565C0,color:#1565C0;
    classDef external fill:#FFEBEE,stroke:#C62828,color:#C62828;
    classDef actor fill:#ECEFF1,stroke:#455A64,color:#455A64;
```
