# danielhassan-dev/apap architecture

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

- Interactive diagram: https://gitdiagram.com/danielhassan-dev/apap
- Repository: https://github.com/danielhassan-dev/apap

## Overview

CAPAS is a Django academic-performance analytics system. Staff manage student and admission data, submit entry scores for CGPA and risk predictions, and review prediction history and analytics. CSV import and model retraining provide a second path for updating the data and prediction model. The graph includes the documented dashboard, student, audit-log, model-information, and upload capabilities. Some view and training code was only excerpted, so unverified runtime links are omitted.

Main entry points: [`capas_project/core/views.py`](https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/views.py) (Web workflows), [`capas_project/core/models.py`](https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/models.py) (Academic records), [`capas_project/ml_pipeline/train_model.py`](https://github.com/danielhassan-dev/apap/blob/main/capas_project/ml_pipeline/train_model.py) (Training pipeline), [`capas_project/capas_project/urls.py`](https://github.com/danielhassan-dev/apap/blob/main/capas_project/capas_project/urls.py) (Project routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Project routing<br/>[urls.py]"]
  node_core_routes["CAPAS routes<br/>[urls.py]"]
  node_views["Web workflows<br/>[views.py]"]
  node_forms["Input validation<br/>[forms.py]"]
  node_admin["Admin console<br/>[admin.py]"]
end

subgraph group_domain["Academic records"]
  node_records["Academic records<br/>[models.py]"]
  node_database[("Relational database<br/>[settings.py]")]
end

subgraph group_ml["Prediction and training"]
  node_trainer["Training pipeline<br/>[train_model.py]"]
  node_historical_csv["Historical student data"]
  node_model_metadata["Model metadata<br/>[capas_lr_v1.0.json]"]
end

subgraph group_presentation["User interface"]
  node_dashboard["Dashboard and analytics<br/>[dashboard.html]"]
  node_student_pages["Student pages<br/>[students.html]"]
  node_prediction_pages["Prediction form and result<br/>[predict.html]"]
  node_audit_pages["Prediction audit log"]
  node_model_page["Model information<br/>[model_info.html]"]
  node_upload_page["CSV upload<br/>[upload_data.html]"]
end

node_staff(("Staff user"))

node_staff -.->|"uses"| node_routes
node_routes -.->|"routes to"| node_core_routes
node_core_routes -->|"dispatches"| node_views
node_views -->|"uses"| node_forms
node_views -->|"queries and updates"| node_records
node_forms -->|"validates"| node_records
node_admin -->|"manages"| node_records
node_records -.->|"persists"| node_database
node_views -.->|"renders"| node_dashboard
node_views -.->|"renders"| node_student_pages
node_views -.->|"renders"| node_prediction_pages
node_views -.->|"renders"| node_audit_pages
node_views -->|"renders"| node_model_page
node_views -.->|"renders"| node_upload_page
node_trainer -->|"trains from"| node_historical_csv
node_trainer -->|"syncs scores"| node_records
node_trainer -->|"writes metadata"| node_model_metadata
node_views -->|"reads metadata"| node_model_metadata

click node_routes "https://github.com/danielhassan-dev/apap/blob/main/capas_project/capas_project/urls.py"
click node_core_routes "https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/urls.py"
click node_views "https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/views.py"
click node_forms "https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/forms.py"
click node_admin "https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/admin.py"
click node_records "https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/models.py"
click node_database "https://github.com/danielhassan-dev/apap/blob/main/capas_project/capas_project/settings.py"
click node_dashboard "https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/dashboard.html"
click node_student_pages "https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/students.html"
click node_prediction_pages "https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/predict.html"
click node_audit_pages "https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/prediction_log.html"
click node_model_page "https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/model_info.html"
click node_upload_page "https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/upload_data.html"
click node_trainer "https://github.com/danielhassan-dev/apap/blob/main/capas_project/ml_pipeline/train_model.py"
click node_historical_csv "https://github.com/danielhassan-dev/apap/blob/main/capas_project/data/historical_students.csv"
click node_model_metadata "https://github.com/danielhassan-dev/apap/blob/main/capas_project/ml_models/capas_lr_v1.0.json"

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_routes,node_core_routes,node_views,node_forms,node_admin,node_staff toneBlue
class node_records,node_database toneAmber
class node_trainer,node_historical_csv,node_model_metadata toneMint
class node_dashboard,node_student_pages,node_prediction_pages,node_audit_pages,node_model_page,node_upload_page toneRose
```

## Components

### Web application

- [Project routing](https://github.com/danielhassan-dev/apap/blob/main/capas_project/capas_project/urls.py): `capas_project/capas_project/urls.py`
- [CAPAS routes](https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/urls.py): `capas_project/core/urls.py`
- [Web workflows](https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/views.py): `capas_project/core/views.py`
- [Input validation](https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/forms.py): `capas_project/core/forms.py`
- [Admin console](https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/admin.py): `capas_project/core/admin.py`

### Academic records

- [Academic records](https://github.com/danielhassan-dev/apap/blob/main/capas_project/core/models.py): `capas_project/core/models.py`
- [Relational database](https://github.com/danielhassan-dev/apap/blob/main/capas_project/capas_project/settings.py): `capas_project/capas_project/settings.py`

### Prediction and training

- [Training pipeline](https://github.com/danielhassan-dev/apap/blob/main/capas_project/ml_pipeline/train_model.py): `capas_project/ml_pipeline/train_model.py`
- [Historical student data](https://github.com/danielhassan-dev/apap/blob/main/capas_project/data/historical_students.csv): `capas_project/data/historical_students.csv`
- [Model metadata](https://github.com/danielhassan-dev/apap/blob/main/capas_project/ml_models/capas_lr_v1.0.json): `capas_project/ml_models/capas_lr_v1.0.json`

### User interface

- [Dashboard and analytics](https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/dashboard.html): `capas_project/templates/core/dashboard.html`
- [Student pages](https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/students.html): `capas_project/templates/core/students.html`
- [Prediction form and result](https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/predict.html): `capas_project/templates/core/predict.html`
- [Prediction audit log](https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/prediction_log.html): `capas_project/templates/core/prediction_log.html`
- [Model information](https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/model_info.html): `capas_project/templates/core/model_info.html`
- [CSV upload](https://github.com/danielhassan-dev/apap/blob/main/capas_project/templates/core/upload_data.html): `capas_project/templates/core/upload_data.html`

### Other components

- **Staff user**

## Connections

- Staff user → Project routing: uses
- Project routing → CAPAS routes: routes to
- CAPAS routes → Web workflows: dispatches (evidence: `capas_project/core/urls.py`)
- Web workflows → Input validation: uses (evidence: `capas_project/core/views.py`)
- Web workflows → Academic records: queries and updates (evidence: `capas_project/core/views.py`)
- Input validation → Academic records: validates (evidence: `capas_project/core/forms.py`)
- Admin console → Academic records: manages (evidence: `capas_project/core/admin.py`)
- Academic records → Relational database: persists
- Web workflows → Dashboard and analytics: renders
- Web workflows → Student pages: renders
- Web workflows → Prediction form and result: renders
- Web workflows → Prediction audit log: renders
- Web workflows → Model information: renders (evidence: `capas_project/core/views.py`)
- Web workflows → CSV upload: renders
- Training pipeline → Historical student data: trains from (evidence: `README.md`)
- Training pipeline → Academic records: syncs scores (evidence: `capas_project/ml_pipeline/train_model.py`)
- Training pipeline → Model metadata: writes metadata
- Web workflows → Model metadata: reads metadata
