# arshie13/devsim architecture

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

- Interactive diagram: https://gitdiagram.com/arshie13/devsim
- Repository: https://github.com/arshie13/devsim

## Overview

DevSim is a project-based full-stack learning platform. Learners choose a technology stack and scenario, then work through sprint tasks in a containerized coding workspace; completion feeds learning progress and rewards. The README documents editor, terminal, preview, tests, AI help, and takeaways as workspace capabilities. The graph reflects those documented capabilities and sampled route behavior; unsampled subsystem wiring is intentionally left unspecified.

Main entry points: [`src/lib/server/client.ts`](https://github.com/arshie13/devsim/blob/main/src/lib/server/client.ts) (Application database), [`src/lib/components/workspace/EditorPanel.svelte`](https://github.com/arshie13/devsim/blob/main/src/lib/components/workspace/EditorPanel.svelte) (Editor and task UI), [`src/routes/api/user/postassessment/+server.ts`](https://github.com/arshie13/devsim/blob/main/src/routes/api/user/postassessment/%2Bserver.ts) (Assessments), [`src/routes/workspace/[containerId]/+page.server.ts`](https://github.com/arshie13/devsim/blob/main/src/routes/workspace/%5BcontainerId%5D/%2Bpage.server.ts) (Workspace loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning journey"]
  node_stack_selection["Stack selection<br/>[+page.server.ts]"]
  node_scenario_selection["Scenario selection<br/>[+page.server.ts]"]
  node_assessment["Assessments<br/>[+server.ts]"]
  node_onboarding["Stack tutorials"]
end

subgraph group_workspace["Coding workspace"]
  node_workspace_route["Workspace loading<br/>[+page.server.ts]"]
  node_workspace_ui["Editor and task UI<br/>[EditorPanel.svelte]"]
  node_docker_api["Container endpoints<br/>[+server.ts]"]
  node_container_service["Container service"]
  node_docker_runtime["Docker runtime<br/>[client.ts]"]
  node_terminal_ws["Terminal WebSocket<br/>[terminal.ts]"]
  node_ai_help["AI assistance<br/>[index.ts]"]
  node_sprint_submit["Sprint submission<br/>[+server.ts]"]
end

subgraph group_progress["Progress and rewards"]
  node_dashboard["Dashboard<br/>[+page.server.ts]"]
  node_stats["Stats and rankings<br/>[index.ts]"]
  node_achievements["Achievements<br/>[progress.ts]"]
  node_learner_pass["Learner Pass<br/>[learnerPass.ts]"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_data_access["Data access"]
  node_database[("Application database<br/>[client.ts]")]
end

node_learner(("Learner"))
node_ai_provider{{"AI provider"}}
node_stripe{{"Stripe"}}
node_docker{{"Docker"}}

node_learner -->|"chooses stack"| node_stack_selection
node_stack_selection -->|"selects scenario"| node_scenario_selection
node_learner -->|"submits assessment"| node_assessment
node_learner -->|"starts tutorial"| node_onboarding
node_learner -->|"opens workspace"| node_workspace_route
node_workspace_route -->|"loads workspace"| node_workspace_ui
node_workspace_route -->|"reads workspace data"| node_database
node_docker_api -->|"requests container action"| node_container_service
node_container_service -->|"manages container"| node_docker_runtime
node_docker_runtime -->|"controls containers"| node_docker
node_workspace_ui -->|"opens terminal"| node_terminal_ws
node_workspace_ui -->|"manages project files"| node_docker_api
node_workspace_ui -->|"requests guidance"| node_ai_help
node_ai_help -.->|"requests AI response"| node_ai_provider
node_workspace_ui -->|"submits sprint"| node_sprint_submit
node_sprint_submit -->|"records completion"| node_database
node_learner -->|"views progress"| node_dashboard
node_dashboard -->|"loads statistics"| node_stats
node_stats -->|"reads user progress"| node_database
node_learner -->|"manages pass"| node_learner_pass
node_learner_pass -.->|"processes payment"| node_stripe
node_assessment -.->|"grades reflections"| node_ai_provider
node_assessment -->|"stores scores"| node_database
node_auth -->|"reads identity data"| node_database
node_data_access -->|"accesses records"| node_database

click node_stack_selection "https://github.com/arshie13/devsim/blob/main/src/routes/stacks/%2Bpage.server.ts"
click node_scenario_selection "https://github.com/arshie13/devsim/blob/main/src/routes/scenario/%2Bpage.server.ts"
click node_assessment "https://github.com/arshie13/devsim/blob/main/src/routes/api/user/postassessment/%2Bserver.ts"
click node_onboarding "https://github.com/arshie13/devsim/blob/main/src/lib/components/onboarding/OnboardingController.svelte"
click node_workspace_route "https://github.com/arshie13/devsim/blob/main/src/routes/workspace/%5BcontainerId%5D/%2Bpage.server.ts"
click node_workspace_ui "https://github.com/arshie13/devsim/blob/main/src/lib/components/workspace/EditorPanel.svelte"
click node_docker_api "https://github.com/arshie13/devsim/blob/main/src/routes/api/docker/container/create/%2Bserver.ts"
click node_container_service "https://github.com/arshie13/devsim/blob/main/src/lib/layers/service/ContainerService.ts"
click node_docker_runtime "https://github.com/arshie13/devsim/blob/main/src/lib/server/docker/client.ts"
click node_terminal_ws "https://github.com/arshie13/devsim/blob/main/src/lib/server/websocket/terminal.ts"
click node_ai_help "https://github.com/arshie13/devsim/blob/main/src/lib/ai/index.ts"
click node_sprint_submit "https://github.com/arshie13/devsim/blob/main/src/routes/api/docker/container/%5Bid%5D/submit/%2Bserver.ts"
click node_dashboard "https://github.com/arshie13/devsim/blob/main/src/routes/dashboard/%2Bpage.server.ts"
click node_stats "https://github.com/arshie13/devsim/blob/main/src/lib/server/stats/index.ts"
click node_achievements "https://github.com/arshie13/devsim/blob/main/src/lib/server/achievements/progress.ts"
click node_learner_pass "https://github.com/arshie13/devsim/blob/main/src/lib/server/learnerPass.ts"
click node_auth "https://github.com/arshie13/devsim/blob/main/src/auth.ts"
click node_data_access "https://github.com/arshie13/devsim/blob/main/src/lib/layers/data-access/WorkspaceDataAccess.ts"
click node_database "https://github.com/arshie13/devsim/blob/main/src/lib/server/client.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_stack_selection,node_scenario_selection,node_assessment,node_onboarding toneBlue
class node_workspace_route,node_workspace_ui,node_docker_api,node_container_service,node_docker_runtime,node_terminal_ws,node_ai_help,node_sprint_submit toneAmber
class node_dashboard,node_stats,node_achievements,node_learner_pass toneMint
class node_auth,node_data_access,node_database toneRose
class node_learner,node_ai_provider,node_stripe,node_docker toneIndigo
```

## Components

### Learning journey

- [Stack selection](https://github.com/arshie13/devsim/blob/main/src/routes/stacks/%2Bpage.server.ts): `src/routes/stacks/+page.server.ts`
- [Scenario selection](https://github.com/arshie13/devsim/blob/main/src/routes/scenario/%2Bpage.server.ts): `src/routes/scenario/+page.server.ts`
- [Assessments](https://github.com/arshie13/devsim/blob/main/src/routes/api/user/postassessment/%2Bserver.ts): `src/routes/api/user/postassessment/+server.ts`
- [Stack tutorials](https://github.com/arshie13/devsim/blob/main/src/lib/components/onboarding/OnboardingController.svelte): `src/lib/components/onboarding/OnboardingController.svelte`

### Coding workspace

- [Workspace loading](https://github.com/arshie13/devsim/blob/main/src/routes/workspace/%5BcontainerId%5D/%2Bpage.server.ts): `src/routes/workspace/[containerId]/+page.server.ts`
- [Editor and task UI](https://github.com/arshie13/devsim/blob/main/src/lib/components/workspace/EditorPanel.svelte): `src/lib/components/workspace/EditorPanel.svelte`
- [Container endpoints](https://github.com/arshie13/devsim/blob/main/src/routes/api/docker/container/create/%2Bserver.ts): `src/routes/api/docker/container/create/+server.ts`
- [Container service](https://github.com/arshie13/devsim/blob/main/src/lib/layers/service/ContainerService.ts): `src/lib/layers/service/ContainerService.ts`
- [Docker runtime](https://github.com/arshie13/devsim/blob/main/src/lib/server/docker/client.ts): `src/lib/server/docker/client.ts`
- [Terminal WebSocket](https://github.com/arshie13/devsim/blob/main/src/lib/server/websocket/terminal.ts): `src/lib/server/websocket/terminal.ts`
- [AI assistance](https://github.com/arshie13/devsim/blob/main/src/lib/ai/index.ts): `src/lib/ai/index.ts`
- [Sprint submission](https://github.com/arshie13/devsim/blob/main/src/routes/api/docker/container/%5Bid%5D/submit/%2Bserver.ts): `src/routes/api/docker/container/[id]/submit/+server.ts`

### Progress and rewards

- [Dashboard](https://github.com/arshie13/devsim/blob/main/src/routes/dashboard/%2Bpage.server.ts): `src/routes/dashboard/+page.server.ts`
- [Stats and rankings](https://github.com/arshie13/devsim/blob/main/src/lib/server/stats/index.ts): `src/lib/server/stats/index.ts`
- [Achievements](https://github.com/arshie13/devsim/blob/main/src/lib/server/achievements/progress.ts): `src/lib/server/achievements/progress.ts`
- [Learner Pass](https://github.com/arshie13/devsim/blob/main/src/lib/server/learnerPass.ts): `src/lib/server/learnerPass.ts`

### Platform services

- [Authentication](https://github.com/arshie13/devsim/blob/main/src/auth.ts): `src/auth.ts`
- [Data access](https://github.com/arshie13/devsim/blob/main/src/lib/layers/data-access/WorkspaceDataAccess.ts): `src/lib/layers/data-access/WorkspaceDataAccess.ts`
- [Application database](https://github.com/arshie13/devsim/blob/main/src/lib/server/client.ts): `src/lib/server/client.ts`

### Other components

- **Learner**
- **AI provider**
- **Stripe**
- **Docker**

## Connections

- Learner → Stack selection: chooses stack
- Stack selection → Scenario selection: selects scenario
- Learner → Assessments: submits assessment
- Learner → Stack tutorials: starts tutorial
- Learner → Workspace loading: opens workspace
- Workspace loading → Editor and task UI: loads workspace
- Workspace loading → Application database: reads workspace data
- Container endpoints → Container service: requests container action
- Container service → Docker runtime: manages container
- Docker runtime → Docker: controls containers
- Editor and task UI → Terminal WebSocket: opens terminal
- Editor and task UI → Container endpoints: manages project files
- Editor and task UI → AI assistance: requests guidance
- AI assistance → AI provider: requests AI response
- Editor and task UI → Sprint submission: submits sprint
- Sprint submission → Application database: records completion
- Learner → Dashboard: views progress
- Dashboard → Stats and rankings: loads statistics
- Stats and rankings → Application database: reads user progress
- Learner → Learner Pass: manages pass
- Learner Pass → Stripe: processes payment
- Assessments → AI provider: grades reflections
- Assessments → Application database: stores scores
- Authentication → Application database: reads identity data
- Data access → Application database: accesses records
