# Lingua Naija — learn Igbo, Yorùbá & Hausa
A gamified app for learning Igbo, Yorùbá, and Hausa — 10 lessons per language,
four question types (multiple choice, typing, listening, matching), missed
questions retry until you get them right, XP/streaks/badges, and now **real
accounts** so your progress is saved on a server instead of just your browser.
## What changed in this version (Phase 1)
- **Accounts**: sign up / log in with a username and password
- **Server-saved progress**: XP, streak, hearts, completed lessons, and badges
now live in a database, not `localStorage` — so they survive across devices
and browsers
- **Real leaderboard**: ranks actual signed-up users by XP, not placeholder names
- Lesson content (vocab, question generation) is still bundled in the frontend
— no separate content-management step yet; that's a later phase
## Architecture
- `index.html`, `style.css`, `app.js` — the frontend
- `server.js` — an Express server that serves the frontend **and** exposes a
small API (`/api/signup`, `/api/login`, `/api/progress`, `/api/leaderboard`)
- `package.json` — dependencies: `express`, `pg`, `bcryptjs`, `jsonwebtoken`
This app now needs to run as a **Node process**, not a static site, because it
talks to a database on your behalf.
## Environment variables (required)
Set these wherever you host it:
- `DATABASE_URL` — a PostgreSQL connection string
- `JWT_SECRET` — any long random string, used to sign login sessions (don't
reuse a password; a random 32+ character string is fine)
The server will start without them, but every signup/login/progress request
will fail with a clear error until both are set.
## Getting a free PostgreSQL database
**Render's free Postgres expires after 30 days and gets deleted** — not a
great fit for real user accounts. Instead, use a provider with a genuinely
permanent free tier:
- **Neon** — permanent free tier, simple connection
string, no credit card required. Recommended.
- **Supabase** — also has a permanent free t …