# ayushkumar418/os_simulator-web_app architecture

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

- Interactive diagram: https://gitdiagram.com/ayushkumar418/os_simulator-web_app
- Repository: https://github.com/ayushkumar418/os_simulator-web_app

## Overview

OS Simulator is an educational web application for exploring operating-system behavior. A user selects a simulator, supplies processes or memory/file parameters, and views a step-by-step result with visualizations and metrics. The React app routes users to the scheduling, memory, and file-system experiences; its API service connects UI actions to FastAPI, whose route handlers dispatch to simulation logic. Scheduling produces timelines, Gantt data, explanations, and performance metrics; memory simulators expose allocation and address-translation states; file-system operations expose block and directory state. The README also documents comparisons and demo scenarios. Some UI and backend files were not sampled, so uncertain request wiring is not expanded.

Main entry points: [`frontend/src/services/api.js`](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/App.jsx`](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/App.jsx) (Application routes), [`backend/routes/scheduler_routes.py`](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/scheduler_routes.py) (Scheduling routes), [`backend/routes/memory_routes.py`](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/memory_routes.py) (Memory routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app["Application routes<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_cpu_page["CPU simulator<br/>[CPUScheduler.jsx]"]
  node_memory_page["Memory hub"]
  node_contiguous_page["Contiguous allocator"]
  node_paging_page["Paging simulator"]
  node_virtual_page["Virtual memory<br/>[VirtualMemory.jsx]"]
  node_segment_page["Segmentation simulator"]
  node_filesystem_page["File-system simulator<br/>[FileSystem.jsx]"]
  node_shared_visuals["Simulation displays"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_backend_app["FastAPI application<br/>[main.py]"]
  node_scheduler_routes["Scheduling routes"]
  node_memory_routes["Memory routes<br/>[memory_routes.py]"]
  node_filesystem_routes["File-system routes"]
  node_scenario_routes["Scenario routes<br/>[scenario_routes.py]"]
end

subgraph group_cpu["CPU scheduling"]
  node_scheduler_engine["Scheduler framework<br/>[base_scheduler.py]"]
  node_fcfs["FCFS<br/>[fcfs.py]"]
  node_sjf["SJF / SRTF<br/>[sjf.py]"]
  node_priority["Priority scheduling<br/>[priority.py]"]
  node_round_robin["Round Robin<br/>[round_robin.py]"]
end

subgraph group_memory["Memory management"]
  node_contiguous_engine["Contiguous allocation<br/>[contiguous.py]"]
  node_paging_engine["Paging and translation<br/>[paging.py]"]
  node_replacement["Page replacement"]
  node_segmentation_engine["Segmentation<br/>[segmentation.py]"]
end

subgraph group_filesystem["File system"]
  node_filesystem_engine["File-system model<br/>[filesystem.py]"]
end

node_learner(("Learner"))

node_learner -->|"navigates"| node_app
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_cpu_page
node_app -->|"routes"| node_memory_page
node_app -->|"routes"| node_contiguous_page
node_app -->|"routes"| node_paging_page
node_app -->|"routes"| node_virtual_page
node_app -->|"routes"| node_segment_page
node_app -->|"routes"| node_filesystem_page
node_cpu_page -->|"requests"| node_api_client
node_contiguous_page -->|"requests"| node_api_client
node_paging_page -->|"requests"| node_api_client
node_virtual_page -->|"requests"| node_api_client
node_segment_page -->|"requests"| node_api_client
node_filesystem_page -->|"requests"| node_api_client
node_api_client -->|"HTTP requests"| node_backend_app
node_backend_app -->|"dispatches"| node_scheduler_routes
node_backend_app -->|"dispatches"| node_memory_routes
node_backend_app -->|"dispatches"| node_filesystem_routes
node_backend_app -->|"dispatches"| node_scenario_routes
node_scheduler_routes -->|"runs / measures"| node_scheduler_engine
node_scheduler_routes -->|"selects"| node_fcfs
node_scheduler_routes -->|"selects"| node_sjf
node_scheduler_routes -->|"selects"| node_priority
node_scheduler_routes -->|"selects"| node_round_robin
node_fcfs -->|"extends"| node_scheduler_engine
node_sjf -->|"extends"| node_scheduler_engine
node_priority -->|"extends"| node_scheduler_engine
node_round_robin -->|"extends"| node_scheduler_engine
node_scheduler_routes -->|"returns results"| node_api_client
node_memory_routes -->|"allocates"| node_contiguous_engine
node_memory_routes -->|"translates"| node_paging_engine
node_memory_routes -->|"uses algorithms"| node_replacement
node_memory_routes -->|"manages segments"| node_segmentation_engine
node_memory_routes -->|"returns state"| node_api_client
node_filesystem_routes -->|"operates on"| node_filesystem_engine
node_filesystem_routes -->|"returns state"| node_api_client
node_scenario_routes -->|"serves scenarios"| node_api_client
node_cpu_page -->|"displays simulation"| node_shared_visuals
node_scheduler_routes -->|"compares algorithms"| node_fcfs

click node_app "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/Dashboard.jsx"
click node_cpu_page "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/CPUScheduler.jsx"
click node_memory_page "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/MemoryManagement.jsx"
click node_contiguous_page "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/ContiguousAllocator.jsx"
click node_paging_page "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/PagingSimulator.jsx"
click node_virtual_page "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/VirtualMemory.jsx"
click node_segment_page "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/SegmentationSimulator.jsx"
click node_filesystem_page "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/FileSystem.jsx"
click node_shared_visuals "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/components/ProcessTimeline.jsx"
click node_api_client "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/services/api.js"
click node_backend_app "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/main.py"
click node_scheduler_routes "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/scheduler_routes.py"
click node_memory_routes "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/memory_routes.py"
click node_filesystem_routes "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/filesystem_routes.py"
click node_scenario_routes "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/scenario_routes.py"
click node_scheduler_engine "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/base_scheduler.py"
click node_fcfs "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/fcfs.py"
click node_sjf "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/sjf.py"
click node_priority "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/priority.py"
click node_round_robin "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/round_robin.py"
click node_contiguous_engine "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/contiguous.py"
click node_paging_engine "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/paging.py"
click node_replacement "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/page_replacement.py"
click node_segmentation_engine "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/segmentation.py"
click node_filesystem_engine "https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/filesystem/filesystem.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_cpu_page,node_memory_page,node_contiguous_page,node_paging_page,node_virtual_page,node_segment_page,node_filesystem_page,node_shared_visuals,node_api_client toneBlue
class node_backend_app,node_scheduler_routes,node_memory_routes,node_filesystem_routes,node_scenario_routes toneAmber
class node_scheduler_engine,node_fcfs,node_sjf,node_priority,node_round_robin toneMint
class node_contiguous_engine,node_paging_engine,node_replacement,node_segmentation_engine toneRose
class node_filesystem_engine,node_learner toneIndigo
```

## Components

### Web interface

- [Application routes](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [CPU simulator](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/CPUScheduler.jsx): `frontend/src/pages/CPUScheduler.jsx`
- [Memory hub](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/MemoryManagement.jsx): `frontend/src/pages/MemoryManagement.jsx`
- [Contiguous allocator](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/ContiguousAllocator.jsx): `frontend/src/pages/ContiguousAllocator.jsx`
- [Paging simulator](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/PagingSimulator.jsx): `frontend/src/pages/PagingSimulator.jsx`
- [Virtual memory](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/VirtualMemory.jsx): `frontend/src/pages/VirtualMemory.jsx`
- [Segmentation simulator](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/SegmentationSimulator.jsx): `frontend/src/pages/SegmentationSimulator.jsx`
- [File-system simulator](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/pages/FileSystem.jsx): `frontend/src/pages/FileSystem.jsx`
- [Simulation displays](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/components/ProcessTimeline.jsx): `frontend/src/components/ProcessTimeline.jsx`
- [API client](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Backend API

- [FastAPI application](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/main.py): `backend/main.py`
- [Scheduling routes](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/scheduler_routes.py): `backend/routes/scheduler_routes.py`
- [Memory routes](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/memory_routes.py): `backend/routes/memory_routes.py`
- [File-system routes](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/filesystem_routes.py): `backend/routes/filesystem_routes.py`
- [Scenario routes](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/routes/scenario_routes.py): `backend/routes/scenario_routes.py`

### CPU scheduling

- [Scheduler framework](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/base_scheduler.py): `backend/schedulers/base_scheduler.py`
- [FCFS](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/fcfs.py): `backend/schedulers/fcfs.py`
- [SJF / SRTF](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/sjf.py): `backend/schedulers/sjf.py`
- [Priority scheduling](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/priority.py): `backend/schedulers/priority.py`
- [Round Robin](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/schedulers/round_robin.py): `backend/schedulers/round_robin.py`

### Memory management

- [Contiguous allocation](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/contiguous.py): `backend/memory/contiguous.py`
- [Paging and translation](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/paging.py): `backend/memory/paging.py`
- [Page replacement](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/page_replacement.py): `backend/memory/page_replacement.py`
- [Segmentation](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/memory/segmentation.py): `backend/memory/segmentation.py`

### File system

- [File-system model](https://github.com/ayushkumar418/os_simulator-web_app/blob/main/backend/filesystem/filesystem.py): `backend/filesystem/filesystem.py`

### Other components

- **Learner**

## Connections

- Learner → Application routes: navigates
- Application routes → Dashboard: routes
- Application routes → CPU simulator: routes
- Application routes → Memory hub: routes
- Application routes → Contiguous allocator: routes
- Application routes → Paging simulator: routes
- Application routes → Virtual memory: routes
- Application routes → Segmentation simulator: routes
- Application routes → File-system simulator: routes
- CPU simulator → API client: requests
- Contiguous allocator → API client: requests
- Paging simulator → API client: requests
- Virtual memory → API client: requests
- Segmentation simulator → API client: requests
- File-system simulator → API client: requests
- API client → FastAPI application: HTTP requests
- FastAPI application → Scheduling routes: dispatches
- FastAPI application → Memory routes: dispatches
- FastAPI application → File-system routes: dispatches
- FastAPI application → Scenario routes: dispatches
- Scheduling routes → Scheduler framework: runs / measures
- Scheduling routes → FCFS: selects
- Scheduling routes → SJF / SRTF: selects
- Scheduling routes → Priority scheduling: selects
- Scheduling routes → Round Robin: selects
- FCFS → Scheduler framework: extends
- SJF / SRTF → Scheduler framework: extends
- Priority scheduling → Scheduler framework: extends
- Round Robin → Scheduler framework: extends
- Scheduling routes → API client: returns results
- Memory routes → Contiguous allocation: allocates
- Memory routes → Paging and translation: translates
- Memory routes → Page replacement: uses algorithms
- Memory routes → Segmentation: manages segments
- Memory routes → API client: returns state
- File-system routes → File-system model: operates on
- File-system routes → API client: returns state
- Scenario routes → API client: serves scenarios
- CPU simulator → Simulation displays: displays simulation
- Scheduling routes → FCFS: compares algorithms
