# 1m7md-cs/cpu-scheduling-simulator architecture

> Architecture diagram of the GitHub repository 1m7md-cs/cpu-scheduling-simulator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/1m7md-cs/cpu-scheduling-simulator
- Repository: https://github.com/1m7md-cs/cpu-scheduling-simulator

## Overview

CPU Scheduling Simulator is an Angular web app for registering or logging in, then configuring CPU processes and viewing a scheduling simulation. The guarded scheduler supports FCFS, SJF, and Priority algorithms and presents a timeline and timing metrics. Authentication state and user records are handled client-side through local storage; password hashing uses bcryptjs. The graph follows evidenced bootstrap, routing, component-to-service, and service-to-model relationships. Templates are represented by their owning components; unsampled UI details are not inferred.

Main entry points: [`src/app/services/authenticate.service.ts`](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/services/authenticate.service.ts) (Authentication service), [`src/app/app.routes.ts`](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/app.routes.ts) (Routes and guard), [`src/app/scheduler/scheduler.ts`](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/scheduler/scheduler.ts) (Scheduler screen), [`src/app/auth/login/login.ts`](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/auth/login/login.ts) (Login screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application Shell"]
  node_app["App shell<br/>[app.ts]"]
  node_routes["Routes and guard<br/>[app.routes.ts]"]
end

subgraph group_authentication["Authentication"]
  node_login["Login screen<br/>[login.ts]"]
  node_register["Registration screen<br/>[register.ts]"]
  node_authform["Shared auth form<br/>[form.ts]"]
  node_authservice["Authentication service"]
  node_authmodel["User and auth result"]
end

subgraph group_scheduling["CPU Scheduling"]
  node_scheduler["Scheduler screen<br/>[scheduler.ts]"]
  node_schedulerservice["Simulation algorithms"]
  node_schedulermodel["Process and result models<br/>[scheduler.model.ts]"]
end

node_user(("User"))
node_localstorage[("Browser local storage")]
node_bcrypt["bcryptjs"]

node_user -.->|"uses"| node_app
node_app -->|"hosts outlet"| node_routes
node_routes -->|"loads route"| node_login
node_routes -->|"loads route"| node_register
node_routes -->|"guards and loads"| node_scheduler
node_routes -->|"checks session"| node_authservice
node_login -->|"renders form"| node_authform
node_register -->|"renders form"| node_authform
node_login -->|"authenticates"| node_authservice
node_register -->|"registers account"| node_authservice
node_authservice -->|"uses types"| node_authmodel
node_authservice -->|"reads and writes"| node_localstorage
node_authservice -->|"hashes passwords"| node_bcrypt
node_scheduler -->|"runs simulation"| node_schedulerservice
node_scheduler -->|"logs out"| node_authservice
node_scheduler -->|"uses types"| node_schedulermodel
node_schedulerservice -->|"uses types"| node_schedulermodel

click node_app "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/app.ts"
click node_routes "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/app.routes.ts"
click node_login "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/auth/login/login.ts"
click node_register "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/auth/register/register.ts"
click node_authform "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/auth/form/form.ts"
click node_authservice "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/services/authenticate.service.ts"
click node_authmodel "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/models/authenticate.model.ts"
click node_scheduler "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/scheduler/scheduler.ts"
click node_schedulerservice "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/services/scheduler.service.ts"
click node_schedulermodel "https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/models/scheduler.model.ts"

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_routes,node_user toneBlue
class node_login,node_register,node_authform,node_authservice,node_authmodel,node_localstorage toneAmber
class node_scheduler,node_schedulerservice,node_schedulermodel toneMint
class node_bcrypt toneIndigo
```

## Components

### Application Shell

- [App shell](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/app.ts): `src/app/app.ts`
- [Routes and guard](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`

### Authentication

- [Login screen](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/auth/login/login.ts): `src/app/auth/login/login.ts`
- [Registration screen](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/auth/register/register.ts): `src/app/auth/register/register.ts`
- [Shared auth form](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/auth/form/form.ts): `src/app/auth/form/form.ts`
- [Authentication service](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/services/authenticate.service.ts): `src/app/services/authenticate.service.ts`
- [User and auth result](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/models/authenticate.model.ts): `src/app/models/authenticate.model.ts`

### CPU Scheduling

- [Scheduler screen](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/scheduler/scheduler.ts): `src/app/scheduler/scheduler.ts`
- [Simulation algorithms](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/services/scheduler.service.ts): `src/app/services/scheduler.service.ts`
- [Process and result models](https://github.com/1m7md-cs/cpu-scheduling-simulator/blob/main/src/app/models/scheduler.model.ts): `src/app/models/scheduler.model.ts`

### Other components

- **User**
- **Browser local storage**
- **bcryptjs**

## Connections

- User → App shell: uses
- App shell → Routes and guard: hosts outlet (evidence: `src/app/app.ts`)
- Routes and guard → Login screen: loads route (evidence: `src/app/app.routes.ts`)
- Routes and guard → Registration screen: loads route (evidence: `src/app/app.routes.ts`)
- Routes and guard → Scheduler screen: guards and loads (evidence: `src/app/app.routes.ts`)
- Routes and guard → Authentication service: checks session (evidence: `src/app/app.routes.ts`)
- Login screen → Shared auth form: renders form (evidence: `src/app/auth/login/login.ts`)
- Registration screen → Shared auth form: renders form (evidence: `src/app/auth/register/register.ts`)
- Login screen → Authentication service: authenticates (evidence: `src/app/auth/login/login.ts`)
- Registration screen → Authentication service: registers account (evidence: `src/app/auth/register/register.ts`)
- Authentication service → User and auth result: uses types (evidence: `src/app/services/authenticate.service.ts`)
- Authentication service → Browser local storage: reads and writes (evidence: `src/app/services/authenticate.service.ts`)
- Authentication service → bcryptjs: hashes passwords (evidence: `src/app/services/authenticate.service.ts`)
- Scheduler screen → Simulation algorithms: runs simulation (evidence: `src/app/scheduler/scheduler.ts`)
- Scheduler screen → Authentication service: logs out (evidence: `src/app/scheduler/scheduler.ts`)
- Scheduler screen → Process and result models: uses types (evidence: `src/app/scheduler/scheduler.ts`)
- Simulation algorithms → Process and result models: uses types (evidence: `src/app/services/scheduler.service.ts`)
