A modern, interactive language-learning platform for English ๐ฌ๐ง and French ๐ซ๐ท
Structured CEFR learning โข Smart answer checking โข Progress tracking โข Verb practice โข Exam preparation
โถ Live: languages-lab.vercel.app
LanguageLab is a personal language-learning platform designed to turn a static curriculum into an interactive learning journey.
Instead of simply reading grammar rules, learners move through a structured path:
๐ Learn โ โ๏ธ Practice โ ๐งฉ Get checked โ ๐ Track progress โ ๐ Take the exam โ ๐ Unlock the next level
The project currently contains two language experiences inside one scalable application:
| Language | Path | Exam section |
|---|---|---|
| ๐ฌ๐ง English | A1 โ A2 | ECRF Exams |
| ๐ซ๐ท French | A1 โ A2 | DELF Exams |
The architecture is intentionally language-aware, so additional languages can be introduced without rebuilding the entire application.
A structured progression through CEFR levels with:
- A1 foundation
- A2 everyday communication
- Sequential section unlocking
- Completion tracking
- Revisit mode
- Final-level assessments
- Reserved space for future B1 โ C1 expansion
Every curriculum section contains practical sentence-production exercises.
The learner:
- Reads the prompt.
- Writes an answer.
- Gets checked locally first.
- Uses AI only when the deterministic check cannot resolve the answer.
- Receives feedback.
- Advances only after an accepted answer.
The answer-checking pipeline is deliberately local-first.
Student Answer
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Normalize Answer โ
โโโโโโโโโโฌโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Exact Comparison โ
โโโโโโโโโโฌโโโโโโโโโโ
โ
Match? โโโโโโโโโบ โ
Correct
โ
No
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Typo Tolerance โ
โโโโโโโโโโฌโโโโโโโโโโ
โ
Match? โโโโโโโโโบ โ
Correct
โ
No
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Gemini AI Check โ
โโโโโโโโโโฌโโโโโโโโโโ
โ
โผ
๐งพ Feedback
This means straightforward answers do not need an AI request.
If Gemini is unavailable, the backend still performs the deterministic comparison before returning a fallback result.
Grammar content is loaded from language-specific curriculum data and organized around the learning path.
A dedicated A1/A2 verb-learning experience with:
- Search
- Level filtering
- Conjugation/practice support
- English meanings
- French meanings where applicable
- Weak-point tracking
The application includes dedicated exam areas:
- ๐ฌ๐ง ECRF Exams for English
- ๐ซ๐ท DELF Exams for French
The A1/A2 assessment flow connects to the same curriculum and progression system.
Progress is stored locally in the browser and includes:
- Completed sentences
- Current question
- Maximum reached question
- Level completion
- Final-test pass status
- Verb practice state
No account is required for the current local-progress system.
Two complete visual themes:
- ๐ Dark โ deep blue/navy learning environment
- โ๏ธ Light โ soft white, blue-gray and pastel surfaces
The light theme intentionally avoids harsh black text and flat white panels.
Every free-text answer goes to a server-side route (/api/check-answer, /api/french/check-answer, /api/german/check-answer, /api/vocabulary/check-answer). The route tries a cheap deterministic check first and calls Gemini only when that check can't decide.
flowchart LR
A[Student answer] --> N[Normalize: case, accents, punctuation, spaces]
N --> L{Exact match or small edit distance?}
L -- yes --> OK[Accepted locally, no LLM call]
L -- no --> P[Prompt: exercise + reference answer + student answer + CEFR level]
P --> G[Gemini with a JSON response schema]
G --> V[Structured verdict: correct, score, feedback, correction, errorType, levelFit]
V --> F[Feedback shown to the learner]
G -. error or all models fail .-> FB[Local fallback verdict]
FB --> F
- Prompt. A system instruction fixes the grader's role, the exercise language, the language the feedback must be written in (Arabic for English exercises, English for French and German), what to accept (synonyms, contractions, valid word order, more advanced but correct phrasing) and the learner's CEFR level. The user turn carries the task, the reference answer and the student's answer.
- Gemini.
src/lib/gemini.jscalls the GeminigenerateContentendpoint withresponseMimeType: application/jsonand aresponseSchema, so the model must return a typed object, not prose. - Structured verdict. The schema requires
correct(boolean),score(0 to 100),feedback,correction,errorTypeandlevelFit. The vocabulary route uses a smaller{ correct, feedback, correction }schema. - Feedback. The app shows the verdict and only lets the learner advance on an accepted answer.
Guardrails in the code
- Local-first. Exact matches and small typos (edit distance of 1 to 3, depending on answer length) are accepted without an LLM call.
- Schema-constrained output. A response that isn't valid JSON is rejected as an error rather than shown to the learner.
- Model fallback chain. On retryable errors (404, 429, 5xx) the call moves on to the next model in the list.
- Graceful degradation. If every model fails, the route returns a deterministic
checker-unavailableverdict with the reference answer instead of an error page. - Server-only key.
GEMINI_API_KEYis read only inside the API routes; it is never aNEXT_PUBLIC_variable and never reaches the browser. - Scoped acceptance rules. The vocabulary grader is told explicitly not to accept related words, broader or narrower concepts, or opposites.
LanguageLab is built around a few simple principles:
Soft, focused UI
The interface should help you study, not compete with the lesson.
Progressive disclosure
Don't show everything at once. Unlock complexity as the learner progresses.
Clear hierarchy
Prompt โ answer โ feedback โ progress.
Language-aware branding
English and French share the same application architecture while retaining their own language, branding and curriculum.
No unnecessary visual noise
Soft surfaces, subtle borders, restrained gradients and purposeful color accents.
| Layer | Technology |
|---|---|
| Framework | Next.js 15 |
| UI | React 19 |
| Styling | Tailwind CSS 4 |
| Language | JavaScript |
| AI checking | Google Gemini API |
| State | React state + localStorage |
| Data | JSON curriculum datasets |
| Deployment | Vercel |
| Runtime | Node.js 20 |
LanguageLab/
โโโ public/
โ โโโ assets/
โ โ โโโ images/
โ โ โโโ logo/
โ โโโ data/
โ โโโ languages/
โ โโโ en/
โ โ โโโ curriculum.json
โ โ โโโ grammar.json
โ โ โโโ verbs.json
โ โโโ fr/
โ โโโ curriculum.json
โ โโโ grammar.json
โ โโโ verbs.json
โ
โโโ src/
โ โโโ app/
โ โ โโโ api/
โ โ โ โโโ check-answer/
โ โ โ โโโ french/
โ โ โ โโโ generate-report/
โ โ โโโ globals.css
โ โ โโโ layout.jsx
โ โ โโโ page.jsx
โ โ
โ โโโ components/
โ โ โโโ LanguageLabApp.jsx
โ โ
โ โโโ lib/
โ โโโ gemini.js
โ
โโโ scripts/
โ โโโ validate-curriculum.mjs
โ
โโโ .nvmrc
โโโ package.json
โโโ postcss.config.mjs
โโโ vercel.json
The application is built around a language configuration registry.
Each language can define:
- ๐ท๏ธ Name and subtitle
- ๐จ Logo
- ๐ฉ Language switch target
- ๐ Curriculum
- ๐ค Verb database
- ๐ Grammar database
- ๐ค Answer-check endpoint
Conceptually:
const CONFIG = {
en: {
name: "English Lab",
curriculum: "...",
verbs: "...",
grammar: "...",
check: "/api/check-answer"
},
fr: {
name: "Franรงais Lab",
curriculum: "...",
verbs: "...",
grammar: "...",
check: "/api/french/check-answer"
}
};That makes future expansion such as:
๐ฉ๐ช German Lab
๐ช๐ธ Espaรฑol Lab
๐ฎ๐น Italiano Lab
possible without duplicating the entire application.
Gemini is intentionally not the first line of defense.
The local checker handles:
- Case differences
- Whitespace differences
- Punctuation differences
- Accent normalization
- Minor spelling differences
- Exact stored-answer matches
Gemini handles cases where the learner gives a different but potentially valid answer, such as:
- Natural synonyms
- Meaning-preserving alternatives
- Different valid word order
- Valid contractions
- More advanced but grammatically correct phrasing
This keeps the experience faster and reduces unnecessary AI requests.
Create a local .env.local file:
GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-3.8-flash
GEMINI_FALLBACK_MODEL=gemini-3.7-flashThe Gemini API key is used server-side and should never be exposed in client-side code.
For Vercel, add the same variables under:
Project โ Settings โ Environment Variables
git clone https://github.com/Nardy11/LanguageLab.git
cd LanguageLabnpm installCreate .env.local and add your Gemini credentials.
npm run validate:datanpm run devOpen:
http://localhost:3000
npm run build
npm startLanguageLab is configured for Vercel/Next.js deployment.
The repository contains:
- vercel.json
- Node 20 configuration
- Next.js build scripts
- Server-side API routes
- Public curriculum assets
Recommended deployment flow:
GitHub
โ
โผ
Vercel
โ
โโโ Next.js application
โโโ Static curriculum data
โโโ Server-side Gemini routes
A1 โโโโโโโโโโโโโโโโบ A2
โ โ
โโ Sections โโ Sections
โโ Rules โโ Rules
โโ Verb Bank โโ Verb Bank
โโ Practice โโ Practice
โโ Final Exam โโ Final Exam
A1 โ A2 โ B1 โ B2 โ C1
B1, B2 and C1 are reserved in the learning-path architecture for future curriculum releases.
The curriculum is kept outside the React component so content and application logic remain separate.
That makes it possible to:
- Update sentences without rewriting UI code.
- Add sections without rebuilding the learning engine.
- Maintain separate English/French content.
- Validate datasets independently.
- Introduce new languages using the same application architecture.
- Keep curriculum data separate from UI logic.
- Prefer deterministic checks before AI.
- Keep API keys server-side.
- Preserve local progress when changing navigation.
- Keep English/French structures aligned.
- Avoid duplicating language-specific application logic.
- Keep the UI responsive from desktop to mobile.
- Prefer reusable components and theme tokens over one-off styling.
- ๐ฌ๐ง English A1/A2 learning path
- ๐ซ๐ท French A1/A2 learning path
- ๐ Grammar / Rules section
- ๐ค Verb Bank
- ๐ Local progress persistence
- ๐ Revisit mode
- ๐ Final assessments
- ๐ค Local-first + Gemini answer checking
- ๐ Dark mode
- โ๏ธ Soft light mode
- ๐ English/French language switching
- ๐ฉ๐ช German Lab
- ๐ B1 curriculum
- ๐ B2 curriculum
- ๐ C1 curriculum
- ๐ค Optional cloud accounts
- โ๏ธ Cross-device progress sync
language-learning ยท english-learning ยท french-learning ยท cefr ยท a1 ยท a2 ยท delf ยท ecrf ยท grammar ยท verb-bank ยท education ยท edtech ยท nextjs ยท react ยท tailwindcss ยท gemini-ai ยท generative-ai ยท vercel ยท javascript
Most language-learning interfaces separate grammar, vocabulary, exercises and progress into disconnected experiences.
LanguageLab brings them together into one continuous path:
Learn โ Practice โ Check โ Improve โ Progress โ Test
The goal is not to make another collection of flashcards.
The goal is to build a structured language-learning environment that feels like a real course while remaining lightweight, responsive and extensible.
Nardy Attalla
Computer Science & Engineering ยท Full-Stack Development ยท AI/ML
- ๐ Portfolio: https://ai-interactive-portfolio.vercel.app/
- ๐ผ LinkedIn: https://www.linkedin.com/in/nardy-attallah/
- ๐ GitHub: https://github.com/Nardy11
๐ฌ๐ง LanguageLab ยท ๐ซ๐ท Franรงais Lab
Learn consistently. Practice actively. Track everything. ๐
