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 π
