How johnhuangyijun2002-cloud/english-reading-tutor works
Contextia is an article-based language-learning application: users import reading material, annotate words or passages with AI, save notes, and revisit them through review and study tools. The web UI and Capacitor apps use the FastAPI backend, which provides account-scoped data and integrations. README documents additional capabilities not visible in the sampled source; those are shown at the subsystem level, with uncertain internal wiring omitted.
Main entry points: app.js Reader UI · main.py FastAPI service · Code.gs Sheets sync · AppDelegate.swift Capacitor app
Components 22
Reading
- Reader UI
frontend/app.js - Article import
backend/main.py - Reading view
frontend/app.js - News discovery
backend/main.py - Immersion mode
frontend/app.js
Learning
- Word and sentence notes
frontend/app.js - AI explanations
backend/main.py - Notebook and history
frontend/app.js - Spaced review
frontend/app.js - Learning statistics
frontend/app.js
Accounts and services
- FastAPI service
backend/main.py - Accounts and auth
backend/main.py - Postgres
- AI providers
- Sheets sync
apps_script/Code.gs - Notion integration
backend/main.py
Mobile app
- Capacitor app
mobile/ios/App/App/AppDelegate.swift - Apple purchases
frontend/app.js
Other components
- Learner
- Article and news sites
- Google Sheet
- Apple App Store
Connections 31
- Learner → Reader UI: uses
- Reader UI → FastAPI service: calls API
- Reader UI → Article import: submits content
- Article import → Article and news sites: fetches URL content
- Article import → FastAPI service: uploads documents
- FastAPI service → Postgres: reads and writes
- FastAPI service → AI explanations: dispatches AI tasks
- AI explanations → AI providers: requests explanations
- Reader UI → Word and sentence notes: selects text
- Word and sentence notes → FastAPI service: saves notes
- Reader UI → Notebook and history: opens notes
- Notebook and history → FastAPI service: loads and edits
- Reader UI → Spaced review: reviews vocabulary
- Spaced review → FastAPI service: updates review state
- Reader UI → Learning statistics: views study stats
- Learning statistics → FastAPI service: requests statistics
- Reader UI → News discovery: requests recommendations
- News discovery → Article and news sites: fetches headlines
- News discovery → AI providers: ranks recommendations
- Reader UI → Immersion mode: configures reading
- Immersion mode → AI explanations: requests substitutions
- FastAPI service → Accounts and auth: authenticates
- Accounts and auth → Postgres: reads and writes accounts
- FastAPI service → Sheets sync: posts note updates
- Sheets sync → Google Sheet: writes rows
- FastAPI service → Notion integration: handles connection flow
- Learner → Capacitor app: uses
- Capacitor app → Reader UI: hosts reader
- Reader UI → FastAPI service: calls configured backend
- Reader UI → Apple purchases: starts subscription flow
- Apple purchases → Apple App Store: purchases subscription