Skip to content

About

Multi-language learning PWA (basiclanguage.school) with 15 languages, 210 pairs, 14,500+ neural TTS clips, 8 phonetic keyboards, offline binary audio packs, and Supabase RLS sync.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

165 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ Basic Language School

An interactive, high-performance multi-language learning platform offering 15 world languages across 210 bidirectional language pairs, featuring 14,500+ studio-quality neural audio recordings, adaptive spaced-repetition quizzes, interactive grammar & flashcards, 8 non-Latin phonetic virtual keyboards, single-file offline audio binary packs, and Progressive Web App (PWA) support.

React TypeScript Vite Vitest Playwright Supabase Edge TTS PWA Hosted on Netlify License: MIT


๐ŸŒŸ Overview

Basic Language School (basiclanguage.school) unifies foundational world language education into a single streamlined, ad-free web application. Learn any of 15 major world languages directly from any of the 15 supported base interface languages (210 bidirectional learning directions) with zero paywalls, shared authentication, cross-course progress tracking, and zero-latency studio neural audio.

๐Ÿ“š Supported Languages (All 15 Live ยท 210 Bidirectional Pairs)

Code Language Native Script Curriculum Scope Neural Voice Model
en English Latin Phonics Aโ€“Z, phrases, numbers & time, 500+ words, grammar & quiz en-US-JennyNeural
es Spanish Latin Alphabet (รฑ), phrases, numbers & time, 500+ words, grammar & quiz es-MX-JorgeNeural
fr French Latin Alphabet, liaisons & nasal vowels, phrases, numbers, 500+ words, grammar fr-FR-HenriNeural
de German Latin Alphabet (รค, รถ, รผ, รŸ), cases & genders, phrases, numbers, 500+ words de-DE-ConradNeural
pt Portuguese Latin Alphabet (รง, accents), phrases, numbers & time, 500+ words, grammar pt-BR-AntonioNeural
id Indonesian Latin Alphabet phonetics, phrases, numbers & time, 500+ words, grammar id-ID-ArdiNeural
tr Turkish Latin Alphabet (รง, ฤŸ, ฤฑ, i, รถ, ลŸ, รผ), phrases, numbers, 500+ words, grammar tr-TR-AhmetNeural
ru Russian Cyrillic 33 Cyrillic letters, phonetic keyboard, phrases, numbers, 500+ words, grammar ru-RU-SvetlanaNeural
zh Mandarin Chinese Hanzi & Pinyin Pinyin & 4-tone guide, Hanzi basics, phonetic IME, phrases, 500+ words zh-CN-XiaoxiaoNeural
ja Japanese Hiragana / Katakana Kana charts, phonetic keyboard, phrases, numbers, 500+ words, grammar ja-JP-NanamiNeural
ko Korean Hangul Jamo syllable blocks, phonetic keyboard, phrases, numbers, 500+ words ko-KR-InJoonNeural
hi Hindi Devanagari Vowels & consonants, phonetic keyboard, phrases, numbers, 500+ words hi-IN-SwaraNeural
ar Arabic Arabic (RTL) 28 letters & forms, RTL layout, phonetic keyboard, phrases, 500+ words ar-SA-ZariyahNeural
bn Bengali Bengaliโ€“Assamese Sworoborno & Byanjonborno, phonetic keyboard, phrases, 500+ words bn-BD-NabanitaNeural
ur Urdu Nastaliq (RTL) Arabicโ€“Persian script, RTL layout, phonetic keyboard, phrases, 500+ words ur-PK-UzmaNeural

๐Ÿš€ Key Features

  • ๐ŸŒ 210 Bidirectional Language Pairs (15 Languages): Set your native interface language ("I speak") and target course ("I want to learn") independently across all 15 languages with automatic audio halting, RTL layout adaptation (ar, ur), localized grammar explanations, and dedicated SVG academic emblems (AppEmblem.tsx).
  • ๐Ÿ“˜ Interactive Grammar, Verb Tables & Gender/Rule Flashcards: Interactive noun-gender tabs, verb conjugation tables, grammar descriptions with neural audio speakers, and expanded 16-card rule/gender flashcards with clickable option neural audio and crisp Web Audio API sound chimes (correct / incorrect).
  • ๐Ÿฎ Mandarin Pinyin & Tones Guide (PinyinGuide.tsx): Dedicated multi-tab Pinyin companion covering the 4 Mandarin tones, syllable anatomy (Initials/Finals), phonetic IME typing workflows, and interactive sound filters.
  • ๐Ÿ›๏ธ Cultural & Script Origins (LanguageAbout.tsx): Localized deep dives into each language's history, writing system evolution (such as Simplified vs. Traditional Chinese comparisons), timelines, and structural traits.
  • โŒจ๏ธ 8 Non-Latin Phonetic Virtual Keyboards + Live Sound-Out Spacebar Conversion: Integrated clickable phonetic keyboards and live sound-it-out + Spacebar conversion in quiz input mode across all 8 non-Latin scripts (ru, ar, ur, hi, bn, ja, ko, zh).
  • ๐ŸŽ™๏ธ 14,500+ Studio Neural Audio Recordings & Speed Controls: Pre-rendered native MP3 pronunciations generated via Microsoft Edge Neural TTS with variable speed control (0.5ร— to 1.25ร—), word/example playback inside revealed cards, and clean browser TTS fallback.
  • ๐Ÿ“ฆ Instant Single-File Offline Audio Binary Packs (offline-pack.bin): Each language bundles all its MP3 clips into a single contiguous binary archive (public/audio/<lang>/offline-pack.bin) with byte-offset manifests (manifest.json), enabling rapid one-click offline downloads into browser Cache Storage for full Airplane Mode playback (OfflineAudioModal.tsx).
  • ๐ŸŽฏ Adaptive Quiz Engine with Fuzzy Typo Tolerance: Supports Source-to-Target, Target-to-Source, Listening Mode, smart script normalization, and Levenshtein typo detection that accepts harmless slips while rejecting near-miss real words.
  • โ˜๏ธ Cloud Sync & Privacy-First Guest Mode (Supabase): Local progress persistence by default with optional Google, Microsoft Entra ID, and GitHub OAuth 2.0 / OIDC cloud synchronization (progressService.ts) backed by PostgreSQL Row Level Security (RLS).

๐Ÿ”’ Security Architecture

  • Strict Content Security Policy (CSP): Enforces script-src 'self' (no 'unsafe-inline' or 'unsafe-eval'), worker-src 'self', manifest-src 'self', object-src 'none', base-uri 'self', frame-ancestors 'none', form-action 'self', and upgrade-insecure-requests.
  • OWASP HTTP Headers: Configured in netlify.toml with HSTS (max-age=31536000; includeSubDomains; preload), X-Frame-Options: DENY, X-Content-Type-Options: nosniff, X-XSS-Protection: 0, Cross-Origin-Opener-Policy: same-origin-allow-popups, Referrer-Policy: strict-origin-when-cross-origin, and restrictive Permissions-Policy.
  • Database Row Level Security (RLS) & Constraints: PostgreSQL tables (public.profiles, public.quiz_sessions, public.word_progress) revoke anon access, enforce auth.uid() = id / auth.uid() = user_id RLS policies across all SELECT/INSERT/UPDATE/DELETE operations, and validate score/mastery/URL bounds via SQL CHECK constraints (see docs/schema.sql).
  • Zero Password Handling & Safe Client Storage: Passwordless federated OAuth 2.0 / OIDC sign-in, strict https: validation on Supabase endpoints and OAuth avatar URLs (referrerPolicy="no-referrer"), audio pack filename sanitization, and prototype-pollution-safe localStorage parsing.

Detailed system architecture and database design are documented in docs/BACKEND_PLAN.md.


๐Ÿค– Built with Google Antigravity & Gemini

This project is actively developed and architected using Google Antigravity paired with Google Gemini / Advanced Agentic AI.

  • Agentic Pair Programming: Used Antigravity's autonomous multi-step workflows to build and audit 15 languages across 210 bidirectional pairs, implement phonetic virtual keyboards and offline binary audio packs, harden security headers and RLS schemas, and maintain Vitest and Playwright test suites.
  • Architectural Velocity: Demonstrates AI-accelerated full-stack engineering while maintaining strict TypeScript type safety, comprehensive test coverage, and security standards.

๐Ÿ› ๏ธ Tech Stack

  • Frontend: React 19.3, TypeScript 5.9, Modern CSS (CSS Variables, Flexbox/Grid, RTL support, Glassmorphism)
  • Routing: Universal multi-language dual routing (/learn/:lang/:section, /:lang/:section, and root routes) with dynamic SEO metadata
  • Build System & PWA: Vite 6, @vitejs/plugin-react v5, vite-plugin-pwa v2 (Workbox), custom offline audio pack bundler (scripts/build-offline-packs.mjs)
  • Testing:
    • Unit & Integration: Vitest 5, React Testing Library 16, JSDOM (1,565 tests across 58 suites)
    • End-to-End: Playwright Chromium (21 E2E browser specs covering desktop, 390px mobile, RTL, Pinyin, phonetic typing, offline Airplane Mode, and neural audio)
  • Backend & Auth: Supabase PostgreSQL, Row Level Security (RLS), OAuth 2.0 / OIDC (Google, Microsoft Entra ID, GitHub)
  • Audio Pipeline: Python edge-tts studio batch synthesis (scripts/generate-all-audio.py) + Web Speech API fallback
  • Hosting & CDN: Netlify (301 domain redirects, OWASP security headers, SSL, SPA fallback rules)

๐Ÿ“ Project Structure

basic-language-school/
โ”œโ”€โ”€ CONTRIBUTING.md             # Contribution guidelines & curriculum PR workflow
โ”œโ”€โ”€ SECURITY.md                 # Security policy & vulnerability reporting
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ BACKEND_PLAN.md         # Cloud sync & OAuth integration architecture
โ”‚   โ””โ”€โ”€ schema.sql              # Supabase PostgreSQL schema with RLS policies
โ”œโ”€โ”€ e2e/
โ”‚   โ”œโ”€โ”€ chinesePinyinAboutAndTypoQuiz.spec.ts
โ”‚   โ””โ”€โ”€ languageMatrixAndLayout.spec.ts
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ build-offline-packs.mjs # Packages each language's MP3s into offline-pack.bin
โ”‚   โ”œโ”€โ”€ generate-offline-manifests.mjs
โ”‚   โ”œโ”€โ”€ generate-all-audio.py   # Microsoft Edge Neural TTS batch generator
โ”‚   โ””โ”€โ”€ render-og-image.js      # Renders public/og-image.svg -> public/og-image.png
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ audio/                  # Pre-rendered neural MP3s & offline-pack.bin per language
โ”‚   โ”œโ”€โ”€ privacy/index.html      # Static Privacy Policy page
โ”‚   โ”œโ”€โ”€ terms/index.html        # Static Terms of Service page
โ”‚   โ”œโ”€โ”€ app-icon.svg            # Universal app crest vector source
โ”‚   โ”œโ”€โ”€ manifest.json           # PWA Web App Manifest
โ”‚   โ”œโ”€โ”€ og-image.svg / .png     # 15-language OpenGraph social preview banner
โ”‚   โ”œโ”€โ”€ robots.txt & sitemap.xml
โ”‚   โ””โ”€โ”€ favicon.ico
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ App.tsx                 # Main application shell, routing & dynamic SEO metadata
    โ”œโ”€โ”€ contexts/
    โ”‚   โ””โ”€โ”€ LanguageContext.tsx # Base/target language state, routing sync & audio halt
    โ”œโ”€โ”€ components/
    โ”‚   โ”œโ”€โ”€ Alphabet.tsx        # Alphabet, script, Grammar & Cultural About host
    โ”‚   โ”œโ”€โ”€ AppEmblem.tsx       # Custom SVG graduation-cap emblems for all 15 languages
    โ”‚   โ”œโ”€โ”€ FlagIcon.tsx        # Cross-platform vector SVG flags for all 15 languages
    โ”‚   โ”œโ”€โ”€ Grammar.tsx         # Noun genders, verbs, descriptions & audio flashcards
    โ”‚   โ”œโ”€โ”€ LanguageAbout.tsx   # Localized cultural, historical & script origins tabs
    โ”‚   โ”œโ”€โ”€ LanguageSwitcher.tsx# Base & target language picker modals
    โ”‚   โ”œโ”€โ”€ NumbersAndTime.tsx  # Number reference & telling-time grammar guides
    โ”‚   โ”œโ”€โ”€ OfflineAudioModal.tsx # Offline pack selector & Cache Storage progress UI
    โ”‚   โ”œโ”€โ”€ PhoneticKeyboard.tsx# Virtual phonetic keyboards (ar, ur, hi, bn, ja, ko, zh)
    โ”‚   โ”œโ”€โ”€ Phrases.tsx         # Categorized phrases & 500+ topic vocabulary packs
    โ”‚   โ”œโ”€โ”€ PinyinGuide.tsx     # Mandarin tones, initials/finals & phonetic IME guide
    โ”‚   โ”œโ”€โ”€ PronunciationButton.tsx # Offline CacheFirst MP3 & Web Speech fallback button
    โ”‚   โ”œโ”€โ”€ Quiz.tsx            # Adaptive quiz engine with phonetic typing & feedback
    โ”‚   โ”œโ”€โ”€ RussianKeyboard.tsx # On-screen Cyrillic keyboard with live phonetic mapping
    โ”‚   โ””โ”€โ”€ ProgressModal.tsx   # Cross-language accuracy & spaced-repetition dashboard
    โ”œโ”€โ”€ data/
    โ”‚   โ”œโ”€โ”€ aboutTranslations.ts# App About & Contact translations
    โ”‚   โ”œโ”€โ”€ legalTranslations.ts# Localized Privacy Policy & Terms of Service
    โ”‚   โ””โ”€โ”€ languages/          # 15 course datasets, grammar flashcards & cultural guides
    โ”œโ”€โ”€ services/
    โ”‚   โ”œโ”€โ”€ offlineAudioService.ts # Binary .bin unpacker & Cache Storage manager
    โ”‚   โ”œโ”€โ”€ progressService.ts  # Local & Supabase cloud quiz progress sync
    โ”‚   โ””โ”€โ”€ supabaseClient.ts   # Supabase client setup
    โ””โ”€โ”€ utils/
        โ”œโ”€โ”€ fuzzyMatcher.ts     # Typo-tolerant quiz grading across scripts
        โ”œโ”€โ”€ phoneticTyping.ts   # Sound-out + Spacebar IME conversion for 8 scripts
        โ”œโ”€โ”€ speech.ts           # Audio playback queue & Web Speech API fallback
        โ””โ”€โ”€ translationResolver.ts # Matrix UI localization across 15x15 pairs

๐Ÿ’ป Local Development

Prerequisites

  • Node.js: v22.x or later (see engines in package.json)
  • npm: v10.x or later
  • Python: v3.10+ with edge-tts (optional, only for regenerating studio MP3 audio)

1. Clone & Install

git clone https://github.com/JohnBendfeldt/basic-language-school.git
cd basic-language-school
npm install

2. Environment Variables

Create a .env.local file in the project root (optional; Guest Mode works without environment variables):

VITE_SUPABASE_URL=https://<your-project-ref>.supabase.co
VITE_SUPABASE_ANON_KEY=<your-anon-key>

3. Run Development Server

npm run dev
# Vite dev server starts at http://localhost:5173

4. Run Automated Tests

# Unit & integration suite (58 suites, 1,565 tests)
npm test

# Strict TypeScript check
npx tsc --noEmit --noUnusedLocals --noUnusedParameters

# Playwright end-to-end suite (21 browser tests)
npx playwright test

5. Build for Production

npm run build
# Compiles TypeScript, builds Vite bundle to dist/, and packages offline-pack.bin archives
npm run preview
# Preview the production build locally

๐ŸŽ™๏ธ Studio Audio & Offline Binary Packs

To regenerate neural audio files (edge-tts) or rebuild the single-file offline binary packs (offline-pack.bin + manifest.json):

# Generate studio neural MP3s (all 15 languages)
pip3 install edge-tts
python3 scripts/generate-all-audio.py --all

# Rebuild single-file offline binary packs & manifests for all 15 languages
npm run build-offline-packs

๐ŸŒ Domain & Routing Strategy

Domain Role Action
basiclanguage.school Primary Application Production deployment on Netlify
basiclanguage.academy Secondary Domain 301 Permanent Redirect to basiclanguage.school
basiclanguage.courses Secondary Domain 301 Permanent Redirect to basiclanguage.school
basicrussian.org Standalone Legacy App Preserved independently with its own database

๐Ÿค Contributing & Security

  • Contributing: Translation fixes, native-speaker refinements, accessibility improvements, and bug fixes with tests are welcome โ€” please read CONTRIBUTING.md before opening a pull request.
  • Security: Please report suspected vulnerabilities privately rather than opening a public issue; see SECURITY.md for disclosure instructions.

๐Ÿ‘ค Author

John Bendfeldt


๐Ÿ“„ License

This project's source code is licensed under the MIT License - see the LICENSE file for details.

Branding Note: While the source code is open source under MIT, the Basic Language School name, domain branding (basiclanguage.school), and custom academic emblems are reserved for the official platform.

About

Multi-language learning PWA (basiclanguage.school) with 15 languages, 210 pairs, 14,500+ neural TTS clips, 8 phonetic keyboards, offline binary audio packs, and Supabase RLS sync.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages