How devlunaris/ap02 works
AP2 Lernhub is a self-hosted IHK exam-preparation platform centered on finding topics, studying their MDX lessons, and running interactive exercises. Learners can also browse a focus list or mixed exercise pool, search topics, and track status and notes locally. The three exercise engines cover stepwise German pseudocode tracing, browser-side SQLite, and C# execution through a server-side runner proxy. The graph follows documented capabilities and sampled API, search, progress, and parser code; unsampled page wiring is represented only where the README supports the relationship.
Main entry points: topics.ts Topic content · index.tsx Exercise widgets · pseudocode-tracer.tsx Pseudocode tracer · sql-exercise.tsx SQL exercise
Components 31
Learning content
- Home
app/page.tsx - Topic index
app/themen/page.tsx - Topic lesson
app/thema/[slug]/page.tsx - Category browse
app/kategorie/[slug]/page.tsx - Topic content
lib/content/topics.ts - MDX renderer
lib/content/mdx.tsx
Interactive practice
- Exercise pool
components/exercise-pool.tsx - Exercise widgets
components/mdx/index.tsx
Execution engines
- Pseudocode tracer
components/mdx/pseudocode-tracer.tsx - Pseudocode parser
lib/pseudocode/parser.ts - Pseudocode tokenizer
lib/pseudocode/tokenizer.ts - Pseudocode interpreter
lib/pseudocode/interpreter.ts - SQL exercise
components/mdx/sql-exercise.tsx - SQLite engine
lib/sql/runner.ts - SQL comparison
lib/sql/compare.ts - C# exercise
components/mdx/csharp-exercise.tsx - Runner client
lib/runner/client.ts
Progress and planning
- Progress controls
components/progress/progress-panel.tsx - Progress hooks
lib/progress/index.ts - Browser progress
lib/progress/store.ts - Focus list
components/focus-list.tsx - Exam countdown
components/exam-countdown.tsx - Exam date
config/exam.ts
Platform services
- Run endpoint
app/api/run/route.ts - Runner adapter
lib/runner/index.ts - Piston service
- Search dialog
components/search/search-dialog.tsx - Search endpoint
app/api/suche/route.ts - Search index builder
lib/search/index-builder.ts - Search engine
lib/search/search.ts
Other components
- Learner
Connections 34
- Learner → Home: opens
- Learner → Topic index: browses
- Learner → Category browse: browses
- Home → Topic content: shows topics
- Topic index → Topic content: lists topics
- Category browse → Topic content: lists topics
- Topic lesson → Topic content: loads lesson
- Topic lesson → MDX renderer: renders MDX
- MDX renderer → Exercise widgets: uses components
- Exercise widgets → Pseudocode tracer: renders
- Exercise widgets → SQL exercise: renders
- Exercise widgets → C# exercise: renders
- Pseudocode tracer → Pseudocode parser: parses code
- Pseudocode parser → Pseudocode tokenizer: tokenizes
- Pseudocode tracer → Pseudocode interpreter: traces code
- SQL exercise → SQLite engine: executes SQL
- SQL exercise → SQL comparison: checks results
- C# exercise → Runner client: submits code
- Runner client → Run endpoint: posts code
- Run endpoint → Runner adapter: dispatches
- Runner adapter → Piston service: runs remotely
- Learner → Exercise pool: practises
- Exercise pool → Topic content: collects exercises
- Learner → Search dialog: searches
- Search dialog → Search endpoint: fetches index
- Search endpoint → Search index builder: builds response
- Search dialog → Search engine: queries
- Learner → Progress controls: tracks learning
- Progress controls → Progress hooks: updates status
- Progress hooks → Browser progress: reads and writes
- Learner → Focus list: follows focus
- Focus list → Topic content: uses topic list
- Learner → Exam countdown: checks date
- Exam countdown → Exam date: reads date