A French learning app, A1 → C1. Single learner, no auth. Runs entirely locally with zero setup, or deploys as a real always-on app (Vercel + a hosted Postgres) — same code, same schema, either way. See PLAN.md for the full data model, curriculum map, and build status, and DECISIONS.md for judgment calls made while building.
Open it and you either take a 20-question adaptive placement test or just start at A1 — either way you land on a skill tree: 44 units, A1 through C1, each a row of lesson nodes that unlock as you clear the one before it. Tap a node and you're in a short, mixed-format exercise session — multiple choice, listening, dictation, word banks, free translation, speaking with actual speech recognition, fourteen formats in total, rotating so it never feels like the same flashcard over and over.
The part that isn't just a reskinned flashcard app: every word is tracked on four independent
memory tracks — recognition, production, listening, spelling — each scheduled separately by FSRS
spaced repetition, graded from your actual correctness/speed/hint-use rather than an honesty-system
self-rating. /reviser surfaces whatever's genuinely due. There's also a searchable grammar
reference, a conjugation trainer for ~120 verbs, a seven-panel progress dashboard with real
retention curves (not vanity stats), 41 achievements, and streaks with earned freezes and a
weekend-protection amulet.
Read the full walkthrough → for a proper room-by-room tour of every screen, plus a longer "how it's actually built" section for the technical side of the same story.
npm install
npm run seed # runs migrations, validates content, seeds the DB from /content
npm run dev # http://localhost:3000No database to install or configure. With DATABASE_URL unset, the app runs against an embedded,
file-backed Postgres (PGlite — real Postgres compiled to WASM) at
data/maitrise-pg/.
- Push this repo to GitHub and import it into Vercel.
- In the Vercel project → Storage → Create Database → Postgres (Neon-backed). Vercel
wires up
DATABASE_URL(and a few aliases) as project environment variables automatically. - Run the migration + seed once against that database — either via
vercel env pull .env.localand runningnpm run seedlocally with that.env.localloaded, or from any machine withDATABASE_URLset to the same connection string. - Deploy. Every request now reads/writes the real hosted Postgres instead of the local embedded one — progress persists across deploys and cold starts, unlike a serverless function's local disk.
Any other Postgres host (Neon, Supabase, Railway, RDS…) works the same way — just set
DATABASE_URL to its connection string. See .env.example.
| Script | Does |
|---|---|
npm run dev / build / start |
Next.js dev server / production build / start |
npm run typecheck |
tsc --noEmit, strict mode |
npm run lint |
ESLint (Next.js core-web-vitals + TypeScript) |
npm run test / test:watch |
Vitest unit tests |
npm run e2e |
Playwright E2E (needs npx playwright install once) |
npm run db:generate |
Regenerate Drizzle migration SQL from src/db/schema.ts |
npm run db:migrate |
Apply migrations — to DATABASE_URL if set, else to the local embedded Postgres |
npm run validate-content |
Fail loudly if /content is incomplete or malformed |
npm run seed |
migrate → validate-content → load /content into the DB |
npm run seed:demo |
Overlay a realistic demo profile (week 1 / 12 / 52 of use) |
- Next.js 15 App Router + TypeScript strict. No
any. - Postgres via Drizzle ORM (
src/db/schema.ts,drizzle-orm/pg-core) — one schema, one dialect, everywhere.src/db/client.tspicks the driver at runtime:drizzle-orm/postgres-jsagainstDATABASE_URLwhen it's set (a real deployment), otherwisedrizzle-orm/pgliteagainst an embedded, file-backed Postgres atdata/maitrise-pg/(gitignored — derived from/content+ your local progress, not something to version) so local dev stays zero-config. The client is cached onglobalThisin development so Next's hot-module-reloading reuses the same PGlite connection instead of racing a second one against it — PGlite is single-writer, like SQLite. - Content is data, not code.
/content/vocab/{topic}.json,/content/grammar/{unit}.json,/content/sentences/{topic}.json,/content/verbs/verbs.jsonare the source of truth;npm run seedloads them into SQLite.scripts/validate-content.tsis the gate — it fails the build if a topic has fewer than 80 entries, a schema field is missing, a lemma is duplicated within a topic, or the 4,000-entry total floor isn't met. src/content/holds the schemas (Zod) and structural data that content authoring depends on:topics.ts(the 40 canonical topics),curriculum.ts(the 44 CEFR units and their lesson nodes),schema.ts(Zod schemas mirroring the DB shape, used by both the validator and any authoring tooling).- FSRS spaced-repetition engine (
src/lib/srs/) — stability/difficulty/retrievability, four independent tracks (recognition/production/listening/spelling), leech detection, grade inferred from correctness + latency + hint usage (never self-graded). See PLAN.md §4. - Exercise engine (
src/lib/exercises/generate.ts+src/components/exercises/) — all 14 exercise kinds, crown-level gating (CROWN_KIND_TIERS), shared<ExerciseShell>contract. - Server layer (
src/server/) —queries.ts/*-queries.tsfor reads (Server Components call these directly, no API routes),actions.tsfor mutations ("use server", called from Client Components).lesson-composer.tsandreview-composer.tsassemble a lesson/review session's exercise list from due + new cards;achievement-stats.tsaggregates the counters the 41 achievements (src/content/achievements.ts) check against. - Routes:
/(skill tree home),/lecon/[lessonId]and/reviser(focused, no nav chrome — the actual exercise-taking sessions),/placement(first-launch adaptive test),/grammaire+/grammaire/[slug](reference),/conjugaison(trainer),/progres(dashboard),/reglages(settings),/succes(achievements gallery). - Audio/TTS (
src/lib/audio/) — Web Speech API behind a small interface so a paid provider can be swapped in later without touching call sites.
Append entries to /content/vocab/{topic-slug}.json (topic slugs are in src/content/topics.ts).
Each entry must match vocabEntrySchema in src/content/schema.ts:
{
id: string; // unique within the topic file
fr: string; // "la bibliothèque"
en: string; // "library"
lemma: string; // "bibliothèque" — must be unique within the topic
pos: "noun"|"verb"|"adj"|"adv"|"prep"|"conj"|"phrase"|"pronoun";
gender?: "m"|"f"|"both";
plural?: string;
ipa: string; // "/bi.bli.jɔ.tɛk/"
cefr: "A1"|"A2"|"B1"|"B2"|"C1";
topic: string; // must equal the filename slug
register: "neutre"|"familier"|"soutenu"|"argot";
exampleFr: string;
exampleEn: string;
collocations?: string[];
fauxAmi?: string;
mnemonic?: string;
audioText: string; // what the TTS layer speaks
}Run npm run validate-content after editing — it checks schema conformance, the 80-entries-per-topic
floor, duplicate lemmas, and the 4,000-entry total.
- Add
{ slug, label }toTOPICSinsrc/content/topics.ts. - Create
/content/vocab/{slug}.jsonwith ≥80 entries spanning CEFR levels. - Optionally add
/content/sentences/{slug}.json(schema:sentenceSchema). - Reference the new topic slug from a unit's
topicsarray insrc/content/curriculum.tsif it should back a specific lesson. npm run validate-content, thennpm run seed.
Each of the 44 units needs /content/grammar/{unit-slug}.json (unit slugs are in
UNITS in src/content/curriculum.ts), matching grammarUnitFileSchema: an array of grammar points,
each with 6–10 annotated examples, common mistakes, and a "why this trips up English speakers" note.
All verbs live in one file, /content/verbs/verbs.json, matching verbFileSchema — infinitive,
group, auxiliary, past participle, frequency rank, and a full conjugation table (tense × person).
validate-content requires ≥120 verbs and checks that the core irregular verbs (être, avoir, aller,
faire, pouvoir, vouloir, devoir, savoir, voir, venir, prendre, mettre, dire, partir, sortir) are all
present.