An AI-powered reading companion that explains complex English terms in Philippine languages — not through literal translation, but through localized understanding.
Filipino students studying English-medium textbooks often encounter unfamiliar academic vocabulary. Traditional tools like Google Translate offer literal word-for-word translations that strip away meaning and context — "Photosynthesis" simply becomes "Fotosintesis", which helps no one.
Linaw solves this by providing context-aware, AI-generated explanations delivered in the student's own regional language — the way a friend would explain it.
- Highlight any word or phrase in a PDF and get a context-aware English definition generated by Gemini AI
- Definitions adapt based on surrounding text using n-gram context extraction
- Tagalog
- Cebuano
- Hiligaynon
- Bikolano
- Ilocano
- Pangasinense
- Waray
- Upload and read PDFs directly in the browser via
react-pdf - Scrollable, multi-page document viewer
- Select text directly on the PDF to trigger definitions
- Upload documents to Firebase Storage for persistent access
- Browse any website and highlight words to get instant definitions
- Side panel opens contextually without leaving the page
- Full feature parity with the notebook (definitions, translations, confused-with terms)
- Auto-generates flashcard quizzes from your lookup history
- Tracks scores and progress per notebook via Firestore
- Retake quizzes to reinforce learning
- Search for related images via Unsplash API for visual learning
- Fullscreen viewer with zoom and navigation
- Listen to definitions spoken aloud via the Web Speech API
- For every definition, Linaw returns the 3 most commonly confused words/phrases
- Click any confused term to immediately look it up
- Semantic word gate validates selections before sending to AI (prevents defining random characters)
- N-gram correction suggests better highlight boundaries (e.g., "osmosi" → "osmosis")
- Toggle English definitions, language context, confused-with terms
- Choose whether to confirm before defining
- Definitions are cached in Firestore's
global_dictionarycollection - Repeated lookups are instant — no API calls needed
┌─────────────────────────────────────────────────────────┐
│ Client │
│ │
│ ┌──────────────────┐ ┌──────────────────────┐ │
│ │ React Web App │ │ Chrome Extension │ │
│ │ (Vite + TW4) │ │ (Side Panel) │ │
│ └────────┬─────────┘ └──────────┬───────────┘ │
│ │ │ │
└────────────┼──────────────────────────┼─────────────────┘
│ │
▼ ▼
┌─────────────────────────────────────────────────────────┐
│ FastAPI Backend (Render) │
│ │
│ • /api/define — AI-powered definitions │
│ • /api/define-only — Phase 1: definition only │
│ • /api/translate-def — Phase 2: translation │
│ • /sources/upload — PDF upload to Firebase │
│ • /api/translate — Proxy to translator service │
└────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Linaw Translator (Modal — A10G GPU) │
│ │
│ • NLLB 1.3B (CTranslate2 INT8) for low-resource │
│ languages │
│ • Gemini provider for higher-resource languages │
│ • Automatic fallback routing │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Firebase │
│ │
│ • Auth — Google & Email sign-in │
│ • Firestore — User data, notebooks, quiz scores, │
│ global dictionary cache │
│ • Storage — Uploaded PDF documents │
└─────────────────────────────────────────────────────────┘
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite 7, Tailwind CSS 4, react-pdf, Lucide Icons |
| Backend API | Python, FastAPI, Pydantic, Uvicorn |
| AI/ML | Gemini 2.5 Flash (definitions), NLLB-200-distilled-1.3B (translation) |
| Translation Infra | Modal (serverless GPU - A10G), CTranslate2 (INT8 quantized inference) |
| Database & Auth | Firebase Auth, Cloud Firestore, Firebase Storage |
| Browser Extension | Chrome Manifest V3, Side Panel API |
| Image Search | Unsplash API |
| Deployment | Render (backend), Vercel/Netlify (frontend), Modal (translator) |
- Python 3.10+
- Node.js 18+
- A Google AI Studio API key (Gemini)
- A Firebase project with Auth, Firestore, and Storage enabled
git clone https://github.com/your-team/Linaw.git
cd Linaw# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Mac/Linux
# Install dependencies
pip install -r requirements.txt
# Start the backend
uvicorn main:app --reloadcd linaw-app
npm install
npm run devCreate linaw-app/.env:
VITE_APP_FIREBASE_API_KEY=your_firebase_api_key
VITE_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_APP_FIREBASE_PROJECT_ID=your_project_id
VITE_APP_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_APP_FIREBASE_APP_ID=your_app_id
VITE_APP_UNSPLASH_API_KEY=your_unsplash_key
VITE_APP_BACKEND_URL=http://localhost:8000Linaw/
├── main.py # FastAPI backend (definitions, upload, translation proxy)
├── firebase_config.py # Firebase Admin SDK initialization
├── requirements.txt # Python dependencies
├── linaw-app/ # React frontend + Chrome extension
│ ├── src/
│ │ ├── pages/ # Home, Notebook, Auth, Dashboard, Settings
│ │ ├── components/ # UI components (Explain, Reader, FlashcardQuiz, etc.)
│ │ ├── extension/ # Chrome extension side panel
│ │ ├── services/ # API clients, dictionary, n-gram, translation services
│ │ └── context/ # React contexts (Auth, Settings)
│ └── public/ # Static assets, extension manifest
├── linaw-translator/ # Modal-hosted translation microservice
│ ├── main.py # Modal app with NLLB + Gemini providers
│ └── providers/ # Translation provider factory (NLLB, Gemini)
└── README.md
Built with ❤️ for Filipino students everywhere.
Linaw - "Clarity" in Bisaya 🌊