# areefurrahman/mlab architecture

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

- Interactive diagram: https://gitdiagram.com/areefurrahman/mlab
- Repository: https://github.com/areefurrahman/mlab

## Overview

This is a web-based machine-learning platform for running classic algorithm experiments, comparing results, managing datasets, and executing pretrained inference tasks. The principal supported workflow is inference: a user submits inputs through the web app, the backend creates a run, dispatches asynchronous work, and returns status and results for display. The tree also shows experiment, dataset, comparison, and history subsystems, but their internal wiring was not sampled; those branches are represented without speculative call chains.

Main entry points: [`backend/app/services/inference_service.py`](https://github.com/areefurrahman/mlab/blob/main/backend/app/services/inference_service.py) (Inference service), [`frontend/src/pages/InferencePage.jsx`](https://github.com/areefurrahman/mlab/blob/main/frontend/src/pages/InferencePage.jsx) (Inference page), [`backend/app/tasks/inference_tasks.py`](https://github.com/areefurrahman/mlab/blob/main/backend/app/tasks/inference_tasks.py) (Inference worker task), [`backend/app/api/inference.py`](https://github.com/areefurrahman/mlab/blob/main/backend/app/api/inference.py) (Inference endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_routes["App routes<br/>[AppRoutes.jsx]"]
  node_inference_ui["Inference page<br/>[InferencePage.jsx]"]
  node_polling["Run polling"]
  node_inference_client["Inference API client<br/>[inferenceApi.js]"]
  node_results["Inference results"]
end

subgraph group_api["Backend API"]
  node_inference_route["Inference endpoints<br/>[inference.py]"]
  node_inference_service["Inference service"]
  node_experiment_api["Experiment endpoints<br/>[experiments.py]"]
  node_experiment_service["Experiment service"]
  node_dataset_api["Dataset endpoints<br/>[datasets.py]"]
  node_dataset_service["Dataset service<br/>[dataset_service.py]"]
  node_comparison_api["Comparison endpoints<br/>[comparisons.py]"]
  node_comparison_service["Comparison service"]
  node_history_service["History service<br/>[history_service.py]"]
end

subgraph group_ml["ML runtime"]
  node_algorithm_runtime["Algorithm runtime"]
  node_preprocessing["Preprocessing and metrics<br/>[preprocessing.py]"]
  node_inference_registry["Inference registry"]
  node_inference_tasks["Inference task strategies"]
  node_inference_base["Inference base<br/>[inference_base.py]"]
end

subgraph group_state["Persistence and jobs"]
  node_runs[("Inference runs<br/>[inference_run.py]")]
  node_experiment_records[("Experiment records<br/>[experiment.py]")]
  node_datasets[("Dataset records<br/>[dataset.py]")]
  node_comparison_records[("Comparison records")]
  node_inference_task["Inference worker task<br/>[inference_tasks.py]"]
  node_job_queue["Celery queue<br/>[celery_app.py]"]
  node_worker["Celery worker<br/>[celery_worker.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_routes
node_routes -->|"routes to"| node_inference_ui
node_inference_ui -->|"requests tasks and runs"| node_inference_client
node_inference_ui -->|"polls run"| node_polling
node_polling -->|"fetches status"| node_inference_client
node_inference_client -->|"HTTP requests"| node_inference_route
node_inference_route -->|"creates and reads runs"| node_inference_service
node_inference_service -->|"reads and writes"| node_runs
node_inference_service -->|"resolves task"| node_inference_registry
node_inference_route -->|"dispatches run"| node_inference_task
node_inference_task -->|"queued by"| node_job_queue
node_job_queue -->|"delivers jobs"| node_worker
node_worker -->|"executes"| node_inference_task
node_inference_task -->|"executes run"| node_inference_service
node_inference_service -->|"runs strategy"| node_inference_tasks
node_inference_tasks -->|"implements"| node_inference_base
node_inference_ui -->|"displays output"| node_results

click node_routes "https://github.com/areefurrahman/mlab/blob/main/frontend/src/routes/AppRoutes.jsx"
click node_inference_ui "https://github.com/areefurrahman/mlab/blob/main/frontend/src/pages/InferencePage.jsx"
click node_polling "https://github.com/areefurrahman/mlab/blob/main/frontend/src/hooks/useInferencePolling.js"
click node_inference_client "https://github.com/areefurrahman/mlab/blob/main/frontend/src/api/inferenceApi.js"
click node_results "https://github.com/areefurrahman/mlab/tree/main/frontend/src/components/inference"
click node_inference_route "https://github.com/areefurrahman/mlab/blob/main/backend/app/api/inference.py"
click node_inference_service "https://github.com/areefurrahman/mlab/blob/main/backend/app/services/inference_service.py"
click node_experiment_api "https://github.com/areefurrahman/mlab/blob/main/backend/app/api/experiments.py"
click node_experiment_service "https://github.com/areefurrahman/mlab/blob/main/backend/app/services/experiment_service.py"
click node_dataset_api "https://github.com/areefurrahman/mlab/blob/main/backend/app/api/datasets.py"
click node_dataset_service "https://github.com/areefurrahman/mlab/blob/main/backend/app/services/dataset_service.py"
click node_comparison_api "https://github.com/areefurrahman/mlab/blob/main/backend/app/api/comparisons.py"
click node_comparison_service "https://github.com/areefurrahman/mlab/blob/main/backend/app/services/comparison_service.py"
click node_history_service "https://github.com/areefurrahman/mlab/blob/main/backend/app/services/history_service.py"
click node_algorithm_runtime "https://github.com/areefurrahman/mlab/tree/main/backend/app/ml/algorithms"
click node_preprocessing "https://github.com/areefurrahman/mlab/blob/main/backend/app/ml/preprocessing.py"
click node_inference_registry "https://github.com/areefurrahman/mlab/blob/main/backend/app/ml/inference_registry.py"
click node_inference_tasks "https://github.com/areefurrahman/mlab/tree/main/backend/app/ml/inference_tasks"
click node_inference_base "https://github.com/areefurrahman/mlab/blob/main/backend/app/ml/inference_base.py"
click node_runs "https://github.com/areefurrahman/mlab/blob/main/backend/app/models/inference_run.py"
click node_experiment_records "https://github.com/areefurrahman/mlab/blob/main/backend/app/models/experiment.py"
click node_datasets "https://github.com/areefurrahman/mlab/blob/main/backend/app/models/dataset.py"
click node_comparison_records "https://github.com/areefurrahman/mlab/blob/main/backend/app/models/comparison_group.py"
click node_inference_task "https://github.com/areefurrahman/mlab/blob/main/backend/app/tasks/inference_tasks.py"
click node_job_queue "https://github.com/areefurrahman/mlab/blob/main/backend/app/celery_app.py"
click node_worker "https://github.com/areefurrahman/mlab/blob/main/backend/celery_worker.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_routes,node_inference_ui,node_polling,node_inference_client,node_results,node_user toneBlue
class node_inference_route,node_inference_service,node_experiment_api,node_experiment_service,node_dataset_api,node_dataset_service,node_comparison_api,node_comparison_service,node_history_service toneAmber
class node_algorithm_runtime,node_preprocessing,node_inference_registry,node_inference_tasks,node_inference_base toneMint
class node_runs,node_experiment_records,node_datasets,node_comparison_records,node_inference_task,node_job_queue,node_worker toneRose
```

## Components

### Web app

- [App routes](https://github.com/areefurrahman/mlab/blob/main/frontend/src/routes/AppRoutes.jsx): `frontend/src/routes/AppRoutes.jsx`
- [Inference page](https://github.com/areefurrahman/mlab/blob/main/frontend/src/pages/InferencePage.jsx): `frontend/src/pages/InferencePage.jsx`
- [Run polling](https://github.com/areefurrahman/mlab/blob/main/frontend/src/hooks/useInferencePolling.js): `frontend/src/hooks/useInferencePolling.js`
- [Inference API client](https://github.com/areefurrahman/mlab/blob/main/frontend/src/api/inferenceApi.js): `frontend/src/api/inferenceApi.js`
- [Inference results](https://github.com/areefurrahman/mlab/tree/main/frontend/src/components/inference): `frontend/src/components/inference`

### Backend API

- [Inference endpoints](https://github.com/areefurrahman/mlab/blob/main/backend/app/api/inference.py): `backend/app/api/inference.py`
- [Inference service](https://github.com/areefurrahman/mlab/blob/main/backend/app/services/inference_service.py): `backend/app/services/inference_service.py`
- [Experiment endpoints](https://github.com/areefurrahman/mlab/blob/main/backend/app/api/experiments.py): `backend/app/api/experiments.py`
- [Experiment service](https://github.com/areefurrahman/mlab/blob/main/backend/app/services/experiment_service.py): `backend/app/services/experiment_service.py`
- [Dataset endpoints](https://github.com/areefurrahman/mlab/blob/main/backend/app/api/datasets.py): `backend/app/api/datasets.py`
- [Dataset service](https://github.com/areefurrahman/mlab/blob/main/backend/app/services/dataset_service.py): `backend/app/services/dataset_service.py`
- [Comparison endpoints](https://github.com/areefurrahman/mlab/blob/main/backend/app/api/comparisons.py): `backend/app/api/comparisons.py`
- [Comparison service](https://github.com/areefurrahman/mlab/blob/main/backend/app/services/comparison_service.py): `backend/app/services/comparison_service.py`
- [History service](https://github.com/areefurrahman/mlab/blob/main/backend/app/services/history_service.py): `backend/app/services/history_service.py`

### ML runtime

- [Algorithm runtime](https://github.com/areefurrahman/mlab/tree/main/backend/app/ml/algorithms): `backend/app/ml/algorithms`
- [Preprocessing and metrics](https://github.com/areefurrahman/mlab/blob/main/backend/app/ml/preprocessing.py): `backend/app/ml/preprocessing.py`
- [Inference registry](https://github.com/areefurrahman/mlab/blob/main/backend/app/ml/inference_registry.py): `backend/app/ml/inference_registry.py`
- [Inference task strategies](https://github.com/areefurrahman/mlab/tree/main/backend/app/ml/inference_tasks): `backend/app/ml/inference_tasks`
- [Inference base](https://github.com/areefurrahman/mlab/blob/main/backend/app/ml/inference_base.py): `backend/app/ml/inference_base.py`

### Persistence and jobs

- [Inference runs](https://github.com/areefurrahman/mlab/blob/main/backend/app/models/inference_run.py): `backend/app/models/inference_run.py`
- [Experiment records](https://github.com/areefurrahman/mlab/blob/main/backend/app/models/experiment.py): `backend/app/models/experiment.py`
- [Dataset records](https://github.com/areefurrahman/mlab/blob/main/backend/app/models/dataset.py): `backend/app/models/dataset.py`
- [Comparison records](https://github.com/areefurrahman/mlab/blob/main/backend/app/models/comparison_group.py): `backend/app/models/comparison_group.py`
- [Inference worker task](https://github.com/areefurrahman/mlab/blob/main/backend/app/tasks/inference_tasks.py): `backend/app/tasks/inference_tasks.py`
- [Celery queue](https://github.com/areefurrahman/mlab/blob/main/backend/app/celery_app.py): `backend/app/celery_app.py`
- [Celery worker](https://github.com/areefurrahman/mlab/blob/main/backend/celery_worker.py): `backend/celery_worker.py`

### Other components

- **User**

## Connections

- User → App routes: uses
- App routes → Inference page: routes to
- Inference page → Inference API client: requests tasks and runs
- Inference page → Run polling: polls run
- Run polling → Inference API client: fetches status
- Inference API client → Inference endpoints: HTTP requests
- Inference endpoints → Inference service: creates and reads runs
- Inference service → Inference runs: reads and writes
- Inference service → Inference registry: resolves task
- Inference endpoints → Inference worker task: dispatches run
- Inference worker task → Celery queue: queued by
- Celery queue → Celery worker: delivers jobs
- Celery worker → Inference worker task: executes
- Inference worker task → Inference service: executes run
- Inference service → Inference task strategies: runs strategy
- Inference task strategies → Inference base: implements
- Inference page → Inference results: displays output
