# c-edu-u/yango-kpi-master architecture

> Architecture diagram of the GitHub repository c-edu-u/yango-kpi-master, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/c-edu-u/yango-kpi-master
- Repository: https://github.com/c-edu-u/yango-kpi-master

## Overview

##### Main Components
- Django Project Core:
- YangoKpiMaster folder: Contains core configuration files (settings.py, urls.py, asgi.py, wsgi.py) and overall routing.
- manage.py: Entry point for running Django commands (migrations, server).
- Dashboard Application:
- The “dashboard” directory encapsulates the business logic, including models (Agent, WeeklyMetrics, QAEvaluation), views (for agents, weekly metrics, QA evaluations), forms, and templates.
- templates/dashboard: Provides the user-facing web pages (base layout, agents, weekly metrics, QA evaluations forms).
- Database:
- db.sqlite3 (development database used by Django for persisting data like agents, metrics, and evaluations).
- External Services & Dependencies:
- Python and Django runtime.
- Libraries such as openpyxl and pandas for processing XLSX files.
- Django Admin for internal management and data integrity.

##### Relationships and Interactions
- The Client/Browser interacts with the web server (Django) by navigating different endpoints (e.g., /agents, /weekly_metrics, /qa_evaluations).
- URL Routing:
- The project’s main urls.py delegates specific paths to the dashboard app’s urls.py.
- Request Flow:
- User requests hit views in the dashboard module which invoke forms processing and model interactions.
- Uploaded XLSX files are processed, data is validated, and then stored in the SQLite database.
- Administration:
- Django Admin (configured via admin.py in the dashboard app) provides a backdoor for managing records directly through a dedicated interface.

##### Architectural Patterns & Design Principles
- The application follows Django’s MVT (Model-View-Template) pattern:
- Model: Defined in dashboard/models.py.
- View: Handled in dashboard/views.py along with forms in dashboard/forms.py.
- Template: HTML templates within dashboard/templates/dashboard.
- Separation of Concerns:
- The split between the core (YangoKpiMaster) and the application-specific module (dashboard) emphasizes modularity.
- Data Integrity:
- Emphasis on linking agents, metrics, and evaluations ensures the data relationships are properly maintained.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        Browser["Web Browser (Client)"]:::client
    end

    subgraph "Application Layer"
        DjangoCore["Django Project Core (YangoKpiMaster & manage.py)"]:::core
        DashboardApp["Dashboard Application (Models,Views,Forms,Templates)"]:::dashboard
        DjangoAdmin["Django Admin Interface"]:::dashboard
        XLSXProc["XLSX Processing & External Dependencies"]:::xlsx
    end

    subgraph "Data Layer"
        Database["Database (SQLite)"]:::database
    end

    Browser -->|"HTTP_Request"| DjangoCore
    DjangoCore -->|"URL_Routing"| DashboardApp
    DjangoCore -->|"Admin_Routing"| DjangoAdmin
    DashboardApp -->|"Process_File_Uploads"| XLSXProc
    DashboardApp -->|"CRUD_Operations"| Database
    DjangoAdmin -->|"Manage_Data"| Database
    XLSXProc -->|"Save_Processed_Data"| Database
    DashboardApp -->|"Render_Pages"| Browser

    click DjangoCore "https://github.com/c-edu-u/yango-kpi-master/tree/master/YangoKpiMaster/"
    click DjangoCore "https://github.com/c-edu-u/yango-kpi-master/blob/master/manage.py"
    click DashboardApp "https://github.com/c-edu-u/yango-kpi-master/tree/master/dashboard/"
    click DjangoAdmin "https://github.com/c-edu-u/yango-kpi-master/blob/master/dashboard/admin.py"
    click XLSXProc "https://github.com/c-edu-u/yango-kpi-master/blob/master/requirements.txt"
    click Database "https://github.com/c-edu-u/yango-kpi-master/blob/master/db.sqlite3"

    classDef core fill:#99ccff,stroke:#000,stroke-width:2px;
    classDef dashboard fill:#ccffcc,stroke:#000,stroke-width:2px;
    classDef xlsx fill:#ffcc99,stroke:#000,stroke-width:2px;
    classDef database fill:#e0e0e0,stroke:#000,stroke-width:2px;
    classDef client fill:#d1eaff,stroke:#000,stroke-width:2px;
```
