Stop memorizing flashcards. Start acquiring language.
Get Started Β· Features Β· Documentation Β· Contributing
Most language apps are glorified flashcard decks with gamification slapped on top. They optimize for daily streaks, not actual fluency. You finish 500 lessons and still freeze up in a real conversation.
Why? Because they treat language like triviaβisolated vocabulary, disconnected grammar drills, zero context. That's not how humans acquire language.
Interlinear is an AI tutoring laboratory built on how language acquisition actually works:
"Language is acquired through comprehensible input in context, not through memorization of rules." β Stephen Krashen
Instead of drilling you on word lists, Interlinear immerses you in real texts with intelligent supportβclick any word for instant definitions, hear native pronunciation, and get AI-powered feedback that understands the difference between a typo and a fundamental misunderstanding.
Not just "wrong, try again." Get detailed grammatical explanations organized by error type, with native audio pronunciation. The system distinguishes between lexical mistakes and syntactic confusionβlike a linguistics professor in your pocket.
Practice with AI personas who maintain narrative coherence across extended dialogues. No scripted decision treesβgenuine conversational flow that adapts to your level and responds to what you actually say.
The first computationally sophisticated approach to Latin instruction. Full morphological analysis, academic-grade content, and the same analytical depth available for modern languages. Finally, dead languages get the tech they deserve.
Comprehensive post-session analysis identifying recurring error patterns with targeted remediation strategies. Like office hours with a professor who never forgets your previous mistakes.
Dynamic difficulty from A1 to C2 based on demonstrated competencyβnot self-assessment. The system meets you where you are and grows with you.
Installable on any device with offline support. No app store gatekeeping, no forced updates, no platform-specific compromises. Just works.
| Traditional Apps | Interlinear | |
|---|---|---|
| Learning Model | Memorization drills | Contextual immersion |
| Error Feedback | β "Incorrect" | β Detailed grammar analysis |
| Conversation Practice | Scripted dialogues | AI with narrative memory |
| Classical Languages | Basic/None | Full morphological analysis |
| Difficulty Adjustment | Manual selection | Automatic CEFR calibration |
| Platform | App store lock-in | PWA (works everywhere) |
| Reader Interface | AI Tutor | Error Analysis |
|---|---|---|
| Click any word for instant definitions | Roleplay conversations with AI personas | Detailed grammatical breakdowns |
Screenshots coming soon
Interlinear is built on a modern, type-safe stack optimized for real-time AI interactions and cost-efficient scaling.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client (PWA) β
β Next.js 15 Β· React 19 Β· TypeScript Β· Tailwind β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Layer (Next.js) β
β Vercel AI SDK Β· Mastra Workflows Β· Server Components β
ββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Supabase β β OpenAI β β ElevenLabs β
β PostgreSQL β β Anthropic β β TTS β
β + Auth β β β β β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Google Cloud Run β
β Serverless Β· Auto-scaling 0-10 β
β OpenTofu/Terraform IaC β
βββββββββββββββββββββββββββββββββββββββ
| Layer | Technology | Why |
|---|---|---|
| Frontend | Next.js 15, React 19, TypeScript | App Router, RSC, type safety |
| Styling | Tailwind CSS | Utility-first, rapid iteration |
| Database | Supabase PostgreSQL | RLS, real-time, managed auth |
| AI/LLM | OpenAI, Anthropic via Vercel AI SDK | Structured output, streaming |
| Orchestration | Mastra | AI workflow management |
| Audio | ElevenLabs | Neural TTS, native quality |
| Infrastructure | Google Cloud Run, OpenTofu | Serverless, IaC |
| CI/CD | GitHub Actions | Automated builds & deploys |
- Node.js 20+
- npm or yarn
- Supabase account (free tier works)
- OpenAI API key
# Clone the repository
git clone https://github.com/Peleke/interlinear.git
cd interlinear
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local# .env.local
# Required
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
OPENAI_API_KEY=your-openai-key
# Optional
ANTHROPIC_API_KEY=your-anthropic-key # Alternative LLM
ELEVENLABS_API_KEY=your-elevenlabs-key # Text-to-speechRun the SQL migrations in your Supabase dashboard:
# Migrations are in supabase/schema.sql
# Apply via Supabase SQL Editor or CLInpm run devinterlinear/
βββ app/ # Next.js App Router
β βββ api/ # API routes (TTS, health, AI endpoints)
β βββ (auth)/ # Auth pages (login, signup)
β βββ reader/ # Main reading interface
β βββ tutor/ # AI tutoring sessions
β βββ profile/ # User dashboard & stats
βββ components/ # React components
β βββ ui/ # Shared UI primitives
β βββ reader/ # Reading interface
β βββ tutor/ # Tutoring components
βββ lib/ # Core business logic
β βββ mastra/ # AI workflow orchestration
β βββ content-generation/ # LLM content tools
β βββ supabase/ # DB clients (server/client)
β βββ services/ # External API integrations
βββ services/
β βββ latin-analyzer/ # Python FastAPI for Latin morphology
βββ tests/ # E2E (Playwright) & unit tests
βββ terraform/ # Infrastructure as Code
βββ supabase/ # DB schema & migrations
# Development
npm run dev # Start dev server (localhost:3000)
npm run build # Production build
npm run lint # ESLint
npm run type-check # TypeScript checking
# Testing
npm run test:e2e # Playwright E2E tests
npm run test:e2e:ui # E2E with UI mode
npm run test:e2e:headed # E2E in headed browser
# Latin Analyzer (Docker)
docker compose up -d latin-analyzer # Start Latin service
docker compose logs latin-analyzer # Check logsDynamic Rendering
All pages use forced dynamic rendering. Supabase requires runtime environment variables, making static generation impractical. Trade-off: deployment simplicity over static perf gains.
Audio Caching Economics
TTS audio cached in Supabase with user-scoped RLS. ElevenLabs charges per characterβcaching breaks even after ~10 repeated pronunciations, reducing API costs by ~80%.
Implicit Vocabulary Tracking
Every word click saves immediatelyβno confirmation dialogs. Removes friction, lets users focus on reading. Higher DB writes are trivial at current scale.
Row Level Security
All data is user-scoped via PostgreSQL RLS policies. Client-side Supabase key is safe to expose; RLS enforces complete isolation.
| Metric | Target | Current |
|---|---|---|
| Time to Interactive | < 2s | ~1.2s |
| Definition Lookup (cached) | < 100ms | ~80ms |
| Definition Lookup (cold) | < 500ms | ~300ms |
| TTS Generation | < 1s | ~800ms |
| Container Cold Start | < 3s | ~2s |
| Service | Monthly |
|---|---|
| Cloud Run | ~$15 |
| Supabase | Free |
| ElevenLabs | ~$5 |
| Total | ~$20 |
See DEPLOY.md for the full guide.
# Quick deploy
./scripts/deploy-infra.sh staging
./scripts/deploy-app.sh staging
# Rollback
./scripts/rollback.sh staging- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License β see LICENSE for details.
- Free Dictionary API β English lexical data
- ElevenLabs β Neural voice synthesis
- Supabase β Database & auth
- Vercel AI SDK β AI integration
Built with obsessive attention to how humans actually learn languages.