# shreyask95/simulator_finalyr_proj architecture

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

- Interactive diagram: https://gitdiagram.com/shreyask95/simulator_finalyr_proj
- Repository: https://github.com/shreyask95/simulator_finalyr_proj

## Overview

SVU Simulator is a browser-based educational robotics simulator with an integrated programming environment. The primary workflow is a user opening a scene or challenge, editing or running a robot program, and observing the simulated scene; the app also exposes tutorials, leaderboard, and curriculum routes. The graph highlights scene/script coordination, worker-based programming, Redux state, and authentication/consent. Relationship evidence is limited to the supplied excerpts and README; unsampled feature internals are represented only where the tree or README supports them.

Main entry points: [`src/App.tsx`](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/App.tsx) (App routing), [`src/pages/Root.tsx`](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/Root.tsx) (Scene workspace), [`src/simulator/ScriptManager.ts`](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/simulator/ScriptManager.ts) (Script manager), [`src/programming/WorkerInstance.ts`](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/programming/WorkerInstance.ts) (Worker instance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App routing<br/>[App.tsx]"]
  node_scene_ui["Scene workspace<br/>[Root.tsx]"]
  node_challenge_ui["Challenge flow<br/>[ChallengeRoot.tsx]"]
  node_curriculum["Curriculum<br/>[CurriculumPage.tsx]"]
  node_tutorials["Tutorials<br/>[Tutorials.tsx]"]
  node_leaderboard["Leaderboard<br/>[Leaderboard.tsx]"]
end

subgraph group_sim["Simulation"]
  node_scene_model["Scene model<br/>[index.ts]"]
  node_script_manager["Script manager<br/>[ScriptManager.ts]"]
  node_challenge_defs["Challenge definitions"]
  node_scene_defs["Scene definitions"]
end

subgraph group_program["Programming"]
  node_program_worker["Worker instance<br/>[WorkerInstance.ts]"]
  node_worker_runtime["Worker runtime<br/>[worker.ts]"]
  node_python_runtime["Python support<br/>[index.ts]"]
end

subgraph group_platform["State and services"]
  node_redux[("Application state<br/>[index.ts]")]
  node_auth["Firebase auth<br/>[firebaseAuth.js]"]
  node_token_manager["Firebase tokens"]
  node_consent["Legal consent"]
  node_localized["Localized strings<br/>[LocalizedString.ts]"]
end

node_user(("Learner"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_scene_ui
node_app -->|"routes to"| node_challenge_ui
node_app -->|"routes to"| node_curriculum
node_app -->|"routes to"| node_tutorials
node_app -->|"routes to"| node_leaderboard
node_app -->|"checks consent"| node_consent
node_app -->|"observes sign-in"| node_auth
node_scene_ui -.->|"manages scripts"| node_script_manager
node_script_manager -->|"accesses scene"| node_scene_model
node_challenge_ui -.->|"loads challenge"| node_challenge_defs
node_scene_ui -.->|"loads scene"| node_scene_defs
node_program_worker -.->|"starts worker"| node_worker_runtime
node_worker_runtime -->|"uses Python"| node_python_runtime
node_program_worker -->|"updates robot"| node_script_manager
node_app -->|"reads state"| node_redux
node_auth -.->|"uses tokens"| node_token_manager
node_scene_model -->|"uses labels"| node_localized

click node_app "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/App.tsx"
click node_scene_ui "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/Root.tsx"
click node_challenge_ui "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/ChallengeRoot.tsx"
click node_curriculum "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/lms/CurriculumPage.tsx"
click node_tutorials "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/Tutorials.tsx"
click node_leaderboard "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/Leaderboard.tsx"
click node_scene_model "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/state/State/Scene/index.ts"
click node_script_manager "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/simulator/ScriptManager.ts"
click node_challenge_defs "https://github.com/shreyask95/simulator_finalyr_proj/tree/main/src/simulator/definitions/challenges"
click node_scene_defs "https://github.com/shreyask95/simulator_finalyr_proj/tree/main/src/simulator/definitions/scenes"
click node_program_worker "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/programming/WorkerInstance.ts"
click node_worker_runtime "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/programming/worker/worker.ts"
click node_python_runtime "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/programming/python/index.ts"
click node_redux "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/state/index.ts"
click node_auth "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/firebaseAuth.js"
click node_token_manager "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/firebase/FirebaseTokenManager.ts"
click node_consent "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/consent/LegalAcceptance.tsx"
click node_localized "https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/util/LocalizedString.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_scene_ui,node_challenge_ui,node_curriculum,node_tutorials,node_leaderboard toneBlue
class node_scene_model,node_script_manager,node_challenge_defs,node_scene_defs toneAmber
class node_program_worker,node_worker_runtime,node_python_runtime toneMint
class node_redux,node_auth,node_token_manager,node_consent,node_localized toneRose
class node_user toneIndigo
```

## Components

### Application

- [App routing](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/App.tsx): `src/App.tsx`
- [Scene workspace](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/Root.tsx): `src/pages/Root.tsx`
- [Challenge flow](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/ChallengeRoot.tsx): `src/pages/ChallengeRoot.tsx`
- [Curriculum](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/lms/CurriculumPage.tsx): `src/lms/CurriculumPage.tsx`
- [Tutorials](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/Tutorials.tsx): `src/pages/Tutorials.tsx`
- [Leaderboard](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/pages/Leaderboard.tsx): `src/pages/Leaderboard.tsx`

### Simulation

- [Scene model](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/state/State/Scene/index.ts): `src/state/State/Scene/index.ts`
- [Script manager](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/simulator/ScriptManager.ts): `src/simulator/ScriptManager.ts`
- [Challenge definitions](https://github.com/shreyask95/simulator_finalyr_proj/tree/main/src/simulator/definitions/challenges): `src/simulator/definitions/challenges`
- [Scene definitions](https://github.com/shreyask95/simulator_finalyr_proj/tree/main/src/simulator/definitions/scenes): `src/simulator/definitions/scenes`

### Programming

- [Worker instance](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/programming/WorkerInstance.ts): `src/programming/WorkerInstance.ts`
- [Worker runtime](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/programming/worker/worker.ts): `src/programming/worker/worker.ts`
- [Python support](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/programming/python/index.ts): `src/programming/python/index.ts`

### State and services

- [Application state](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/state/index.ts): `src/state/index.ts`
- [Firebase auth](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/firebaseAuth.js): `firebaseAuth.js`
- [Firebase tokens](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/firebase/FirebaseTokenManager.ts): `src/firebase/FirebaseTokenManager.ts`
- [Legal consent](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/consent/LegalAcceptance.tsx): `src/consent/LegalAcceptance.tsx`
- [Localized strings](https://github.com/shreyask95/simulator_finalyr_proj/blob/main/src/util/LocalizedString.ts): `src/util/LocalizedString.ts`

### Other components

- **Learner**

## Connections

- Learner → App routing: opens (evidence: `README.md`)
- App routing → Scene workspace: routes to (evidence: `src/App.tsx`)
- App routing → Challenge flow: routes to (evidence: `src/App.tsx`)
- App routing → Curriculum: routes to (evidence: `src/App.tsx`)
- App routing → Tutorials: routes to (evidence: `src/App.tsx`)
- App routing → Leaderboard: routes to (evidence: `src/App.tsx`)
- App routing → Legal consent: checks consent (evidence: `src/App.tsx`)
- App routing → Firebase auth: observes sign-in (evidence: `src/App.tsx`)
- Scene workspace → Script manager: manages scripts
- Script manager → Scene model: accesses scene (evidence: `src/simulator/ScriptManager.ts`)
- Challenge flow → Challenge definitions: loads challenge
- Scene workspace → Scene definitions: loads scene
- Worker instance → Worker runtime: starts worker
- Worker runtime → Python support: uses Python (evidence: `src/programming/worker/worker.ts`)
- Worker instance → Script manager: updates robot (evidence: `src/simulator/ScriptManager.ts`)
- App routing → Application state: reads state (evidence: `src/App.tsx`)
- Firebase auth → Firebase tokens: uses tokens
- Scene model → Localized strings: uses labels (evidence: `src/state/State/Scene/index.ts`)
