# hadden-me/learnoo architecture

> Architecture diagram of the GitHub repository hadden-me/learnoo, 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/hadden-me/learnoo
- Repository: https://github.com/hadden-me/learnoo

## Overview

Learnoo is a planned free learning platform, but the implemented product here is a local Go lesson-renderer experiment. Its demonstrated workflow is to load an unreviewed lesson fixture in the browser lab, edit and preview it through the local server, and render the validated document as HTML; browser-side code also renders math and loads video on demand. The README’s author/reviewer/publisher and student workflow is future scope, not implemented. Edges reflect shown calls or documented behavior; unsampled connections are omitted.

Main entry points: [`cmd/renderer/main.go`](https://github.com/hadden-me/learnoo/blob/main/cmd/renderer/main.go) (Preview and fixture routes), [`internal/rendering/static/lab.js`](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/lab.js) (Lesson lab), [`internal/rendering/render.go`](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go) (HTML renderer), [`README.md`](https://github.com/hadden-me/learnoo/blob/main/README.md) (Authoring workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prototype["Local prototype"]
  node_localserver["Local HTTP server<br/>[main.go]"]
  node_routes["Preview and fixture routes<br/>[main.go]"]
end

subgraph group_rendering["Lesson rendering"]
  node_fixture["Lesson fixture<br/>[render.go]"]
  node_decoder["Decode and validate<br/>[render.go]"]
  node_htmlrender["HTML renderer<br/>[render.go]"]
  node_embedded[("Embedded page assets<br/>[render.go]")]
end

subgraph group_browser["Browser experience"]
  node_lab["Lesson lab<br/>[lab.js]"]
  node_landing["Course catalogue<br/>[landing.js]"]
  node_localdraft[("Local draft<br/>[lab.js]")]
  node_mathvideo["Math and video<br/>[math.js]"]
end

subgraph group_planned["Planned platform"]
  node_authoring["Authoring workflow<br/>[README.md]"]
  node_reviewpublish["Review and publishing<br/>[README.md]"]
  node_learning["Student learning<br/>[README.md]"]
  node_accounts["Free accounts<br/>[README.md]"]
end

node_teacher(("Teacher"))
node_student(("Student"))
node_youtube["YouTube hosting"]

node_teacher -->|"edits lesson"| node_lab
node_lab -->|"saves draft"| node_localdraft
node_localdraft -->|"restores draft"| node_lab
node_lab -->|"fetches fixture"| node_routes
node_lab -->|"requests preview"| node_routes
node_localserver -->|"dispatches requests"| node_routes
node_routes -->|"loads fixture"| node_fixture
node_routes -->|"decodes preview"| node_decoder
node_routes -->|"renders document"| node_htmlrender
node_decoder -->|"validates document"| node_htmlrender
node_htmlrender -->|"executes template"| node_embedded
node_landing -.->|"shows catalogue"| node_student
node_mathvideo -->|"loads video on demand"| node_youtube
node_teacher -->|"contributes lessons"| node_authoring
node_authoring -.->|"submits for review"| node_reviewpublish
node_reviewpublish -->|"publishes materials"| node_learning
node_student -->|"accesses materials"| node_learning
node_student -->|"uses free account"| node_accounts

click node_lab "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/lab.js"
click node_landing "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/landing.js"
click node_localdraft "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/lab.js"
click node_localserver "https://github.com/hadden-me/learnoo/blob/main/cmd/renderer/main.go"
click node_routes "https://github.com/hadden-me/learnoo/blob/main/cmd/renderer/main.go"
click node_fixture "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go"
click node_decoder "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go"
click node_htmlrender "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go"
click node_embedded "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go"
click node_mathvideo "https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/math.js"
click node_authoring "https://github.com/hadden-me/learnoo/blob/main/README.md"
click node_reviewpublish "https://github.com/hadden-me/learnoo/blob/main/README.md"
click node_learning "https://github.com/hadden-me/learnoo/blob/main/README.md"
click node_accounts "https://github.com/hadden-me/learnoo/blob/main/README.md"

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_localserver,node_routes toneBlue
class node_fixture,node_decoder,node_htmlrender,node_embedded toneAmber
class node_lab,node_landing,node_localdraft,node_mathvideo toneMint
class node_authoring,node_reviewpublish,node_learning,node_accounts toneRose
class node_teacher,node_student,node_youtube toneIndigo
```

## Components

### Local prototype

- [Local HTTP server](https://github.com/hadden-me/learnoo/blob/main/cmd/renderer/main.go): `cmd/renderer/main.go`
- [Preview and fixture routes](https://github.com/hadden-me/learnoo/blob/main/cmd/renderer/main.go): `cmd/renderer/main.go`

### Lesson rendering

- [Lesson fixture](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go): `internal/rendering/render.go`
- [Decode and validate](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go): `internal/rendering/render.go`
- [HTML renderer](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go): `internal/rendering/render.go`
- [Embedded page assets](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/render.go): `internal/rendering/render.go`

### Browser experience

- [Lesson lab](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/lab.js): `internal/rendering/static/lab.js`
- [Course catalogue](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/landing.js): `internal/rendering/static/landing.js`
- [Local draft](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/lab.js): `internal/rendering/static/lab.js`
- [Math and video](https://github.com/hadden-me/learnoo/blob/main/internal/rendering/static/math.js): `internal/rendering/static/math.js`

### Planned platform

- [Authoring workflow](https://github.com/hadden-me/learnoo/blob/main/README.md): `README.md`
- [Review and publishing](https://github.com/hadden-me/learnoo/blob/main/README.md): `README.md`
- [Student learning](https://github.com/hadden-me/learnoo/blob/main/README.md): `README.md`
- [Free accounts](https://github.com/hadden-me/learnoo/blob/main/README.md): `README.md`

### Other components

- **Teacher**
- **Student**
- **YouTube hosting**

## Connections

- Teacher → Lesson lab: edits lesson (evidence: `README.md`)
- Lesson lab → Local draft: saves draft (evidence: `internal/rendering/static/lab.js`)
- Local draft → Lesson lab: restores draft (evidence: `internal/rendering/static/lab.js`)
- Lesson lab → Preview and fixture routes: fetches fixture (evidence: `internal/rendering/static/lab.js`)
- Lesson lab → Preview and fixture routes: requests preview (evidence: `internal/rendering/static/lab.js`)
- Local HTTP server → Preview and fixture routes: dispatches requests (evidence: `cmd/renderer/main.go`)
- Preview and fixture routes → Lesson fixture: loads fixture (evidence: `cmd/renderer/main.go`)
- Preview and fixture routes → Decode and validate: decodes preview (evidence: `cmd/renderer/main.go`)
- Preview and fixture routes → HTML renderer: renders document (evidence: `cmd/renderer/main.go`)
- Decode and validate → HTML renderer: validates document (evidence: `internal/rendering/render.go`)
- HTML renderer → Embedded page assets: executes template (evidence: `internal/rendering/render.go`)
- Course catalogue → Student: shows catalogue
- Math and video → YouTube hosting: loads video on demand (evidence: `internal/rendering/static/math.js`)
- Teacher → Authoring workflow: contributes lessons (evidence: `README.md`)
- Authoring workflow → Review and publishing: submits for review
- Review and publishing → Student learning: publishes materials (evidence: `README.md`)
- Student → Student learning: accesses materials (evidence: `README.md`)
- Student → Free accounts: uses free account (evidence: `README.md`)
