Formation DELF

June 2026 – Present

An 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.

Client projectLiveAI SaaSNext.jsMobile-first web appAI markingVoice agentPayments
01

Product overview

Full-stack AI SaaS

From 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.

AreaBeforeAfterSkills shown
Reading, listeningMultiple-choice onlyTimed players, real exam protocolExam engine
WritingNo essay correctionAI mark out of 25 on the official gridAI, structured output
SpeakingNo speaking practiceLive AI voice examinerVoice agent
SpeedSlow page loadsFast, cached pagesPerformance
DesignDated themeModern, consistent interfaceUI/UX design
PhoneDesktop theme, shrunkDesigned for the phone firstMobile-first UI
PaymentsWooCommerce checkoutStripe passes, refunds, receiptsStripe
ContentTyped into pluginsScraped, migrated, then auditedScraping, data
Running itWordPress back endFull back office: content, sales, usersAdmin dashboard

Four portals, one app

Candidates
  • Projected score
  • Practice, all 4 exam parts
  • Timed mock exam
  • Essay and oral practice
  • History and receipts
Admin
  • Exams and topics
  • Users and passes
  • AI marks and reviews
  • Answer-key checks
  • Partners and reviews
Examiners
  • Blind essay re-marking
  • AI mark side by side
  • Printable copies
  • Questionnaire
Partners
  • Tutors refer candidates
  • Earn a commission
  • Sign-ups and sales
  • Payouts and team
The candidate dashboard: a projected 61/100, 11 points above the pass mark, and the week's goals. Desktop and phone.
02

Architecture

Full-stack

One 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

Who uses it
  • Candidatesphone and desktop
  • Owner / admincontent, sales, AI
  • Examinershuman, blind re-marking
  • Partnersreferral links
Web app · Next.js on Vercel
  • 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
AI layer
  • Text AImarking, summaries, reading photos (OCR)
  • Realtime voiceOpenAI Realtime · Grok · Gemini Live · ElevenLabs
  • Speechspeech to text, voice-over, pronunciation
Data
  • PostgreSQL on Neon · Drizzle ORMone database, full history
  • Prompt storetested draft, one live version
  • Vercel Blobaudio, images
External services
  • Stripepayments and refunds
  • Clerksign-in and accounts
  • Resendall the emails
  • PostHog, GA4only after consent
  • French open dataDELF exam centres
Architecture principle

Sign-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
03

AI voice examiner

Voice agent · Realtime AI

A 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

  1. 1Mic checkQuiet room and recording consent before the clock starts.
  2. 2Secure tokenShort-lived, and for paid users only.
  3. 3AI examinerAny of the four voice providers.
  4. 4TranscriptWith timing and accent.
  5. 5Mark /25On the official speaking grid.
No vendor lock-in

4 voice providers behind one interface.

Choice of examiner

Different voices and AI engines.

Resumes after a drop

The exam continues where it stopped.

Tested code

The voice engine has unit tests.

Before the sitting: the subject, a microphone check, a quiet-room reminder, recording consent and the choice of AI examiner, here ElevenLabs.
Realtime architecture, at a glance
CandidateMicrophone check, quiet-room guidance and recording consent before the clock starts.
Exam sessionA state machine owns timing and phase. The engine never decides when the talk ends.
PreparationTalkDebate
Voice engine · one examiner contract
Examiner contractEvery engine is an adapter. The server creates short-lived tokens and refuses unpaid sessions.
Four engines behind the same interface, picked per sitting
GPT RealtimeGrok VoiceGemini LiveElevenLabs
RecordingsTalk and debate audio stored per sitting, with the transcript, for marking and review.
Mark /25Criterion by criterion, on the official speaking grid.
Pronunciation fallbackIf the live check fails, Gemini 2.5 Pro listens to the recording. A transcript cannot judge pronunciation.
The talk, live: the candidate is speaking, the clock runs down, the plan stays in view. Desktop and phone.
A sitting marked 19/25: criterion by criterion, with the full transcript beside it.
For technical readers
  • 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.
Built with
  • OpenAI Realtime
  • xAI Grok Voice
  • Gemini Live
  • ElevenLabs
  • AI Gateway
Principle

The exam owns the rules; the engine only carries the voice. That is what lets four engines share one examiner.

04

AI essay marking

Structured output · Streaming

AI 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.

From essay to mark
  1. 1
    Check the essayA blank essay scores 0 with no AI call, so it costs nothing.
    Code decidesBlank essay: stop here0/25 · no AI call
  2. 2
    AI fills a formCriteria, reasons and corrections, returned as structure, not a paragraph.
    AI proposes
  3. 3
    ValidateEvery field is checked before the candidate sees it.
    Code decides
  4. 4
    Apply the gridLevels snap to the grid's allowed values; the total and penalties are recomputed in code.
    Code decides
  5. 5
    Show liveMarks stream in and appear one by one.
    Code decides
The five official criteriaWhat it checks
Réalisation de la tâcheDid the essay do what the subject asked?
Cohérence et cohésionA clear plan, with linked ideas
Adéquation sociolinguistiqueThe right tone for the reader
LexiqueRange and precision of vocabulary
MorphosyntaxeGrammar and sentence structure

Each criterion lands on one of the grid's four levels: not enough to mark, below B2, at B2, strong B2.

Writing under exam conditions: the subject in view, the 60-minute clock and a live word count. Desktop and phone.
An essay marked 25/25: each of the five criteria scored and explained, with the red-pen corrections on the candidate's own text.
For technical readers
  • 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.
Built with
  • Vercel AI SDK
  • OpenAI GPT models
  • AI Gateway
  • Zod
  • Server-sent events
05

Speech, voice-over and OCR

Speech to text · Text to speech · Pronunciation · OCR

Four audio and image tools, one job each.

The platform hears the candidate, speaks the subjects and reads exam pages.

Speech to text

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.

Text to speech (voice-over)

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.

Pronunciation

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.

OCR (reading text from a photo)

The admin photographs an exam page and gets editable text.

The speaking pipeline

  1. 1RecordIn the browser.
  2. 2UploadTo Vercel Blob, with retry.
  3. 3TranscribeWith word-level timings.
  4. 4SummariseThe thesis and the arguments.
  5. 5DebateThe examiner's first question uses the summary.
The listening player, with a word-by-word transcript once the document has played. Desktop and phone.
For technical readers
  • 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.
Built with
  • ElevenLabs Scribe
  • ElevenLabs TTS
  • Gemini 2.5 Pro
  • GPT vision
  • Vercel Blob
06

AI testing

Human examiner check

Proving 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.

Release gate for new marking instructions
  1. DraftNew version of the instructions
  2. Run the testsEvery sample, three times
  3. VerdictPass, unstable or fail
    PassUnstable or fail: back to draft
  4. Human checkBlind re-marking
  5. Go liveOne live version at a time
Tested before release

No version goes live without passing.

Run three times

A stable mark, not a lucky one.

A human examiner

Blind re-marking, criterion by criterion.

Safe model switch

One setting; the same tests apply.

The examiner portal: an anonymous essay (candidate n°183, 267 words) marked blind on the official grid, before the AI's mark is shown.
Accuracy
  • 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.
Human check
  • 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.
The AI test bench in the back office: each run tied to the model and the version of the instructions it used. Desktop and phone.
07

Stripe payments

Payments · Refunds · Receipts

Stripe: 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

  1. 1Choose a passA duplicate guard runs first.
  2. 2Stripe CheckoutA hosted payment page.
  3. 3Stripe confirmsCounted once only.
  4. 4Pass recordedDays stacked, under a lock.
  5. 5Access + receiptA refund revokes it.
Pay once

No subscription to cancel.

Days add up

Buying again extends the pass.

Refunds handled

A refund or a dispute removes access by itself.

Never charged twice

A guard added after a real double purchase.

Three pass tiers, paid once: Bronze at $14.99, Silver at $29.99 and Gold at $49.99, and the first series free without a card.
What happens when a candidate buys a pass
Browserthe candidate
App serverNext.js on Vercel
Stripecheckout and events
Postgrespasses
  1. 1Choose a pass· server action
  2. 2Create Checkout session
  3. 3Pay on Stripe· hosted checkout
  4. 4Payment confirmed· signed webhook
  5. 5Record the pass· lock + insert
  6. 6Access + receipt· Resend
  7. 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.

Press play, or click any arrow, to follow one purchase from the button to the database and back.
For technical readers
  • 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.
Built with
  • Stripe Checkout
  • Stripe webhooks
  • Advisory locks
  • Resend receipts
Key principle

Checkout is instant for the customer. Payment state arrives later, for the application. Access is only ever granted from the signed webhook.

08

Sign-in, roles and back office

Sign-in · User roles · Back office

Sign-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.

Admin home: accounts and passes over time, and sales by pass type. Shown with demo data.
4 roles

Candidate, admin, examiner, partner.

Safe by default

Every action checks permission on the server.

Exam calendar

Import and export the exam dates as a spreadsheet.

Revenue at a glance

Sales by pass type, month by month.

For technical readers
  • 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.
Built with
  • Clerk
  • Svix webhooks
  • Server actions
  • Recharts
Principle

The product is not finished when the interface works. The business must be able to run it.

09

Legacy migration

Web scraping · Data migration · Data cleaning

The 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

  1. 1Old siteWordPress, with admin access.
  2. 2Logged-in importA tested parser.
  3. 3AnswersFrom the quiz's own checker.
  4. 4ImportSafe to run twice.
  5. 5AuditA human decides.
of exams, with their images and audio, migrated
100%
questions retyped by hand
0
Explanations checked

Against the source, word for word.

Past scores fixed

Recomputed after the answer-key fixes.

The migrated series, now in the new catalogue, each with its publishing state, free access and exam-player check.
For technical readers
  • 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.
Built with
  • TypeScript
  • Playwright
  • FFmpeg
  • PostgreSQL
Principle

Migration is not copying rows. It is preserving meaning.

10

Database design

PostgreSQL · Data modelling

One 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

Users

Roles.

Content

Series, audio.

Activity

Attempts.

AI

Prompts, marks.

Billing

Passes, refunds.

Examiners

Reviews.

When a user deletes their account

  1. 1Account deletedIn the sign-in service.
  2. 2Signed webhookReceived and checked.
  3. 3Person erasedName and contact details.
  4. 4Activity keptAnonymous attempts and payments.
  5. 5Numbers add upRevenue and scores stay right.
One database

Exams, payments and AI in one place.

Versioned changes

The same structure on staging and production.

Privacy built in

A deleted account is anonymised.

Full history

Old prompts, payments and marks are kept.

For technical readers
  • 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.
Built with
  • PostgreSQL
  • Neon
  • Drizzle ORM
11

Exam-centre map

Open data · Interactive map

Every 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

  1. 1Official listFrench open data.
  2. 2On the mapEach city placed once.
  3. 3Candidate picksA centre and a date.
  4. 4CountdownOn the dashboard.
  5. 5Reminder emailBefore registration closes.
exam centres on the map
1,092
countries
167
One-click refresh

The admin reloads the official list.

Exam dates by country

Kept by the admin, with a warning when they run out.

The exam-centre map, from French open data: 1,092 centres in 167 countries, searchable by city, centre or country.
For technical readers
  • 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.
Built with
  • Open-data API
  • Open-Meteo geocoding
  • Canvas
  • PostgreSQL
12

Mobile-first exam players

Mobile-first UI · E-learning

Phone-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 playerPlays with no rewind, on the official timings.
ReadingThe text beside the questions.
WritingA timer and a live word counter.
SpeakingThe talk recorded, then the AI examiner.
Full mock examEvery part chained, scored /100.
listening and reading series live
34
writing and speaking subjects live
165+
Tested on a phone

Key journeys run at phone size.

Nothing lost

Drafts save themselves; resume after a closed tab.

The listening protocol
Two-listening exercises
  1. Read the questions
  2. Signal
  3. First listening
  4. Pause
  5. Second listening
  6. Answer
Single-listening exercises
  1. Read the questions
  2. Signal
  3. One listening
  4. Answer
Reading timeAudio signalAudio playsPauseAnswering window

No rewind: the audio plays as on exam day, and a watchdog catches audio that stalls.

The order the player enforces for each document. Segment widths show the sequence, not exact durations.
The mock exam: the parts chained in exam order, with the questions, time and points shown before the clock starts. Desktop and phone.
The real DELF pass rule · move the scores
Total53.5 /100
Fail

Under the 5/25 floor, which a high total cannot make up for, in Writing.

For technical readers
  • 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.
Built with
  • Tailwind CSS
  • shadcn/ui
  • Radix
  • Playwright
13

Production readiness

Automated testing · Operations

In production: tests, email, jobs, analytics and SEO.

The parts nobody sees, and the reason the product keeps working.

Tested before every release

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.

Email

The right email at the right moment, all sent from one place: receipts, reminders and pass expiry. One click to unsubscribe.

Scheduled jobs

Passes expire on time. Exam-date reminders and refund emails go out on their own, on Vercel Cron.

Analytics and GDPR

The owner sees where buyers drop off, in PostHog and GA4, with consent respected before any tracking starts.

SEO

Fast public pages that rank: static regeneration, sitemap, structured data and redirects for the old URLs.

Security

Nothing trusts the browser: signed webhooks, signed links, server-side checks, sanitised HTML.

Every change, from laptop to candidates

  1. 1Feature branchOne change at a time.
  2. 2Typecheck + lintOn every commit and push.
  3. 3Staging previewA link to try it.
  4. 4PlaywrightDesktop and phone journeys.
  5. 5Productionformation-delf.com.
Principle

Different failures need different tests. A rule is asserted, a journey is clicked through, an AI mark is evaluated.

14

What we can build

About · Stack

Full-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.

An AI SaaS from scratch

Accounts, payments, admin and AI features, live and tested.

AI in your existing product

LLM features with validated output and cost control.

Voice agents

Realtime conversations with OpenAI, Gemini, Grok or ElevenLabs.

Stripe and dashboards

Checkout, webhooks, refunds, revenue and back offices.

WordPress or Wix to a custom app

A faster, phone-first rebuild that keeps your content.

Scraping and data migration

Content extracted, cleaned, verified and imported.

How we work

  1. 1BriefYou describe the project; we ask what matters.
  2. 2Fixed priceA clear scope, price and timeline.
  3. 3PreviewsA staging link you can try as we build.
  4. 4DeliveryTested, documented, full source code.

Built with

App
  • Next.jsApp Router
  • Reactexam players, portals
  • TypeScriptstrict
UI
  • Tailwind CSSphone first
  • shadcn/uidesign system
  • Radixaccessible primitives
Data
  • PostgreSQLone database
  • Neonstaging and production
  • Drizzleversioned migrations
Auth and payments
  • Clerksign-in, 4 roles
  • Stripepasses, refunds, disputes
AI
  • OpenAIessay marking, OCR, Realtime
  • GeminiLive, pronunciation fallback
  • ElevenLabsvoice, Scribe, TTS
  • AI SDKstructured output, AI Gateway
  • xAI GrokGrok Voice
Email and analytics
  • Resendreceipts, reminders
  • PostHogafter consent
  • GA4after consent
Testing and hosting
  • Playwrightdesktop and phone
  • Vercelhosting, Blob, Cron

Formation DELF · formation-delf.com · Case study updated November 2026.