01. What this site is
This learning app is a self-paced AI-engineering curriculum delivered as a single Next.js App Router application, deployed to one Cloudflare Worker. The entire site—interactive explainers, persistent audiobook player, lesson pages—is a static-plus-dynamic hybrid where every piece of content resolves from the same ordered source of truth.
The curriculum lives as plain markdown files under content/. Each file is named by its slug (e.g., tokenization.md) and contains a level-1 heading for the title, followed by body text. The critical structural constant is LESSON_SLUGS in lib/articles.ts. This array lists every slug in the exact order the authors intend students to study—starting with the foundation phase (lessons 1–9) and running through phase 8 (lessons 73–80). Position in this list fixes each lesson’s number; a derived constant LESSON_NUMBER maps slug to that 1-indexed position. The array also defines the audiobook spine: the persistent player auto-advances through slugs in this order, and anything beyond lesson 80 (the Appendix) is excluded from continuous-play but is still reachable via direct links.
lib/data.ts consumes that ordered list to build lesson metadata. The function getAllLessons() reads every .md file from content/, filters only those slugs that appear in LESSON_NUMBER, then extracts title, excerpt, word count, reading time, and difficulty (computed from the lesson’s position inside its phase). The resulting Lesson objects are sorted by number, producing a static array that drives the roadmap, category groupings, and the audio player’s playlist.
When a user requests a specific lesson, getLessonBySlug(slug) in lib/data.ts resolves the content. It follows a three-layer fallback: first it tries to fetch from a D1 database (the content-cache written by a Rust sync-d1 pipeline—new or edited markdown appears after a refresh without redeploying the Worker). If D1 is unconfigured or empty, it falls through to a JSON file exported at build time by export-content. As a last resort, it reads the raw markdown from disk using resolveContentFile(slug), which constructs the path content/${slug}.md and parses the file with fs.readFileSync. The content is then combined with the metadata into a LessonWithContent object.
This single ordered list is the source of truth for both numbering and the play order because it prevents the kind of drift that would occur if numbering were derived from filesystem ordering, a database row, or a separate menu config. The list is version-controlled alongside the markdown files, so adding a new lesson or reordering an existing one is a single edit in one place: insert the slug at the correct index, bump subsequent numbers automatically via the position-based LESSON_NUMBER map, and the rest of the system—roadmap grouping, difficulty calculation, player progression, URL paths—adjusts consistently. The design trades the flexibility of dynamic ordering for a guarantee that every lesson’s number and position is deterministic, auditable, and synchronized with the author’s intended learning sequence.
It's a website that teaches you how to become an AI engineer, plus a bunch of interactive explainers. It's one app running on one server at the edge of the network.
2Morego a level deeper
The lessons are markdown files kept in a fixed order, and that order is also the playlist for the audio version. The other pages are hand-built interactive guides whose content is baked into the build as JSON; the lessons themselves are served from a small edge database. Either way the server never reads files while you browse.
3Deepthe full mechanics
It's a Next.js App Router app: a dynamic [slug] route serves each lesson D1-first from the content_cache table (synced from content/ markdown by the content pipeline, ordered by LESSON_SLUGS, and revalidated hourly via ISR tags); guide pages statically import committed data/*.json; either way the Cloudflare Worker never does a runtime filesystem read — lesson reads go through the Worker's native DB binding.
Where this chapter's machinery lives in the repo:
lib/articles.ts:8-19
The typed Lesson metadata record the taxonomy grid and lesson pages are built from.
export interface Lesson {
slug: string;
fileSlug: string;
number: number;
title: string;
category: string;
excerpt: string;
difficulty: DifficultyLevel;
wordCount: number;
readingTimeMin: number;
url: string;
}
lib/articles.ts:43-53
LESSON_SLUGS — the ordered spine: a slug's position sets its lesson number and its audiobook play order.
// `*` slugs are new Cloudflare-specific pilot chapters.
const LESSON_SLUGS = [
// Phase 1 · Foundations & Model Inference (1-9)
"ai-on-cloudflare-workers", // *
"roadmap",
"workers-ai-models", // *
"transformer-architecture",
"tokenization",
"model-architectures",
"scaling-laws",
"inference-optimization",
lib/data.ts:25-29
The lesson read path the [slug] route actually uses: D1 content_cache first, bundled JSON export second, markdown parser only as the dev-time fallback (see getLessonBySlug below this comment).
// Lesson content resolves D1 first (dynamic, written by the Rust `sync-d1`
// pipeline → new/edited content shows on refresh, no redeploy), then the
// build-bundled JSON exported by `export-content`, then the markdown parser in
// ./articles as the last-resort fallback. Each layer is independent, so an
// unconfigured/empty D1 silently falls through.
What is the name of the array that lists every lesson slug in the exact order intended for study?
Show answer
LESSON_SLUGS
From the research: Retrieval practice / testing effect — Testing (quizzing) boosts classroom learning: A systematic and meta-analytic review (2021)