# miloanton/leonis-campus architecture

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

- Interactive diagram: https://gitdiagram.com/miloanton/leonis-campus
- Repository: https://github.com/miloanton/leonis-campus

## Overview

Leonis Campus is a static educational hub that directs learners to module spaces and hosts Git training. The principal flow runs from the home or module pages to a training chapter, where learners edit commands, run or verify exercises, explore Git state, and optionally unlock hints or solutions. Content loading and validation and the engine interface are useful internal layers. The README documents additional module spaces and course, resource, and assessment capability; their implementations are not shown here, so those branches are represented at the module-space level. Evidence is limited to the README and indexed or excerpted files.

Main entry points: [`src/lib/content.ts`](https://github.com/miloanton/leonis-campus/blob/main/src/lib/content.ts) (Content loader), [`src/components/templates/ChapterTemplate/ChapterTemplate.tsx`](https://github.com/miloanton/leonis-campus/blob/main/src/components/templates/ChapterTemplate/ChapterTemplate.tsx) (Chapter view), [`src/app/modules/[slug]/entrainement/[chapitre]/page.tsx`](https://github.com/miloanton/leonis-campus/blob/main/src/app/modules/%5Bslug%5D/entrainement/%5Bchapitre%5D/page.tsx) (Chapter route), [`src/components/organisms/ExerciseCard/ExerciseCard.tsx`](https://github.com/miloanton/leonis-campus/blob/main/src/components/organisms/ExerciseCard/ExerciseCard.tsx) (Exercise card)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Campus navigation"]
  node_home["Home page<br/>[page.tsx]"]
  node_modulepage["Module page<br/>[page.tsx]"]
  node_spaces["Module spaces<br/>[SpaceSection.tsx]"]
  node_other_spaces["Courses, resources, assessments<br/>[types.ts]"]
end

subgraph group_training["Git training"]
  node_trainingindex["Training index<br/>[page.tsx]"]
  node_chapterroute["Chapter route<br/>[page.tsx]"]
  node_chapter["Chapter view"]
end

subgraph group_runtime["Exercise runtime"]
  node_exercise["Exercise card<br/>[ExerciseCard.tsx]"]
  node_editor["Code editor<br/>[CodeEditor.tsx]"]
  node_engineapi["Engine interface<br/>[types.ts]"]
  node_enginefactory["Engine factory<br/>[index.ts]"]
  node_gitleo["Git simulator<br/>[gitleo.js]"]
  node_gitschema["Git schema<br/>[schema.js]"]
end

subgraph group_content["Content and engines"]
  node_content["Content loader<br/>[content.ts]"]
  node_trainingdata["Training loader<br/>[training.ts]"]
  node_markdown["Statement markdown<br/>[markdown.ts]"]
  node_vault["Vault decryption<br/>[vault.ts]"]
  node_vaultfiles["Encrypted hints and solutions"]
  node_format["Label formatting<br/>[format.ts]"]
  node_paths["Navigation paths<br/>[paths.ts]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_home
node_home -->|"loads page content"| node_content
node_home -.->|"navigates to"| node_modulepage
node_modulepage -->|"loads module content"| node_content
node_modulepage -->|"renders spaces"| node_spaces
node_spaces -.->|"links to training"| node_trainingindex
node_spaces -->|"supports space types"| node_other_spaces
node_trainingindex -->|"loads chapters"| node_content
node_trainingindex -.->|"links chapters"| node_chapterroute
node_chapterroute -->|"loads chapter data"| node_content
node_chapterroute -->|"renders statements"| node_markdown
node_chapterroute -->|"renders chapter"| node_chapter
node_content -->|"loads training"| node_trainingdata
node_chapter -->|"creates engines"| node_enginefactory
node_chapter -->|"fetches encrypted data"| node_vaultfiles
node_chapter -->|"opens vaults"| node_vault
node_chapter -->|"renders exercises"| node_exercise
node_exercise -->|"renders editor"| node_editor
node_exercise -->|"runs and verifies"| node_engineapi
node_exercise -->|"formats messages"| node_format
node_enginefactory -->|"implements interface"| node_engineapi
node_enginefactory -->|"dispatches Git"| node_gitleo
node_enginefactory -->|"uses Git schema"| node_gitschema
node_content -.->|"uses navigation helpers"| node_paths

click node_home "https://github.com/miloanton/leonis-campus/blob/main/src/app/page.tsx"
click node_modulepage "https://github.com/miloanton/leonis-campus/blob/main/src/app/modules/%5Bslug%5D/page.tsx"
click node_spaces "https://github.com/miloanton/leonis-campus/blob/main/src/components/organisms/SpaceSection/SpaceSection.tsx"
click node_trainingindex "https://github.com/miloanton/leonis-campus/blob/main/src/app/modules/%5Bslug%5D/entrainement/page.tsx"
click node_chapterroute "https://github.com/miloanton/leonis-campus/blob/main/src/app/modules/%5Bslug%5D/entrainement/%5Bchapitre%5D/page.tsx"
click node_chapter "https://github.com/miloanton/leonis-campus/blob/main/src/components/templates/ChapterTemplate/ChapterTemplate.tsx"
click node_exercise "https://github.com/miloanton/leonis-campus/blob/main/src/components/organisms/ExerciseCard/ExerciseCard.tsx"
click node_editor "https://github.com/miloanton/leonis-campus/blob/main/src/components/atoms/CodeEditor/CodeEditor.tsx"
click node_engineapi "https://github.com/miloanton/leonis-campus/blob/main/src/engines/types.ts"
click node_enginefactory "https://github.com/miloanton/leonis-campus/blob/main/src/engines/index.ts"
click node_gitleo "https://github.com/miloanton/leonis-campus/blob/main/src/engines/git/gitleo.js"
click node_gitschema "https://github.com/miloanton/leonis-campus/blob/main/src/engines/git/schema.js"
click node_content "https://github.com/miloanton/leonis-campus/blob/main/src/lib/content.ts"
click node_trainingdata "https://github.com/miloanton/leonis-campus/blob/main/src/lib/training.ts"
click node_markdown "https://github.com/miloanton/leonis-campus/blob/main/src/lib/markdown.ts"
click node_vault "https://github.com/miloanton/leonis-campus/blob/main/src/lib/vault.ts"
click node_format "https://github.com/miloanton/leonis-campus/blob/main/src/lib/format.ts"
click node_paths "https://github.com/miloanton/leonis-campus/blob/main/src/lib/paths.ts"
click node_other_spaces "https://github.com/miloanton/leonis-campus/blob/main/src/lib/types.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_home,node_modulepage,node_spaces,node_other_spaces toneBlue
class node_trainingindex,node_chapterroute,node_chapter toneAmber
class node_exercise,node_editor,node_engineapi,node_enginefactory,node_gitleo,node_gitschema toneMint
class node_content,node_trainingdata,node_markdown,node_vault,node_vaultfiles,node_format,node_paths toneRose
class node_learner toneIndigo
```

## Components

### Campus navigation

- [Home page](https://github.com/miloanton/leonis-campus/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Module page](https://github.com/miloanton/leonis-campus/blob/main/src/app/modules/%5Bslug%5D/page.tsx): `src/app/modules/[slug]/page.tsx`
- [Module spaces](https://github.com/miloanton/leonis-campus/blob/main/src/components/organisms/SpaceSection/SpaceSection.tsx): `src/components/organisms/SpaceSection/SpaceSection.tsx`
- [Courses, resources, assessments](https://github.com/miloanton/leonis-campus/blob/main/src/lib/types.ts): `src/lib/types.ts`

### Git training

- [Training index](https://github.com/miloanton/leonis-campus/blob/main/src/app/modules/%5Bslug%5D/entrainement/page.tsx): `src/app/modules/[slug]/entrainement/page.tsx`
- [Chapter route](https://github.com/miloanton/leonis-campus/blob/main/src/app/modules/%5Bslug%5D/entrainement/%5Bchapitre%5D/page.tsx): `src/app/modules/[slug]/entrainement/[chapitre]/page.tsx`
- [Chapter view](https://github.com/miloanton/leonis-campus/blob/main/src/components/templates/ChapterTemplate/ChapterTemplate.tsx): `src/components/templates/ChapterTemplate/ChapterTemplate.tsx`

### Exercise runtime

- [Exercise card](https://github.com/miloanton/leonis-campus/blob/main/src/components/organisms/ExerciseCard/ExerciseCard.tsx): `src/components/organisms/ExerciseCard/ExerciseCard.tsx`
- [Code editor](https://github.com/miloanton/leonis-campus/blob/main/src/components/atoms/CodeEditor/CodeEditor.tsx): `src/components/atoms/CodeEditor/CodeEditor.tsx`
- [Engine interface](https://github.com/miloanton/leonis-campus/blob/main/src/engines/types.ts): `src/engines/types.ts`
- [Engine factory](https://github.com/miloanton/leonis-campus/blob/main/src/engines/index.ts): `src/engines/index.ts`
- [Git simulator](https://github.com/miloanton/leonis-campus/blob/main/src/engines/git/gitleo.js): `src/engines/git/gitleo.js`
- [Git schema](https://github.com/miloanton/leonis-campus/blob/main/src/engines/git/schema.js): `src/engines/git/schema.js`

### Content and engines

- [Content loader](https://github.com/miloanton/leonis-campus/blob/main/src/lib/content.ts): `src/lib/content.ts`
- [Training loader](https://github.com/miloanton/leonis-campus/blob/main/src/lib/training.ts): `src/lib/training.ts`
- [Statement markdown](https://github.com/miloanton/leonis-campus/blob/main/src/lib/markdown.ts): `src/lib/markdown.ts`
- [Vault decryption](https://github.com/miloanton/leonis-campus/blob/main/src/lib/vault.ts): `src/lib/vault.ts`
- **Encrypted hints and solutions**
- [Label formatting](https://github.com/miloanton/leonis-campus/blob/main/src/lib/format.ts): `src/lib/format.ts`
- [Navigation paths](https://github.com/miloanton/leonis-campus/blob/main/src/lib/paths.ts): `src/lib/paths.ts`

### Other components

- **Learner**

## Connections

- Learner → Home page: opens (evidence: `README.md`)
- Home page → Content loader: loads page content (evidence: `src/app/page.tsx`)
- Home page → Module page: navigates to (evidence: `README.md`)
- Module page → Content loader: loads module content (evidence: `src/app/modules/[slug]/page.tsx`)
- Module page → Module spaces: renders spaces (evidence: `README.md`)
- Module spaces → Training index: links to training (evidence: `README.md`)
- Module spaces → Courses, resources, assessments: supports space types (evidence: `README.md`)
- Training index → Content loader: loads chapters (evidence: `src/app/modules/[slug]/entrainement/page.tsx`)
- Training index → Chapter route: links chapters (evidence: `README.md`)
- Chapter route → Content loader: loads chapter data (evidence: `src/app/modules/[slug]/entrainement/[chapitre]/page.tsx`)
- Chapter route → Statement markdown: renders statements (evidence: `src/app/modules/[slug]/entrainement/[chapitre]/page.tsx`)
- Chapter route → Chapter view: renders chapter (evidence: `src/app/modules/[slug]/entrainement/[chapitre]/page.tsx`)
- Content loader → Training loader: loads training (evidence: `src/lib/content.ts`)
- Chapter view → Engine factory: creates engines (evidence: `src/components/templates/ChapterTemplate/ChapterTemplate.tsx`)
- Chapter view → Encrypted hints and solutions: fetches encrypted data (evidence: `src/components/templates/ChapterTemplate/ChapterTemplate.tsx`)
- Chapter view → Vault decryption: opens vaults (evidence: `src/components/templates/ChapterTemplate/ChapterTemplate.tsx`)
- Chapter view → Exercise card: renders exercises (evidence: `src/components/templates/ChapterTemplate/ChapterTemplate.tsx`)
- Exercise card → Code editor: renders editor (evidence: `src/components/organisms/ExerciseCard/ExerciseCard.tsx`)
- Exercise card → Engine interface: runs and verifies (evidence: `src/components/organisms/ExerciseCard/ExerciseCard.tsx`)
- Exercise card → Label formatting: formats messages (evidence: `src/components/organisms/ExerciseCard/ExerciseCard.tsx`)
- Engine factory → Engine interface: implements interface (evidence: `src/engines/index.ts`)
- Engine factory → Git simulator: dispatches Git (evidence: `src/engines/index.ts`)
- Engine factory → Git schema: uses Git schema (evidence: `src/engines/index.ts`)
- Content loader → Navigation paths: uses navigation helpers
