# ahmadhakimitsnaini/dataku architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadhakimitsnaini/dataku
- Repository: https://github.com/ahmadhakimitsnaini/dataku

## Overview

DataKu is a web AutoML platform: users create projects, upload and profile CSV data, choose a target, launch background training, and compare models. The graph preserves authentication and the documented prediction/deployment capability. Backend call links use sampled source or SOURCE INDEX references; the README documents the product workflow and queue. Several frontend routes and backend modules were not excerpted, so their detailed interactions are shown only where documented.

Main entry points: [`src/App.tsx`](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/App.tsx) (App routing), [`backend/core/database.py`](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/core/database.py) (SQLite database), [`backend/worker/tasks.py`](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/worker/tasks.py) (Training worker), [`src/lib/api.ts`](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App routing<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_upload_ui["Upload modal<br/>[UploadModal.tsx]"]
  node_project_ui["Project profiling<br/>[ProjectDetail.tsx]"]
  node_job_ui["Target selection<br/>[JobConfig.tsx]"]
  node_leaderboard_ui["Leaderboard<br/>[Leaderboard.tsx]"]
  node_auth_ui["Login and register<br/>[Login.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Backend API"]
  node_api_main["API application<br/>[main.py]"]
  node_projects_api["Project endpoints<br/>[projects.py]"]
  node_upload_api["Upload and profiling<br/>[upload.py]"]
  node_jobs_api["Training and models API<br/>[jobs.py]"]
  node_predict_api["Prediction endpoints<br/>[predict.py]"]
end

subgraph group_identity["Authentication"]
  node_auth_api["Auth endpoints<br/>[auth.py]"]
  node_security["JWT and password security<br/>[security.py]"]
end

subgraph group_data["Project data"]
  node_domain["Domain records<br/>[domain.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_database[("SQLite database<br/>[database.py]")]
end

subgraph group_training["Async training"]
  node_redis["Redis broker"]
  node_worker["Training worker<br/>[tasks.py]"]
  node_artifacts["Model artifacts<br/>[tasks.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_project_ui
node_app -->|"routes to"| node_job_ui
node_app -->|"routes to"| node_leaderboard_ui
node_app -->|"routes to"| node_auth_ui
node_dashboard -->|"opens"| node_upload_ui
node_dashboard -->|"calls"| node_api_client
node_upload_ui -->|"calls"| node_api_client
node_project_ui -->|"calls"| node_api_client
node_job_ui -->|"calls"| node_api_client
node_leaderboard_ui -->|"calls"| node_api_client
node_auth_ui -->|"calls"| node_api_client
node_dashboard -->|"navigates"| node_project_ui
node_project_ui -->|"continues to"| node_job_ui
node_job_ui -->|"continues to"| node_leaderboard_ui
node_api_main -->|"registers"| node_projects_api
node_api_main -->|"registers"| node_upload_api
node_api_main -->|"registers"| node_jobs_api
node_api_main -->|"registers"| node_predict_api
node_api_main -->|"registers"| node_auth_api
node_projects_api -->|"queries"| node_database
node_projects_api -->|"uses records"| node_domain
node_upload_api -->|"stores metadata"| node_database
node_upload_api -->|"uses records"| node_domain
node_jobs_api -->|"queries"| node_database
node_jobs_api -->|"dispatches"| node_worker
node_jobs_api -->|"enqueues task"| node_redis
node_redis -->|"delivers task"| node_worker
node_worker -->|"reads and writes"| node_domain
node_worker -->|"persists scores"| node_database
node_worker -->|"saves models"| node_artifacts
node_worker -->|"preprocesses and trains"| node_artifacts
node_jobs_api -->|"returns model records"| node_domain
node_predict_api -->|"loads model data"| node_database
node_auth_api -->|"authenticates"| node_security
node_auth_api -->|"reads and writes"| node_database
node_security -->|"validates user"| node_database

click node_app "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/App.tsx"
click node_dashboard "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/Dashboard.tsx"
click node_upload_ui "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/components/UploadModal.tsx"
click node_project_ui "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/ProjectDetail.tsx"
click node_job_ui "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/JobConfig.tsx"
click node_leaderboard_ui "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/Leaderboard.tsx"
click node_auth_ui "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/Login.tsx"
click node_api_client "https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/lib/api.ts"
click node_api_main "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/main.py"
click node_projects_api "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/projects.py"
click node_upload_api "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/upload.py"
click node_jobs_api "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/jobs.py"
click node_predict_api "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/predict.py"
click node_auth_api "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/auth.py"
click node_security "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/core/security.py"
click node_domain "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/models/domain.py"
click node_schemas "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/schemas.py"
click node_database "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/core/database.py"
click node_worker "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/worker/tasks.py"
click node_artifacts "https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/worker/tasks.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_app,node_dashboard,node_upload_ui,node_project_ui,node_job_ui,node_leaderboard_ui,node_auth_ui,node_api_client,node_user toneBlue
class node_api_main,node_projects_api,node_upload_api,node_jobs_api,node_predict_api toneAmber
class node_auth_api,node_security toneMint
class node_domain,node_schemas,node_database toneRose
class node_redis,node_worker,node_artifacts toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Upload modal](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/components/UploadModal.tsx): `src/components/UploadModal.tsx`
- [Project profiling](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/ProjectDetail.tsx): `src/pages/ProjectDetail.tsx`
- [Target selection](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/JobConfig.tsx): `src/pages/JobConfig.tsx`
- [Leaderboard](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/Leaderboard.tsx): `src/pages/Leaderboard.tsx`
- [Login and register](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [API client](https://github.com/ahmadhakimitsnaini/dataku/blob/main/src/lib/api.ts): `src/lib/api.ts`

### Backend API

- [API application](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/main.py): `backend/main.py`
- [Project endpoints](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/projects.py): `backend/api/projects.py`
- [Upload and profiling](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/upload.py): `backend/api/upload.py`
- [Training and models API](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/jobs.py): `backend/api/jobs.py`
- [Prediction endpoints](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/predict.py): `backend/api/predict.py`

### Authentication

- [Auth endpoints](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/api/auth.py): `backend/api/auth.py`
- [JWT and password security](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/core/security.py): `backend/core/security.py`

### Project data

- [Domain records](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/models/domain.py): `backend/models/domain.py`
- [API schemas](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/schemas.py): `backend/schemas.py`
- [SQLite database](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/core/database.py): `backend/core/database.py`

### Async training

- **Redis broker**
- [Training worker](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/worker/tasks.py): `backend/worker/tasks.py`
- [Model artifacts](https://github.com/ahmadhakimitsnaini/dataku/blob/main/backend/worker/tasks.py): `backend/worker/tasks.py`

### Other components

- **User**

## Connections

- User → App routing: uses
- App routing → Dashboard: routes to (evidence: `src/App.tsx`)
- App routing → Project profiling: routes to (evidence: `src/App.tsx`)
- App routing → Target selection: routes to (evidence: `src/App.tsx`)
- App routing → Leaderboard: routes to (evidence: `src/App.tsx`)
- App routing → Login and register: routes to (evidence: `src/App.tsx`)
- Dashboard → Upload modal: opens (evidence: `src/pages/Dashboard.tsx`)
- Dashboard → API client: calls (evidence: `src/pages/Dashboard.tsx`)
- Upload modal → API client: calls (evidence: `src/components/UploadModal.tsx`)
- Project profiling → API client: calls (evidence: `src/pages/ProjectDetail.tsx`)
- Target selection → API client: calls
- Leaderboard → API client: calls (evidence: `src/pages/Leaderboard.tsx`)
- Login and register → API client: calls (evidence: `src/pages/Login.tsx`)
- Dashboard → Project profiling: navigates
- Project profiling → Target selection: continues to
- Target selection → Leaderboard: continues to
- API application → Project endpoints: registers (evidence: `backend/main.py`)
- API application → Upload and profiling: registers (evidence: `backend/main.py`)
- API application → Training and models API: registers (evidence: `backend/main.py`)
- API application → Prediction endpoints: registers (evidence: `backend/main.py`)
- API application → Auth endpoints: registers (evidence: `backend/main.py`)
- Project endpoints → SQLite database: queries (evidence: `backend/api/projects.py`)
- Project endpoints → Domain records: uses records (evidence: `backend/api/projects.py`)
- Upload and profiling → SQLite database: stores metadata (evidence: `backend/api/upload.py`)
- Upload and profiling → Domain records: uses records (evidence: `backend/api/upload.py`)
- Training and models API → SQLite database: queries (evidence: `backend/api/jobs.py`)
- Training and models API → Training worker: dispatches (evidence: `backend/api/jobs.py`)
- Training and models API → Redis broker: enqueues task
- Redis broker → Training worker: delivers task
- Training worker → Domain records: reads and writes (evidence: `backend/worker/tasks.py`)
- Training worker → SQLite database: persists scores (evidence: `backend/worker/tasks.py`)
- Training worker → Model artifacts: saves models (evidence: `backend/worker/tasks.py`)
- Training worker → Model artifacts: preprocesses and trains (evidence: `backend/worker/tasks.py`)
- Training and models API → Domain records: returns model records (evidence: `backend/api/jobs.py`)
- Prediction endpoints → SQLite database: loads model data (evidence: `backend/api/predict.py`)
- Auth endpoints → JWT and password security: authenticates (evidence: `backend/api/auth.py`)
- Auth endpoints → SQLite database: reads and writes (evidence: `backend/api/auth.py`)
- JWT and password security → SQLite database: validates user (evidence: `backend/core/security.py`)
