# cosmos-junior/synthetic-student-data architecture

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

- Interactive diagram: https://gitdiagram.com/cosmos-junior/synthetic-student-data
- Repository: https://github.com/cosmos-junior/synthetic-student-data

## Overview

This is a privacy-aware synthetic student-data platform: authorized users upload and review datasets, configure experiments, generate synthetic records, evaluate fidelity, empirical privacy risk and downstream ML utility, then inspect or export results. The React dashboard communicates with a Django API; persistent dataset and job records support asynchronous work and reporting. The README documents the major model and evaluation capabilities, while the sampled backend generation workflow and core module references establish key internal links. Some frontend-to-API and unsampled subsystem relationships are shown as unverified; unsampled source was not inspected.

Main entry points: [`backend/datasets/services/generation_service.py`](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/generation_service.py) (Generation orchestration), [`frontend/src/App.tsx`](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/App.tsx) (Dashboard routes), [`backend/datasets/views.py`](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/views.py) (REST endpoints), [`frontend/src/api.ts`](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["User dashboard"]
  node_dashboard_app["Dashboard routes<br/>[App.tsx]"]
  node_dataset_pages["Dataset management<br/>[DatasetsPage.tsx]"]
  node_upload_page["Dataset upload"]
  node_explorer_page["Dataset explorer"]
  node_generation_page["Experiment generation<br/>[GeneratePage.tsx]"]
  node_evaluation_page["Evaluation dashboard<br/>[EvaluationPage.tsx]"]
  node_utility_page["ML utility dashboard<br/>[MlUtilityPage.tsx]"]
  node_reports_page["Reports and export<br/>[ReportsPage.tsx]"]
  node_frontend_api["API client<br/>[api.ts]"]
end

subgraph group_api["API and persistence"]
  node_api_views["REST endpoints<br/>[views.py]"]
  node_records[("Datasets and jobs<br/>[models.py]")]
  node_task_queue["Background tasks<br/>[tasks.py]"]
end

subgraph group_workflow["Dataset workflow"]
  node_ingestion["Dataset ingestion<br/>[dataset_service.py]"]
  node_profile["Profiling and metadata<br/>[profiling.py]"]
  node_schema["Schema analysis<br/>[schema.py]"]
  node_validation["Data validation<br/>[validation.py]"]
  node_preprocessing["Preprocessing"]
end

subgraph group_synthesis["Synthesis pipeline"]
  node_metadata_config["SDV metadata"]
  node_generation_service["Generation orchestration"]
  node_generation_utils["Generation utilities"]
  node_model_generation["Synthesis models<br/>[generate_ctgan.py]"]
end

subgraph group_assessment["Evaluation and reporting"]
  node_evaluation_service["Evaluation orchestration"]
  node_evaluation_core["Fidelity and ML evaluation<br/>[evaluate_models.py]"]
  node_privacy["Privacy risk assessment"]
  node_fidelity["Statistical fidelity"]
  node_ml_utility["TRTR and TSTR utility"]
  node_report["PDF reporting<br/>[report_service.py]"]
end

node_user(("Authorized user"))

node_user -->|"uses"| node_dashboard_app
node_dashboard_app -->|"routes to"| node_dataset_pages
node_dashboard_app -->|"routes to"| node_upload_page
node_dashboard_app -->|"routes to"| node_explorer_page
node_dashboard_app -->|"routes to"| node_generation_page
node_dashboard_app -->|"routes to"| node_evaluation_page
node_generation_page -->|"requests through"| node_frontend_api
node_explorer_page -->|"requests through"| node_frontend_api
node_evaluation_page -->|"requests through"| node_frontend_api
node_utility_page -.->|"requests through"| node_frontend_api
node_reports_page -.->|"downloads through"| node_frontend_api
node_frontend_api -.->|"HTTP requests"| node_api_views
node_api_views -->|"calls"| node_ingestion
node_api_views -->|"dispatches"| node_generation_service
node_api_views -->|"calls"| node_evaluation_service
node_api_views -->|"reads and writes"| node_records
node_ingestion -->|"profiles"| node_profile
node_ingestion -->|"stores dataset"| node_records
node_generation_service -->|"preprocesses"| node_preprocessing
node_generation_service -->|"builds metadata"| node_profile
node_generation_service -->|"uses"| node_generation_utils
node_generation_service -->|"validates output"| node_validation
node_generation_service -->|"evaluates result"| node_evaluation_service
node_generation_service -->|"updates job"| node_records
node_task_queue -->|"runs generation"| node_generation_service
node_task_queue -->|"runs utility"| node_ml_utility
node_generation_utils -->|"configures metadata"| node_metadata_config
node_generation_utils -->|"uses schema"| node_schema
node_generation_utils -->|"validates data"| node_validation
node_generation_service -.->|"selects model"| node_model_generation
node_evaluation_service -->|"calls"| node_evaluation_core
node_evaluation_core -->|"computes fidelity"| node_fidelity
node_evaluation_core -->|"computes privacy risk"| node_privacy
node_ml_utility -->|"evaluates utility"| node_evaluation_core
node_evaluation_service -->|"stores evaluations"| node_records
node_api_views -.->|"builds PDF"| node_report

click node_dashboard_app "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/App.tsx"
click node_dataset_pages "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/DatasetsPage.tsx"
click node_upload_page "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/UploadDatasetPage.tsx"
click node_explorer_page "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/DatasetExplorerPage.tsx"
click node_generation_page "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/GeneratePage.tsx"
click node_evaluation_page "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/EvaluationPage.tsx"
click node_utility_page "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/MlUtilityPage.tsx"
click node_reports_page "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/ReportsPage.tsx"
click node_frontend_api "https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/api.ts"
click node_api_views "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/views.py"
click node_records "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/models.py"
click node_task_queue "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/tasks.py"
click node_ingestion "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/dataset_service.py"
click node_profile "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/profiling.py"
click node_schema "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/schema.py"
click node_validation "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/validation.py"
click node_preprocessing "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/preprocessing_service.py"
click node_metadata_config "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/configure_metadata.py"
click node_generation_service "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/generation_service.py"
click node_generation_utils "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/generation_utils.py"
click node_model_generation "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/generate_ctgan.py"
click node_evaluation_service "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/evaluation_service.py"
click node_evaluation_core "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/evaluate_models.py"
click node_privacy "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/privacy_evaluation.py"
click node_fidelity "https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/fidelity_evaluation.py"
click node_ml_utility "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/ml_utility_service.py"
click node_report "https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/report_service.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_dashboard_app,node_dataset_pages,node_upload_page,node_explorer_page,node_generation_page,node_evaluation_page,node_utility_page,node_reports_page,node_frontend_api,node_user toneBlue
class node_api_views,node_records,node_task_queue toneAmber
class node_ingestion,node_profile,node_schema,node_validation,node_preprocessing toneMint
class node_metadata_config,node_generation_service,node_generation_utils,node_model_generation toneRose
class node_evaluation_service,node_evaluation_core,node_privacy,node_fidelity,node_ml_utility,node_report toneIndigo
```

## Components

### User dashboard

- [Dashboard routes](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dataset management](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/DatasetsPage.tsx): `frontend/src/pages/DatasetsPage.tsx`
- [Dataset upload](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/UploadDatasetPage.tsx): `frontend/src/pages/UploadDatasetPage.tsx`
- [Dataset explorer](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/DatasetExplorerPage.tsx): `frontend/src/pages/DatasetExplorerPage.tsx`
- [Experiment generation](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/GeneratePage.tsx): `frontend/src/pages/GeneratePage.tsx`
- [Evaluation dashboard](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/EvaluationPage.tsx): `frontend/src/pages/EvaluationPage.tsx`
- [ML utility dashboard](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/MlUtilityPage.tsx): `frontend/src/pages/MlUtilityPage.tsx`
- [Reports and export](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/pages/ReportsPage.tsx): `frontend/src/pages/ReportsPage.tsx`
- [API client](https://github.com/cosmos-junior/synthetic-student-data/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### API and persistence

- [REST endpoints](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/views.py): `backend/datasets/views.py`
- [Datasets and jobs](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/models.py): `backend/datasets/models.py`
- [Background tasks](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/tasks.py): `backend/datasets/tasks.py`

### Dataset workflow

- [Dataset ingestion](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/dataset_service.py): `backend/datasets/services/dataset_service.py`
- [Profiling and metadata](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/profiling.py): `src/synthetic_data/profiling.py`
- [Schema analysis](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/schema.py): `src/synthetic_data/schema.py`
- [Data validation](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/validation.py): `src/synthetic_data/validation.py`
- [Preprocessing](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/preprocessing_service.py): `backend/datasets/services/preprocessing_service.py`

### Synthesis pipeline

- [SDV metadata](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/configure_metadata.py): `src/synthetic_data/configure_metadata.py`
- [Generation orchestration](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/generation_service.py): `backend/datasets/services/generation_service.py`
- [Generation utilities](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/generation_utils.py): `src/synthetic_data/generation_utils.py`
- [Synthesis models](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/generate_ctgan.py): `src/synthetic_data/generate_ctgan.py`

### Evaluation and reporting

- [Evaluation orchestration](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/evaluation_service.py): `backend/datasets/services/evaluation_service.py`
- [Fidelity and ML evaluation](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/evaluate_models.py): `src/synthetic_data/evaluate_models.py`
- [Privacy risk assessment](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/privacy_evaluation.py): `src/synthetic_data/privacy_evaluation.py`
- [Statistical fidelity](https://github.com/cosmos-junior/synthetic-student-data/blob/main/src/synthetic_data/fidelity_evaluation.py): `src/synthetic_data/fidelity_evaluation.py`
- [TRTR and TSTR utility](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/ml_utility_service.py): `backend/datasets/services/ml_utility_service.py`
- [PDF reporting](https://github.com/cosmos-junior/synthetic-student-data/blob/main/backend/datasets/services/report_service.py): `backend/datasets/services/report_service.py`

### Other components

- **Authorized user**

## Connections

- Authorized user → Dashboard routes: uses (evidence: `frontend/src/App.tsx`)
- Dashboard routes → Dataset management: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard routes → Dataset upload: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard routes → Dataset explorer: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard routes → Experiment generation: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard routes → Evaluation dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Experiment generation → API client: requests through (evidence: `frontend/src/pages/GeneratePage.tsx`)
- Dataset explorer → API client: requests through (evidence: `frontend/src/pages/DatasetExplorerPage.tsx`)
- Evaluation dashboard → API client: requests through (evidence: `frontend/src/pages/EvaluationPage.tsx`)
- ML utility dashboard → API client: requests through (evidence: `frontend/src/pages/MlUtilityPage.tsx`)
- Reports and export → API client: downloads through
- API client → REST endpoints: HTTP requests
- REST endpoints → Dataset ingestion: calls (evidence: `backend/datasets/views.py`)
- REST endpoints → Generation orchestration: dispatches (evidence: `backend/datasets/views.py`)
- REST endpoints → Evaluation orchestration: calls (evidence: `backend/datasets/views.py`)
- REST endpoints → Datasets and jobs: reads and writes (evidence: `backend/datasets/views.py`)
- Dataset ingestion → Profiling and metadata: profiles (evidence: `backend/datasets/services/dataset_service.py`)
- Dataset ingestion → Datasets and jobs: stores dataset (evidence: `backend/datasets/services/dataset_service.py`)
- Generation orchestration → Preprocessing: preprocesses (evidence: `backend/datasets/services/generation_service.py`)
- Generation orchestration → Profiling and metadata: builds metadata (evidence: `backend/datasets/services/generation_service.py`)
- Generation orchestration → Generation utilities: uses (evidence: `backend/datasets/services/generation_service.py`)
- Generation orchestration → Data validation: validates output (evidence: `backend/datasets/services/generation_service.py`)
- Generation orchestration → Evaluation orchestration: evaluates result (evidence: `backend/datasets/services/generation_service.py`)
- Generation orchestration → Datasets and jobs: updates job (evidence: `backend/datasets/services/generation_service.py`)
- Background tasks → Generation orchestration: runs generation (evidence: `backend/datasets/tasks.py`)
- Background tasks → TRTR and TSTR utility: runs utility (evidence: `backend/datasets/tasks.py`)
- Generation utilities → SDV metadata: configures metadata (evidence: `src/synthetic_data/generation_utils.py`)
- Generation utilities → Schema analysis: uses schema (evidence: `src/synthetic_data/generation_utils.py`)
- Generation utilities → Data validation: validates data (evidence: `src/synthetic_data/generation_utils.py`)
- Generation orchestration → Synthesis models: selects model
- Evaluation orchestration → Fidelity and ML evaluation: calls (evidence: `backend/datasets/services/evaluation_service.py`)
- Fidelity and ML evaluation → Statistical fidelity: computes fidelity (evidence: `src/synthetic_data/evaluate_models.py`)
- Fidelity and ML evaluation → Privacy risk assessment: computes privacy risk (evidence: `src/synthetic_data/evaluate_models.py`)
- TRTR and TSTR utility → Fidelity and ML evaluation: evaluates utility (evidence: `backend/datasets/services/ml_utility_service.py`)
- Evaluation orchestration → Datasets and jobs: stores evaluations (evidence: `backend/datasets/services/evaluation_service.py`)
- REST endpoints → PDF reporting: builds PDF
