# programmersagara-cell/pyprof architecture

> Architecture diagram of the GitHub repository programmersagara-cell/pyprof, 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/programmersagara-cell/pyprof
- Repository: https://github.com/programmersagara-cell/pyprof

## Overview

PYTHON·LAB is a browser-based Python learning workbench. Learners move among the dashboard, lessons, challenges, debugging practice, cheat sheet, analytics and history; in the workspace they edit and run Python, inspect variables and output, and receive friendly error explanations. Challenge grading runs code against behavioral tests, while progress and execution history persist locally. The README documents capabilities beyond the sampled excerpts; their modules are included, but uncertain internal wiring is omitted.

Main entry points: [`src/main.js`](https://github.com/programmersagara-cell/pyprof/blob/main/src/main.js) (Application router), [`src/ui/workspace.js`](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/workspace.js) (Coding workspace), [`src/progress/progress.js`](https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/progress.js) (Progress and XP), [`src/engine/pythonEngine.js`](https://github.com/programmersagara-cell/pyprof/blob/main/src/engine/pythonEngine.js) (Python engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and UI"]
  node_app["Application router<br/>[main.js]"]
  node_workspace["Coding workspace<br/>[workspace.js]"]
  node_editor["Code editor<br/>[editor.js]"]
  node_dashboard["Dashboard view<br/>[dashboardView.js]"]
  node_lessonview["Lessons view<br/>[lessonsView.js]"]
  node_challengeview["Challenges view<br/>[challengeView.js]"]
  node_debugview["Debugging view<br/>[debuggingView.js]"]
  node_cheatsheetview["Cheat sheet view<br/>[cheatsheetView.js]"]
  node_analyticsview["Analytics view<br/>[analyticsView.js]"]
  node_historyview["History view<br/>[historyView.js]"]
end

subgraph group_learning["Learning content"]
  node_lessons["Lesson library<br/>[lessons.js]"]
  node_challenges["Challenge library<br/>[index.js]"]
  node_debugging["Debug exercises<br/>[debugging.js]"]
  node_cheatsheet["Cheat sheet topics<br/>[cheatsheet.js]"]
end

subgraph group_execution["Python execution"]
  node_engine["Python engine<br/>[pythonEngine.js]"]
  node_worker["Pyodide worker<br/>[pyodideWorker.js]"]
  node_errors["Error explanations<br/>[errorHandler.js]"]
end

subgraph group_assessment["Assessment and progress"]
  node_validator["Challenge validator<br/>[validator.js]"]
  node_test_runner["Test runner<br/>[testRunner.js]"]
  node_progress["Progress and XP<br/>[progress.js]"]
  node_badges["Badge system<br/>[badges.js]"]
  node_analytics["Learning analytics<br/>[analytics.js]"]
end

subgraph group_persistence["Local data"]
  node_history["Execution history<br/>[history.js]"]
  node_store["Local storage adapter<br/>[store.js]"]
end

node_learner(("Learner"))
node_pyodide(("Pyodide CDN"))
node_localstorage[("Browser localStorage")]

node_learner -->|"chooses views"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_workspace
node_app -->|"renders"| node_lessonview
node_app -->|"renders"| node_challengeview
node_app -->|"renders"| node_debugview
node_app -->|"renders"| node_cheatsheetview
node_app -->|"renders"| node_analyticsview
node_app -->|"renders"| node_historyview
node_lessonview -->|"reads lessons"| node_lessons
node_challengeview -->|"reads challenges"| node_challenges
node_debugview -->|"reads exercises"| node_debugging
node_cheatsheetview -->|"reads topics"| node_cheatsheet
node_workspace -->|"creates editor"| node_editor
node_workspace -->|"runs code"| node_engine
node_engine -->|"posts commands"| node_worker
node_worker -->|"returns results"| node_engine
node_worker -.->|"loads runtime"| node_pyodide
node_workspace -->|"explains errors"| node_errors
node_validator -->|"runs test cases"| node_engine
node_test_runner -->|"runs validation"| node_validator
node_workspace -->|"records runs"| node_history
node_workspace -->|"records activity"| node_progress
node_progress -->|"checks badges"| node_badges
node_analyticsview -->|"requests insights"| node_analytics
node_analytics -->|"reads progress"| node_progress
node_historyview -->|"browses history"| node_history
node_history -->|"persists history"| node_store
node_progress -->|"persists progress"| node_store
node_store -->|"reads and writes"| node_localstorage

click node_app "https://github.com/programmersagara-cell/pyprof/blob/main/src/main.js"
click node_workspace "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/workspace.js"
click node_editor "https://github.com/programmersagara-cell/pyprof/blob/main/src/editor/editor.js"
click node_dashboard "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/dashboardView.js"
click node_lessonview "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/lessonsView.js"
click node_challengeview "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/challengeView.js"
click node_debugview "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/debuggingView.js"
click node_cheatsheetview "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/cheatsheetView.js"
click node_analyticsview "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/analyticsView.js"
click node_historyview "https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/historyView.js"
click node_lessons "https://github.com/programmersagara-cell/pyprof/blob/main/src/lessons/lessons.js"
click node_challenges "https://github.com/programmersagara-cell/pyprof/blob/main/src/challenges/index.js"
click node_debugging "https://github.com/programmersagara-cell/pyprof/blob/main/src/challenges/debugging.js"
click node_cheatsheet "https://github.com/programmersagara-cell/pyprof/blob/main/src/cheatsheet/cheatsheet.js"
click node_engine "https://github.com/programmersagara-cell/pyprof/blob/main/src/engine/pythonEngine.js"
click node_worker "https://github.com/programmersagara-cell/pyprof/blob/main/src/engine/pyodideWorker.js"
click node_errors "https://github.com/programmersagara-cell/pyprof/blob/main/src/engine/errorHandler.js"
click node_validator "https://github.com/programmersagara-cell/pyprof/blob/main/src/validation/validator.js"
click node_test_runner "https://github.com/programmersagara-cell/pyprof/blob/main/src/validation/testRunner.js"
click node_progress "https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/progress.js"
click node_badges "https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/badges.js"
click node_analytics "https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/analytics.js"
click node_history "https://github.com/programmersagara-cell/pyprof/blob/main/src/history/history.js"
click node_store "https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/store.js"

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_workspace,node_editor,node_dashboard,node_lessonview,node_challengeview,node_debugview,node_cheatsheetview,node_analyticsview,node_historyview toneBlue
class node_lessons,node_challenges,node_debugging,node_cheatsheet,node_localstorage toneAmber
class node_engine,node_worker,node_errors toneMint
class node_validator,node_test_runner,node_progress,node_badges,node_analytics toneRose
class node_history,node_store,node_learner,node_pyodide toneIndigo
```

## Components

### Application and UI

- [Application router](https://github.com/programmersagara-cell/pyprof/blob/main/src/main.js): `src/main.js`
- [Coding workspace](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/workspace.js): `src/ui/workspace.js`
- [Code editor](https://github.com/programmersagara-cell/pyprof/blob/main/src/editor/editor.js): `src/editor/editor.js`
- [Dashboard view](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/dashboardView.js): `src/ui/dashboardView.js`
- [Lessons view](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/lessonsView.js): `src/ui/lessonsView.js`
- [Challenges view](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/challengeView.js): `src/ui/challengeView.js`
- [Debugging view](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/debuggingView.js): `src/ui/debuggingView.js`
- [Cheat sheet view](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/cheatsheetView.js): `src/ui/cheatsheetView.js`
- [Analytics view](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/analyticsView.js): `src/ui/analyticsView.js`
- [History view](https://github.com/programmersagara-cell/pyprof/blob/main/src/ui/historyView.js): `src/ui/historyView.js`

### Learning content

- [Lesson library](https://github.com/programmersagara-cell/pyprof/blob/main/src/lessons/lessons.js): `src/lessons/lessons.js`
- [Challenge library](https://github.com/programmersagara-cell/pyprof/blob/main/src/challenges/index.js): `src/challenges/index.js`
- [Debug exercises](https://github.com/programmersagara-cell/pyprof/blob/main/src/challenges/debugging.js): `src/challenges/debugging.js`
- [Cheat sheet topics](https://github.com/programmersagara-cell/pyprof/blob/main/src/cheatsheet/cheatsheet.js): `src/cheatsheet/cheatsheet.js`

### Python execution

- [Python engine](https://github.com/programmersagara-cell/pyprof/blob/main/src/engine/pythonEngine.js): `src/engine/pythonEngine.js`
- [Pyodide worker](https://github.com/programmersagara-cell/pyprof/blob/main/src/engine/pyodideWorker.js): `src/engine/pyodideWorker.js`
- [Error explanations](https://github.com/programmersagara-cell/pyprof/blob/main/src/engine/errorHandler.js): `src/engine/errorHandler.js`

### Assessment and progress

- [Challenge validator](https://github.com/programmersagara-cell/pyprof/blob/main/src/validation/validator.js): `src/validation/validator.js`
- [Test runner](https://github.com/programmersagara-cell/pyprof/blob/main/src/validation/testRunner.js): `src/validation/testRunner.js`
- [Progress and XP](https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/progress.js): `src/progress/progress.js`
- [Badge system](https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/badges.js): `src/progress/badges.js`
- [Learning analytics](https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/analytics.js): `src/progress/analytics.js`

### Local data

- [Execution history](https://github.com/programmersagara-cell/pyprof/blob/main/src/history/history.js): `src/history/history.js`
- [Local storage adapter](https://github.com/programmersagara-cell/pyprof/blob/main/src/progress/store.js): `src/progress/store.js`

### Other components

- **Learner**
- **Pyodide CDN**
- **Browser localStorage**

## Connections

- Learner → Application router: chooses views
- Application router → Dashboard view: renders
- Application router → Coding workspace: renders
- Application router → Lessons view: renders
- Application router → Challenges view: renders
- Application router → Debugging view: renders
- Application router → Cheat sheet view: renders
- Application router → Analytics view: renders
- Application router → History view: renders
- Lessons view → Lesson library: reads lessons
- Challenges view → Challenge library: reads challenges
- Debugging view → Debug exercises: reads exercises
- Cheat sheet view → Cheat sheet topics: reads topics
- Coding workspace → Code editor: creates editor
- Coding workspace → Python engine: runs code
- Python engine → Pyodide worker: posts commands
- Pyodide worker → Python engine: returns results
- Pyodide worker → Pyodide CDN: loads runtime
- Coding workspace → Error explanations: explains errors
- Challenge validator → Python engine: runs test cases
- Test runner → Challenge validator: runs validation
- Coding workspace → Execution history: records runs
- Coding workspace → Progress and XP: records activity
- Progress and XP → Badge system: checks badges
- Analytics view → Learning analytics: requests insights
- Learning analytics → Progress and XP: reads progress
- History view → Execution history: browses history
- Execution history → Local storage adapter: persists history
- Progress and XP → Local storage adapter: persists progress
- Local storage adapter → Browser localStorage: reads and writes
