# siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer architecture

> Architecture diagram of the GitHub repository siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer
- Repository: https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer

## Overview

SchedulAI lets learners configure CPU workloads, simulate scheduling algorithms, compare metrics and timelines, inspect process lifecycles, and request an objective-based recommendation or CSV export. The React dashboard calls a FastAPI API; its routes coordinate presets, recommendation and export logic, and a Python subprocess bridge to the C++ scheduling engine. The README documents six algorithms and the visualization and classroom-preset capabilities. Some UI and API wiring is supported only by the README or source index, so those links are marked dashed where unverified in excerpts.

Main entry points: [`frontend/src/App.tsx`](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/App.tsx) (Dashboard), [`backend/app/routes/api.py`](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/routes/api.py) (FastAPI Routes), [`backend/app/schemas/scheduling.py`](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/schemas/scheduling.py) (Request and Result Schemas), [`frontend/src/components/GanttChart.tsx`](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/GanttChart.tsx) (Gantt Timeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_dashboard["Dashboard<br/>[App.tsx]"]
  node_workspace["Workload Workspace"]
  node_comparison["Algorithm Comparison"]
  node_gantt["Gantt Timeline<br/>[GanttChart.tsx]"]
  node_explorer["Process Explorer"]
  node_insights["AI Insights"]
  node_client["API Client<br/>[api.ts]"]
end

subgraph group_backend["API Services"]
  node_api["FastAPI Routes<br/>[api.py]"]
  node_app_entry["API Application<br/>[main.py]"]
  node_presets["Workload Presets<br/>[presets.py]"]
  node_optimizer["Recommendation Optimizer<br/>[optimizer.py]"]
  node_csv_export["CSV Export<br/>[csv_export.py]"]
  node_engine_bridge["Engine Bridge<br/>[engine.py]"]
end

subgraph group_engine["Scheduling Engine"]
  node_cpp_engine["Scheduling Engine"]
end

subgraph group_contracts["Data Contracts"]
  node_frontend_types["UI Types<br/>[scheduling.ts]"]
  node_schemas["Request and Result Schemas<br/>[scheduling.py]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_workspace
node_dashboard -->|"renders"| node_comparison
node_dashboard -->|"renders"| node_explorer
node_dashboard -->|"renders"| node_insights
node_dashboard -->|"calls"| node_client
node_dashboard -->|"uses"| node_frontend_types
node_comparison -->|"renders"| node_gantt
node_explorer -->|"renders"| node_gantt
node_insights -->|"renders"| node_gantt
node_client -.->|"sends requests"| node_api
node_api -->|"validates and returns"| node_schemas
node_app_entry -->|"registers"| node_api
node_api -->|"fetches"| node_presets
node_api -->|"runs simulations"| node_engine_bridge
node_api -->|"builds recommendation"| node_optimizer
node_api -->|"generates CSV"| node_csv_export
node_engine_bridge -->|"invokes"| node_cpp_engine
node_optimizer -->|"uses models"| node_schemas
node_presets -->|"constructs workloads"| node_schemas
node_csv_export -->|"reads results"| node_schemas

click node_dashboard "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/App.tsx"
click node_workspace "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/WorkspaceSection.tsx"
click node_comparison "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/ComparisonSection.tsx"
click node_gantt "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/GanttChart.tsx"
click node_explorer "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/ProcessExplorerSection.tsx"
click node_insights "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/AiInsightsSection.tsx"
click node_client "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/services/api.ts"
click node_frontend_types "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/types/scheduling.ts"
click node_api "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/routes/api.py"
click node_app_entry "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/main.py"
click node_schemas "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/schemas/scheduling.py"
click node_presets "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/services/presets.py"
click node_optimizer "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/recommendations/optimizer.py"
click node_csv_export "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/services/csv_export.py"
click node_engine_bridge "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/services/engine.py"
click node_cpp_engine "https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/cpp/existing_scheduler.cpp"

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,node_workspace,node_comparison,node_gantt,node_explorer,node_insights,node_client toneBlue
class node_api,node_app_entry,node_presets,node_optimizer,node_csv_export,node_engine_bridge toneAmber
class node_cpp_engine toneMint
class node_frontend_types,node_schemas toneRose
class node_learner toneIndigo
```

## Components

### Dashboard

- [Dashboard](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Workload Workspace](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/WorkspaceSection.tsx): `frontend/src/components/WorkspaceSection.tsx`
- [Algorithm Comparison](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/ComparisonSection.tsx): `frontend/src/components/ComparisonSection.tsx`
- [Gantt Timeline](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/GanttChart.tsx): `frontend/src/components/GanttChart.tsx`
- [Process Explorer](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/ProcessExplorerSection.tsx): `frontend/src/components/ProcessExplorerSection.tsx`
- [AI Insights](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/components/AiInsightsSection.tsx): `frontend/src/components/AiInsightsSection.tsx`
- [API Client](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API Services

- [FastAPI Routes](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/routes/api.py): `backend/app/routes/api.py`
- [API Application](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/main.py): `backend/app/main.py`
- [Workload Presets](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/services/presets.py): `backend/app/services/presets.py`
- [Recommendation Optimizer](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/recommendations/optimizer.py): `backend/app/recommendations/optimizer.py`
- [CSV Export](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/services/csv_export.py): `backend/app/services/csv_export.py`
- [Engine Bridge](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/services/engine.py): `backend/app/services/engine.py`

### Scheduling Engine

- [Scheduling Engine](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/cpp/existing_scheduler.cpp): `backend/cpp/existing_scheduler.cpp`

### Data Contracts

- [UI Types](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/frontend/src/types/scheduling.ts): `frontend/src/types/scheduling.ts`
- [Request and Result Schemas](https://github.com/siddhant0812-sid/schedulai-ai-assisted-cpu-scheduling-simulator-optimizer/blob/main/backend/app/schemas/scheduling.py): `backend/app/schemas/scheduling.py`

### Other components

- **Learner**

## Connections

- Learner → Dashboard: uses (evidence: `README.md`)
- Dashboard → Workload Workspace: renders (evidence: `frontend/src/App.tsx`)
- Dashboard → Algorithm Comparison: renders (evidence: `frontend/src/App.tsx`)
- Dashboard → Process Explorer: renders (evidence: `frontend/src/App.tsx`)
- Dashboard → AI Insights: renders (evidence: `frontend/src/App.tsx`)
- Dashboard → API Client: calls (evidence: `frontend/src/App.tsx`)
- Dashboard → UI Types: uses (evidence: `frontend/src/App.tsx`)
- Algorithm Comparison → Gantt Timeline: renders (evidence: `frontend/src/components/ComparisonSection.tsx`)
- Process Explorer → Gantt Timeline: renders (evidence: `frontend/src/components/ProcessExplorerSection.tsx`)
- AI Insights → Gantt Timeline: renders (evidence: `frontend/src/components/AiInsightsSection.tsx`)
- API Client → FastAPI Routes: sends requests
- FastAPI Routes → Request and Result Schemas: validates and returns (evidence: `backend/app/routes/api.py`)
- API Application → FastAPI Routes: registers (evidence: `backend/app/main.py`)
- FastAPI Routes → Workload Presets: fetches (evidence: `backend/app/routes/api.py`)
- FastAPI Routes → Engine Bridge: runs simulations (evidence: `backend/app/routes/api.py`)
- FastAPI Routes → Recommendation Optimizer: builds recommendation (evidence: `backend/app/routes/api.py`)
- FastAPI Routes → CSV Export: generates CSV (evidence: `backend/app/routes/api.py`)
- Engine Bridge → Scheduling Engine: invokes (evidence: `backend/app/services/engine.py`)
- Recommendation Optimizer → Request and Result Schemas: uses models (evidence: `backend/app/recommendations/optimizer.py`)
- Workload Presets → Request and Result Schemas: constructs workloads (evidence: `backend/app/services/presets.py`)
- CSV Export → Request and Result Schemas: reads results (evidence: `backend/app/services/csv_export.py`)
