# marufff101/codecraft architecture

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

- Interactive diagram: https://gitdiagram.com/marufff101/codecraft
- Repository: https://github.com/marufff101/codecraft

## Overview

Codecraft is a browser-based coding academy. Learners browse courses, study staged lessons, practice challenges or projects, and run edited code; successful runs can unlock completion. Course records and authored lesson content feed the learning interface, while curriculum.js adds level pathways, runnable concept labs, and references. Progress and drafts stay on the learner’s device. Code Studio uses browser previews for JavaScript, HTML, and CSS, and can optionally reach a configured Piston service through the local server proxy. Runner details are documented, but app.js runner call sites were not shown.

Main entry points: [`app.js`](https://github.com/marufff101/codecraft/blob/main/app.js) (Learning interface), [`curriculum.js`](https://github.com/marufff101/codecraft/blob/main/curriculum.js) (Curriculum pathways), [`index.html`](https://github.com/marufff101/codecraft/blob/main/index.html) (App shell), [`server.js`](https://github.com/marufff101/codecraft/blob/main/server.js) (Local web and proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning experience"]
  node_shell["App shell<br/>[index.html]"]
  node_app["Learning interface<br/>[app.js]"]
  node_content["Course content<br/>[content.js]"]
  node_catalog["Course catalog<br/>[catalog.js]"]
  node_curriculum["Curriculum pathways<br/>[curriculum.js]"]
  node_progress[("Local progress<br/>[app.js]")]
  node_practice["Practice and projects<br/>[app.js]"]
end

subgraph group_execution["Code execution"]
  node_studio["Code Studio<br/>[app.js]"]
  node_browser_runner["Browser previews<br/>[app.js]"]
  node_server["Local web and proxy<br/>[server.js]"]
  node_piston["Piston runner"]
end

subgraph group_support["Learner support"]
  node_cat["Study companion<br/>[cat.js]"]
  node_references["Learning references<br/>[curriculum.js]"]
end

node_learner(("Learner"))

node_learner -->|"opens app"| node_shell
node_shell -->|"hosts interactions"| node_app
node_app -->|"uses course data"| node_content
node_app -->|"uses course data"| node_catalog
node_curriculum -->|"extends courses"| node_content
node_app -->|"saves progress"| node_progress
node_learner -->|"browses lessons"| node_app
node_app -->|"shows practice"| node_practice
node_app -->|"opens studio"| node_studio
node_studio -->|"runs browser code"| node_browser_runner
node_studio -.->|"requests runner"| node_server
node_server -->|"proxies requests"| node_piston
node_curriculum -->|"provides references"| node_references
node_learner -->|"interacts"| node_cat

click node_shell "https://github.com/marufff101/codecraft/blob/main/index.html"
click node_app "https://github.com/marufff101/codecraft/blob/main/app.js"
click node_content "https://github.com/marufff101/codecraft/blob/main/content.js"
click node_catalog "https://github.com/marufff101/codecraft/blob/main/catalog.js"
click node_curriculum "https://github.com/marufff101/codecraft/blob/main/curriculum.js"
click node_progress "https://github.com/marufff101/codecraft/blob/main/app.js"
click node_practice "https://github.com/marufff101/codecraft/blob/main/app.js"
click node_studio "https://github.com/marufff101/codecraft/blob/main/app.js"
click node_browser_runner "https://github.com/marufff101/codecraft/blob/main/app.js"
click node_server "https://github.com/marufff101/codecraft/blob/main/server.js"
click node_cat "https://github.com/marufff101/codecraft/blob/main/cat.js"
click node_references "https://github.com/marufff101/codecraft/blob/main/curriculum.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_shell,node_app,node_content,node_catalog,node_curriculum,node_progress,node_practice toneBlue
class node_studio,node_browser_runner,node_server,node_piston toneAmber
class node_cat,node_references toneMint
class node_learner toneIndigo
```

## Components

### Learning experience

- [App shell](https://github.com/marufff101/codecraft/blob/main/index.html): `index.html`
- [Learning interface](https://github.com/marufff101/codecraft/blob/main/app.js): `app.js`
- [Course content](https://github.com/marufff101/codecraft/blob/main/content.js): `content.js`
- [Course catalog](https://github.com/marufff101/codecraft/blob/main/catalog.js): `catalog.js`
- [Curriculum pathways](https://github.com/marufff101/codecraft/blob/main/curriculum.js): `curriculum.js`
- [Local progress](https://github.com/marufff101/codecraft/blob/main/app.js): `app.js`
- [Practice and projects](https://github.com/marufff101/codecraft/blob/main/app.js): `app.js`

### Code execution

- [Code Studio](https://github.com/marufff101/codecraft/blob/main/app.js): `app.js`
- [Browser previews](https://github.com/marufff101/codecraft/blob/main/app.js): `app.js`
- [Local web and proxy](https://github.com/marufff101/codecraft/blob/main/server.js): `server.js`
- **Piston runner**

### Learner support

- [Study companion](https://github.com/marufff101/codecraft/blob/main/cat.js): `cat.js`
- [Learning references](https://github.com/marufff101/codecraft/blob/main/curriculum.js): `curriculum.js`

### Other components

- **Learner**

## Connections

- Learner → App shell: opens app (evidence: `README.md`)
- App shell → Learning interface: hosts interactions (evidence: `README.md`)
- Learning interface → Course content: uses course data (evidence: `README.md`)
- Learning interface → Course catalog: uses course data (evidence: `README.md`)
- Curriculum pathways → Course content: extends courses (evidence: `curriculum.js`)
- Learning interface → Local progress: saves progress (evidence: `app.js`)
- Learner → Learning interface: browses lessons (evidence: `app.js`)
- Learning interface → Practice and projects: shows practice (evidence: `README.md`)
- Learning interface → Code Studio: opens studio (evidence: `README.md`)
- Code Studio → Browser previews: runs browser code (evidence: `README.md`)
- Code Studio → Local web and proxy: requests runner (evidence: `README.md`)
- Local web and proxy → Piston runner: proxies requests (evidence: `server.js`)
- Curriculum pathways → Learning references: provides references (evidence: `curriculum.js`)
- Learner → Study companion: interacts (evidence: `cat.js`)
