Formation DELF
June 2026 – PresentAn AI exam-prep platform for the French DELF diploma, live at formation-delf.com: all four exam parts and a full mock exam, AI essay marking, a live AI voice examiner, Stripe passes and four portals in one Next.js app, designed for the phone first.
Product overview
Full-stack AI SaaSFrom a WordPress quiz site to a full exam platform.
DELF is the official French-language diploma, and B2 is now the level required for French citizenship, so candidates pay to practise for it.
The old platform was a WordPress course site: slow, awkward on a phone and limited to multiple-choice quizzes. We rebuilt it as a fast, phone-first web app where candidates sit all four parts of the exam under real conditions, get AI marks on the official grid and talk out loud with an AI examiner.
| Area | Before | After | Skills shown |
|---|---|---|---|
| Reading, listening | Multiple-choice only | Timed players, real exam protocol | Exam engine |
| Writing | No essay correction | AI mark out of 25 on the official grid | AI, structured output |
| Speaking | No speaking practice | Live AI voice examiner | Voice agent |
| Speed | Slow page loads | Fast, cached pages | Performance |
| Design | Dated theme | Modern, consistent interface | UI/UX design |
| Phone | Desktop theme, shrunk | Designed for the phone first | Mobile-first UI |
| Payments | WooCommerce checkout | Stripe passes, refunds, receipts | Stripe |
| Content | Typed into plugins | Scraped, migrated, then audited | Scraping, data |
| Running it | WordPress back end | Full back office: content, sales, users | Admin dashboard |
Four portals, one app
- Projected score
- Practice, all 4 exam parts
- Timed mock exam
- Essay and oral practice
- History and receipts
- Exams and topics
- Users and passes
- AI marks and reviews
- Answer-key checks
- Partners and reviews
- Blind essay re-marking
- AI mark side by side
- Printable copies
- Questionnaire
- Tutors refer candidates
- Earn a commission
- Sign-ups and sales
- Payouts and team
Architecture
Full-stackOne Next.js app, four portals, several AI providers.
Each AI provider, the payment processor and the voice engine sit behind their own boundary, so any one of them can be swapped without touching the exam code.
The system, layer by layer
- Candidatesphone and desktop
- Owner / admincontent, sales, AI
- Examinershuman, blind re-marking
- Partnersreferral links
- Public pagesfast, cached, found on Google
- Exam players4 exam parts + mock exam
- Business logicevery action checked on the server
- Admin and examiner portalsrun the business without code
- Text AImarking, summaries, reading photos (OCR)
- Realtime voiceOpenAI Realtime · Grok · Gemini Live · ElevenLabs
- Speechspeech to text, voice-over, pronunciation
- PostgreSQL on Neon · Drizzle ORMone database, full history
- Prompt storetested draft, one live version
- Vercel Blobaudio, images
- Stripepayments and refunds
- Clerksign-in and accounts
- Resendall the emails
- PostHog, GA4only after consent
- French open dataDELF exam centres
Architecture principleSign-in and roles are checked on the server for every action. Swap an AI provider, the voice engine or the payment processor: the exam code stays untouched.
Skills used in this project
- Full-stack web app
- Next.js, React, TypeScript
- PostgreSQL, Drizzle
- REST API + server actions
- Auth and user roles
- Stripe payments
- LLM integration
- Structured AI output
- Real-time voice agent
- Speech to text, TTS
- Web scraping
- Data migration
- Admin dashboard
- Mobile-first UI
- Automated testing
AI voice examiner
Voice agent · Realtime AIA live AI voice examiner that interviews out loud.
The speaking test used to need a real examiner. Now it runs at home, at any hour.
The AI examiner listens, asks follow-up questions about what the candidate actually said, keeps time and closes the exam. If the connection drops, the examiner reconnects and continues where it stopped, and the lost time is not counted. The candidate gets a mark out of 25 on the official speaking grid.
How a sitting works
- 1Mic checkQuiet room and recording consent before the clock starts.
- 2Secure tokenShort-lived, and for paid users only.
- 3AI examinerAny of the four voice providers.
- 4TranscriptWith timing and accent.
- 5Mark /25On the official speaking grid.
4 voice providers behind one interface.
Different voices and AI engines.
The exam continues where it stopped.
The voice engine has unit tests.
- Engines are adapters (ElevenLabs over WebRTC, GPT Realtime and Grok via AI Gateway, Gemini Live). The server creates short-lived tokens and refuses unpaid sessions.
- Tool calls during the talk: getElapsedTime for pacing, and a silent reportPhonologie (pronunciation report).
- When it goes wrong: GPT Realtime and Grok sessions reconnect on their own, up to 3 times. The session is rebuilt from the transcript and the lost time is not counted.
- OpenAI Realtime
- xAI Grok Voice
- Gemini Live
- ElevenLabs
- AI Gateway
PrincipleThe exam owns the rules; the engine only carries the voice. That is what lets four engines share one examiner.
AI essay marking
Structured output · StreamingAI marks essays on the official DELF B2 grid.
Each mark appears as it is written. The AI proposes; the code decides the score.
The candidate gets a mark out of 25 on the five criteria of the official grid from France Éducation international, the body that runs the DELF. Each criterion comes with a reason, and the main mistakes are corrected in red pen on the candidate's own sentences. The AI fills a strict form instead of writing an opinion, and the app checks every field before the candidate sees it.
- 1Check the essayA blank essay scores 0 with no AI call, so it costs nothing.Code decidesBlank essay: stop here0/25 · no AI call
- 2AI fills a formCriteria, reasons and corrections, returned as structure, not a paragraph.AI proposes
- 3ValidateEvery field is checked before the candidate sees it.Code decides
- 4Apply the gridLevels snap to the grid's allowed values; the total and penalties are recomputed in code.Code decides
- 5Show liveMarks stream in and appear one by one.Code decides
| The five official criteria | What it checks |
|---|---|
| Réalisation de la tâche | Did the essay do what the subject asked? |
| Cohérence et cohésion | A clear plan, with linked ideas |
| Adéquation sociolinguistique | The right tone for the reader |
| Lexique | Range and precision of vocabulary |
| Morphosyntaxe | Grammar and sentence structure |
Each criterion lands on one of the grid's four levels: not enough to mark, below B2, at B2, strong B2.
- AI SDK streamText with Output.object and a zod schema (strict structured output), streamed over SSE.
- The model's arithmetic is never trusted: levels snap to the grid's allowed values, and the total and penalties are recomputed in code.
- When it goes wrong: failures are classified (rate limit, timeout, model, database) and the attempt is refunded.
- Vercel AI SDK
- OpenAI GPT models
- AI Gateway
- Zod
- Server-sent events
Speech, voice-over and OCR
Speech to text · Text to speech · Pronunciation · OCRFour audio and image tools, one job each.
The platform hears the candidate, speaks the subjects and reads exam pages.
The candidate's recorded talk is typed out word by word, with the timing of each word, then summarised, so the AI examiner opens the debate on what was actually said.
Each speaking subject is read aloud in a natural voice. The admin can also re-record a listening document as a dialogue with several voices.
Judged from the candidate's real voice, not from the written transcript. If the first check fails, a second AI model listens to the recording.
The admin photographs an exam page and gets editable text.
The speaking pipeline
- 1RecordIn the browser.
- 2UploadTo Vercel Blob, with retry.
- 3TranscribeWith word-level timings.
- 4SummariseThe thesis and the arguments.
- 5DebateThe examiner's first question uses the summary.
- Pronunciation: a sample of the real recording goes into the realtime model's input buffer; the level comes back through a silent tool call.
- Gemini 2.5 Pro grades the audio file directly as a fallback when the live path fails.
- OCR: image normalised with sharp, read by GPT vision into a zod union, HTML sanitised.
- ElevenLabs Scribe
- ElevenLabs TTS
- Gemini 2.5 Pro
- GPT vision
- Vercel Blob
AI testing
Human examiner checkProving the AI marks like an examiner.
A new version of the marking instructions goes live only after it passes a test.
Every new version of the AI's marking instructions is tested before candidates see it. We run it on sample essays and speaking transcripts. Most samples are written to be weak in exactly one area, and the AI must find that weakness. Each sample runs three times, so a lucky answer cannot pass. A certified DELF examiner also re-marks real essays blind, and the admin sees the human and AI marks side by side.
- DraftNew version of the instructions
- Run the testsEvery sample, three times
- VerdictPass, unstable or fail
- Human checkBlind re-marking
- Go liveOne live version at a time
- DraftNew version of the instructions
- Run the testsEvery sample, three times
- VerdictPass, unstable or failPassUnstable or fail: back to draft
- Human checkBlind re-marking
- Go liveOne live version at a time
No version goes live without passing.
A stable mark, not a lucky one.
Blind re-marking, criterion by criterion.
One setting; the same tests apply.
- Each version of the instructions is stored, with a tested draft and one live version.
- Blank and too-short essays are control samples: they must score 0.
- The tests run through the same code that marks real candidates.
- The examiner marks blind: they do not see the AI mark.
- Then a side-by-side comparison, criterion by criterion.
- Printable copies for marking on paper.
Stripe payments
Payments · Refunds · ReceiptsStripe: one-time passes, refunds, disputes, receipts.
Pay once, access opens at once, nobody is charged twice.
Candidates buy a 7-, 30- or 60-day pass ($14.99, $29.99 or $49.99) with no subscription to cancel. Access opens as soon as the payment clears, and buying again adds the days on top. A refund or a dispute removes access automatically.
From checkout to access
- 1Choose a passA duplicate guard runs first.
- 2Stripe CheckoutA hosted payment page.
- 3Stripe confirmsCounted once only.
- 4Pass recordedDays stacked, under a lock.
- 5Access + receiptA refund revokes it.
No subscription to cancel.
Buying again extends the pass.
A refund or a dispute removes access by itself.
A guard added after a real double purchase.
- 1Choose a pass· server action
- 2Create Checkout session
- 3Pay on Stripe· hosted checkout
- 4Payment confirmed· signed webhook
- 5Record the pass· lock + insert
- 6Access + receipt· Resend
- 7Refund or dispute· signed webhook
Step 1 / 7 · Choose a passThe duplicate guard runs first: the same pass just paid for cannot be bought again by mistake.
- The webhook covers checkout (instant and delayed payments), refunds and disputes. Each payment is counted once only.
- Passes stack by date under a per-user Postgres lock, so two payments can never race.
- Before each release, a check matches every Stripe price to the price shown on the site.
- When it goes wrong: a full refund removes access; a partial refund is recorded.
- Stripe Checkout
- Stripe webhooks
- Advisory locks
- Resend receipts
Key principleCheckout is instant for the customer. Payment state arrives later, for the application. Access is only ever granted from the signed webhook.
Sign-in, roles and back office
Sign-in · User roles · Back officeSign-in, user roles and a full back office.
The whole business runs from the back office, without touching code.
Candidates sign in with their email or their Google account, with screens in French. Admins, examiners and partners each see only their own portal. From the back office, admins add exams, review AI corrections, give someone a pass and read the month's revenue.
Candidate, admin, examiner, partner.
Every action checks permission on the server.
Import and export the exam dates as a spreadsheet.
Sales by pass type, month by month.
- Clerk with French localisation; users mirrored into Postgres through a Svix-verified webhook; roles in the database.
- Every server action re-checks permission on the server; request headers are never trusted.
- Public pages skip auth so the CDN can cache them; content edits refresh them at once through cache tags.
- Clerk
- Svix webhooks
- Server actions
- Recharts
PrincipleThe product is not finished when the interface works. The business must be able to run it.
Legacy migration
Web scraping · Data migration · Data cleaningThe full question bank moved off WordPress, then checked.
Years of exam content, moved without retyping a single question.
An automated import ran on the old WordPress site, with admin access: it read every exam and copied the questions, images and audio into the new database. The correct answers came from the quiz's own answer checker. A line-by-line audit against the source texts then caught wrong answer keys. We fixed them and recomputed every past score they affected.
Migration pipeline
- 1Old siteWordPress, with admin access.
- 2Logged-in importA tested parser.
- 3AnswersFrom the quiz's own checker.
- 4ImportSafe to run twice.
- 5AuditA human decides.
- of exams, with their images and audio, migrated
- 100%
- questions retyped by hand
- 0
Against the source, word for word.
Recomputed after the answer-key fixes.
- Authenticated session and a pure HTML parser with unit tests; zero failed pages.
- Answer keys from the quiz plugin's own check endpoint, once per quiz, without recording a graded attempt.
- Images re-hosted on Vercel Blob; long recordings cut into one clip per document by silence detection.
- The importer rejects any explanation whose quote does not match the source text or timed transcript word for word.
- TypeScript
- Playwright
- FFmpeg
- PostgreSQL
PrincipleMigration is not copying rows. It is preserving meaning.
Database design
PostgreSQL · Data modellingOne database, built so nothing is lost.
One organised store for everything, designed so history is never lost.
Exams, answers, AI corrections, payments and examiner reviews live in one PostgreSQL database. Every change to its structure is versioned, so staging and production always match. When a user deletes their account, their personal details are erased but the anonymous activity stays, so the business numbers still add up.
Core data model (simplified): every table links back to the user
Roles.
Series, audio.
Attempts.
Prompts, marks.
Passes, refunds.
Reviews.
When a user deletes their account
- 1Account deletedIn the sign-in service.
- 2Signed webhookReceived and checked.
- 3Person erasedName and contact details.
- 4Activity keptAnonymous attempts and payments.
- 5Numbers add upRevenue and scores stay right.
Exams, payments and AI in one place.
The same structure on staging and production.
A deleted account is anonymised.
Old prompts, payments and marks are kept.
- Drizzle ORM with versioned migrations, applied the same way on staging and production.
- Deleted accounts are tombstoned: personal fields cleared, foreign keys kept, so history and totals stay intact.
- Prompts are stored by version, so every past AI mark can be traced to the instructions that produced it.
- PostgreSQL
- Neon
- Drizzle ORM
Exam-centre map
Open data · Interactive mapEvery DELF exam centre in the world, on one map.
From the official French open data, to the candidate's exam day.
The official list of DELF exam centres is public French open data. The app reads it and puts every centre on a world map. The candidate picks a centre and an exam date. The dashboard then counts down to exam day, and an email warns them before registration closes.
From open data to exam day
- 1Official listFrench open data.
- 2On the mapEach city placed once.
- 3Candidate picksA centre and a date.
- 4CountdownOn the dashboard.
- 5Reminder emailBefore registration closes.
- exam centres on the map
- 1,092
- countries
- 167
The admin reloads the official list.
Kept by the admin, with a warning when they run out.
- Centres read from data.education.gouv.fr (France Éducation international, open licence). Each city is geocoded once. A failed fetch writes nothing.
- A globe that turns into a flat map, drawn on a canvas with no map library.
- Open-data API
- Open-Meteo geocoding
- Canvas
- PostgreSQL
Mobile-first exam players
Mobile-first UI · E-learningPhone-first: four exam parts and a full mock exam.
Every screen designed for the phone, then scaled up to the desktop.
Each part of the exam behaves as on exam day. Listening plays with no rewind. Reading keeps the text beside the questions. Writing has a timer and a word counter. The mock exam chains every part with the official timings.
- listening and reading series live
- 34
- writing and speaking subjects live
- 165+
Key journeys run at phone size.
Drafts save themselves; resume after a closed tab.
- Read the questions
- Signal
- First listening
- Pause
- Second listening
- Answer
- Read the questions
- Signal
- One listening
- Answer
No rewind: the audio plays as on exam day, and a watchdog catches audio that stalls.
Under the 5/25 floor, which a high total cannot make up for, in Writing.
- Listening state machine, audio prefetch and a stalled-audio watchdog; karaoke timing from word timestamps.
- Autosaved drafts with a resume dialog and a server clock for the mock exam.
- A separate @mobile Playwright lane runs the key journeys at phone size.
- Tailwind CSS
- shadcn/ui
- Radix
- Playwright
Production readiness
Automated testing · OperationsIn production: tests, email, jobs, analytics and SEO.
The parts nobody sees, and the reason the product keeps working.
Unit tests on scoring, grading rules, access and exam logic. End-to-end tests from the first click to the final database state, on desktop and on phone. So a change to one feature cannot silently break payments or grading.
The right email at the right moment, all sent from one place: receipts, reminders and pass expiry. One click to unsubscribe.
Passes expire on time. Exam-date reminders and refund emails go out on their own, on Vercel Cron.
The owner sees where buyers drop off, in PostHog and GA4, with consent respected before any tracking starts.
Fast public pages that rank: static regeneration, sitemap, structured data and redirects for the old URLs.
Nothing trusts the browser: signed webhooks, signed links, server-side checks, sanitised HTML.
Every change, from laptop to candidates
- 1Feature branchOne change at a time.
- 2Typecheck + lintOn every commit and push.
- 3Staging previewA link to try it.
- 4PlaywrightDesktop and phone journeys.
- 5Productionformation-delf.com.
PrincipleDifferent failures need different tests. A rule is asserted, a journey is clicked through, an AI mark is evaluated.
What we can build
About · StackFull-stack products with AI, built, tested and kept running.
Formation DELF is live at formation-delf.com. Here is what it proves we can build for you.
Accounts, payments, admin and AI features, live and tested.
LLM features with validated output and cost control.
Realtime conversations with OpenAI, Gemini, Grok or ElevenLabs.
Checkout, webhooks, refunds, revenue and back offices.
A faster, phone-first rebuild that keeps your content.
Content extracted, cleaned, verified and imported.
How we work
- 1BriefYou describe the project; we ask what matters.
- 2Fixed priceA clear scope, price and timeline.
- 3PreviewsA staging link you can try as we build.
- 4DeliveryTested, documented, full source code.
Built with
- Next.jsApp Router
- Reactexam players, portals
- TypeScriptstrict
- Tailwind CSSphone first
- shadcn/uidesign system
- Radixaccessible primitives
- PostgreSQLone database
- Neonstaging and production
- Drizzleversioned migrations
- Clerksign-in, 4 roles
- Stripepasses, refunds, disputes
- OpenAIessay marking, OCR, Realtime
- GeminiLive, pronunciation fallback
- ElevenLabsvoice, Scribe, TTS
- AI SDKstructured output, AI Gateway
- xAI GrokGrok Voice
- Resendreceipts, reminders
- PostHogafter consent
- GA4after consent
- Playwrightdesktop and phone
- Vercelhosting, Blob, Cron
Formation DELF · formation-delf.com · Case study updated November 2026.