# rmishr-1/playwright_learning_studio architecture

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

- Interactive diagram: https://gitdiagram.com/rmishr-1/playwright_learning_studio
- Repository: https://github.com/rmishr-1/playwright_learning_studio

## Overview

Playwright Learning Studio teaches a Playwright and TypeScript course: learners browse lessons, edit exercise code, and run it against a practice site, with live browser, console, and terminal feedback. The SPA calls the loopback backend for course content, progress, checks, and runs; the backend owns persistence and execution. The desktop launcher is a separate delivery mode that downloads and starts the studio and course. Links reflect the excerpts and SOURCE INDEX; unsampled components are included only where the README documents their role.

Main entry points: [`backend/src/routes.ts`](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/routes.ts) (API routes), [`frontend-c/src/api/client.ts`](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/api/client.ts) (API client), [`desktop/src/main.ts`](https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/main.ts) (Desktop launcher), [`backend/src/server.ts`](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/server.ts) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learner["Learner experience"]
  node_spa["React studio<br/>[App.tsx]"]
  node_lesson["Lesson screens<br/>[Day.tsx]"]
  node_lesson_blocks["Lesson blocks<br/>[LessonBlocks.tsx]"]
  node_run_panels["Run panels<br/>[RunOverlay.tsx]"]
  node_terminal_ui["Terminal panel<br/>[TerminalView.tsx]"]
  node_api["API client<br/>[client.ts]"]
  node_terminal_session["Terminal session<br/>[terminalSession.ts]"]
end

subgraph group_backend["Studio backend"]
  node_backend_server["HTTP server<br/>[server.ts]"]
  node_routes["API routes<br/>[routes.ts]"]
  node_content["Course content<br/>[content.ts]"]
  node_progress_store[("Progress storage<br/>[store.ts]")]
  node_runner["Code runner<br/>[runner.ts]"]
  node_preview["Practice preview<br/>[preview.ts]"]
  node_terminal["Terminal service<br/>[index.ts]"]
  node_workspace["Learner workspace<br/>[workspace.ts]"]
end

subgraph group_contracts["Shared contracts"]
  node_contracts["Wire contracts<br/>[course_day.ts]"]
end

subgraph group_desktop["Desktop launcher"]
  node_desktop_launcher["Desktop launcher<br/>[main.ts]"]
  node_release["Release handling<br/>[release.ts]"]
  node_runtime_install["Runtime install<br/>[runtime-install.ts]"]
  node_desktop_licence["Licence handling<br/>[licence.ts]"]
end

node_learner(("Learner"))
node_practice_site["Practice website"]
node_browser["Learner browser"]

node_learner -->|"uses"| node_spa
node_spa -->|"routes to"| node_lesson
node_lesson -->|"renders"| node_lesson_blocks
node_lesson_blocks -.->|"loads lesson data"| node_api
node_lesson -.->|"requests content and progress"| node_api
node_api -->|"sends API requests"| node_backend_server
node_backend_server -->|"mounts API"| node_routes
node_routes -->|"reads course"| node_content
node_routes -->|"reads and updates"| node_progress_store
node_routes -->|"prepares and starts"| node_runner
node_routes -->|"dispatches commands"| node_terminal
node_routes -->|"reads learner files"| node_workspace
node_runner -.->|"drives browser"| node_practice_site
node_routes -.->|"serves preview pages"| node_preview
node_backend_server -->|"serves preview"| node_preview
node_api -.->|"streams run events"| node_run_panels
node_run_panels -.->|"shows terminal"| node_terminal_ui
node_terminal_ui -.->|"sends terminal input"| node_terminal_session
node_terminal_session -.->|"calls terminal API"| node_api
node_terminal -->|"saves and resolves files"| node_workspace
node_contracts -->|"types API data"| node_api
node_contracts -.->|"validates requests"| node_routes
node_desktop_launcher -->|"checks licence"| node_desktop_licence
node_desktop_launcher -->|"opens release"| node_release
node_desktop_launcher -->|"ensures runtime"| node_runtime_install
node_desktop_launcher -.->|"opens studio window"| node_browser
node_desktop_launcher -.->|"starts embedded studio"| node_backend_server

click node_spa "https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/App.tsx"
click node_lesson "https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/screens/Day.tsx"
click node_lesson_blocks "https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/components/LessonBlocks.tsx"
click node_run_panels "https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/components/RunOverlay.tsx"
click node_terminal_ui "https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/components/TerminalView.tsx"
click node_api "https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/api/client.ts"
click node_terminal_session "https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/lib/terminalSession.ts"
click node_backend_server "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/server.ts"
click node_routes "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/routes.ts"
click node_content "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/content.ts"
click node_progress_store "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/store.ts"
click node_runner "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/runner.ts"
click node_preview "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/preview.ts"
click node_terminal "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/terminal/index.ts"
click node_workspace "https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/terminal/workspace.ts"
click node_contracts "https://github.com/rmishr-1/playwright_learning_studio/blob/main/shared/contracts/course_day.ts"
click node_desktop_launcher "https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/main.ts"
click node_release "https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/release.ts"
click node_runtime_install "https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/runtime-install.ts"
click node_desktop_licence "https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/licence.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_spa,node_lesson,node_lesson_blocks,node_run_panels,node_terminal_ui,node_api,node_terminal_session,node_browser toneBlue
class node_backend_server,node_routes,node_content,node_progress_store,node_runner,node_preview,node_terminal,node_workspace toneAmber
class node_contracts toneMint
class node_desktop_launcher,node_release,node_runtime_install,node_desktop_licence toneRose
class node_learner,node_practice_site toneIndigo
```

## Components

### Learner experience

- [React studio](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/App.tsx): `frontend-c/src/App.tsx`
- [Lesson screens](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/screens/Day.tsx): `frontend-c/src/screens/Day.tsx`
- [Lesson blocks](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/components/LessonBlocks.tsx): `frontend-c/src/components/LessonBlocks.tsx`
- [Run panels](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/components/RunOverlay.tsx): `frontend-c/src/components/RunOverlay.tsx`
- [Terminal panel](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/components/TerminalView.tsx): `frontend-c/src/components/TerminalView.tsx`
- [API client](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/api/client.ts): `frontend-c/src/api/client.ts`
- [Terminal session](https://github.com/rmishr-1/playwright_learning_studio/blob/main/frontend-c/src/lib/terminalSession.ts): `frontend-c/src/lib/terminalSession.ts`

### Studio backend

- [HTTP server](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [API routes](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/routes.ts): `backend/src/routes.ts`
- [Course content](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/content.ts): `backend/src/content.ts`
- [Progress storage](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/store.ts): `backend/src/store.ts`
- [Code runner](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/runner.ts): `backend/src/runner.ts`
- [Practice preview](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/preview.ts): `backend/src/preview.ts`
- [Terminal service](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/terminal/index.ts): `backend/src/terminal/index.ts`
- [Learner workspace](https://github.com/rmishr-1/playwright_learning_studio/blob/main/backend/src/terminal/workspace.ts): `backend/src/terminal/workspace.ts`

### Shared contracts

- [Wire contracts](https://github.com/rmishr-1/playwright_learning_studio/blob/main/shared/contracts/course_day.ts): `shared/contracts/course_day.ts`

### Desktop launcher

- [Desktop launcher](https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/main.ts): `desktop/src/main.ts`
- [Release handling](https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/release.ts): `desktop/src/release.ts`
- [Runtime install](https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/runtime-install.ts): `desktop/src/runtime-install.ts`
- [Licence handling](https://github.com/rmishr-1/playwright_learning_studio/blob/main/desktop/src/licence.ts): `desktop/src/licence.ts`

### Other components

- **Learner**
- **Practice website**
- **Learner browser**

## Connections

- Learner → React studio: uses (evidence: `README.md`)
- React studio → Lesson screens: routes to (evidence: `frontend-c/src/App.tsx`)
- Lesson screens → Lesson blocks: renders (evidence: `frontend-c/src/components/LessonBlocks.tsx`)
- Lesson blocks → API client: loads lesson data (evidence: `frontend-c/src/api/client.ts`)
- Lesson screens → API client: requests content and progress
- API client → HTTP server: sends API requests (evidence: `frontend-c/src/api/client.ts`)
- HTTP server → API routes: mounts API (evidence: `backend/src/server.ts`)
- API routes → Course content: reads course (evidence: `backend/src/routes.ts`)
- API routes → Progress storage: reads and updates (evidence: `backend/src/routes.ts`)
- API routes → Code runner: prepares and starts (evidence: `backend/src/routes.ts`)
- API routes → Terminal service: dispatches commands (evidence: `backend/src/routes.ts`)
- API routes → Learner workspace: reads learner files (evidence: `backend/src/routes.ts`)
- Code runner → Practice website: drives browser
- API routes → Practice preview: serves preview pages (evidence: `backend/src/routes.ts`)
- HTTP server → Practice preview: serves preview (evidence: `backend/src/server.ts`)
- API client → Run panels: streams run events
- Run panels → Terminal panel: shows terminal
- Terminal panel → Terminal session: sends terminal input
- Terminal session → API client: calls terminal API (evidence: `frontend-c/src/lib/terminalSession.ts`)
- Terminal service → Learner workspace: saves and resolves files (evidence: `backend/src/terminal/index.ts`)
- Wire contracts → API client: types API data (evidence: `frontend-c/src/api/client.ts`)
- Wire contracts → API routes: validates requests (evidence: `backend/src/routes.ts`)
- Desktop launcher → Licence handling: checks licence (evidence: `desktop/src/main.ts`)
- Desktop launcher → Release handling: opens release (evidence: `desktop/src/main.ts`)
- Desktop launcher → Runtime install: ensures runtime (evidence: `desktop/src/main.ts`)
- Desktop launcher → Learner browser: opens studio window
- Desktop launcher → HTTP server: starts embedded studio
