How cygray/kr40 works
KR40 is a mobile-first Korean-learning PWA organized around a 40-day mission. Learners review an adaptive Four-Strands plan, practice through learning and coaching activities, record observable evidence, and consult derived progress and readiness. The browser and MCP both use authenticated server entry points; Firebase-backed repositories persist the audit record and derived read models. OAuth enables remote MCP access. The README documents these capabilities, but many implementations were not sampled, so links among those subsystems are limited to documented or sampled relationships.
Main entry points: learning Learning API · layout.tsx KR40 PWA · tools.ts MCP tool operations · repository.ts Learning repositories
Components 25
Learner experience
- KR40 PWA
app/layout.tsx - Learning views
app/learn/page.tsx - Daily plan view
app/today/page.tsx - Speaking practice
app/speak/page.tsx - Conference reference
app/conference/page.tsx - Progress view
app/progress/page.tsx - Sign-in UI
components/kr40-auth-provider.tsx
Application endpoints
- Learning API
app/api/learning - User bootstrap
app/api/bootstrap/route.ts - Learner export
app/api/export/route.ts - MCP endpoint
app/mcp/route.ts - OAuth endpoints
src/server/oauth
Learning domain
- Adaptive planning
src/domain/planner.ts - Mastery and readiness
src/domain/mastery.ts - History and checkpoints
src/domain/history.ts - Coaching modes
src/domain/coaching-modes.ts
Persistence
- Learning repositories
src/lib/firebase/repository.ts - Coaching repository
src/lib/firebase/coach-repository.ts - Firestore
External integrations
- MCP tool registry
src/mcp/server.ts - MCP tool operations
src/mcp/tools.ts - Firebase Auth
src/lib/firebase/auth.ts
Other components
- Learner
- Google sign-in
- MCP client
Connections 32
- Learner → KR40 PWA: uses
- KR40 PWA → Learning views: opens
- KR40 PWA → Daily plan view: opens
- KR40 PWA → Speaking practice: opens
- KR40 PWA → Conference reference: opens
- KR40 PWA → Progress view: opens
- Learner → Sign-in UI: signs in
- Google sign-in → Firebase Auth: authenticates
- Sign-in UI → Firebase Auth: uses
- Learning views → Learning API: requests learning data
- Daily plan view → Learning API: requests plan data
- Speaking practice → Learning API: records practice
- Conference reference → Learning API: requests context
- Progress view → Learning API: requests progress
- Learning API → Learning repositories: reads and writes
- Learning API → Coaching repository: records coaching
- Learning API → Adaptive planning: uses planning rules
- Learning API → Mastery and readiness: derives progress
- Learning API → History and checkpoints: uses history rules
- Learning API → Firestore: persists data
- User bootstrap → Firestore: seeds user data
- Learner export → Learning repositories: exports learner data
- MCP client → MCP endpoint: calls tools
- MCP endpoint → MCP tool registry: dispatches
- MCP tool registry → MCP tool operations: invokes
- MCP tool operations → Learning repositories: reads and writes
- MCP tool operations → Coaching repository: records coaching
- MCP tool operations → Adaptive planning: uses planning rules
- MCP tool operations → Mastery and readiness: derives progress
- MCP tool operations → Firestore: persists data
- MCP client → OAuth endpoints: authorizes
- OAuth endpoints → Firestore: stores OAuth state