How k2aitutor/frontend works
This monorepo provides web and mobile clients for an AI-assisted learning product, with student practice and exams alongside role-specific dashboards for teachers, parents, contributors, and administrators. A typical student path is to choose a subject or topic, work through practice, and review progress or exam results; billing, notifications, and content operations are additional capabilities. The shared package supplies API constants, hooks, and types. The README is empty, and many routes were not sampled, so links are limited to relationships visible in excerpts or the source index.
Main entry points: practice.ts Practice hooks · (dashboard) Role dashboards · apiClient.ts Mobile API client · [sessionId].tsx Mobile practice session
Components 23
Mobile app
- Mobile dashboard
apps/mobile/app/(tabs)/index.tsx - Mobile subscription
apps/mobile/app/subscription.tsx - Dashboard cards
apps/mobile/src/components/DashboardCards.tsx - Math rendering
apps/mobile/src/components/math/MathView.tsx - Mobile API client
apps/mobile/src/lib/apiClient.ts - Secure token storage
apps/mobile/src/lib/secureStore.ts - Request observability
apps/mobile/src/lib/observability.ts - In-app purchases
apps/mobile/src/lib/iap.ts
Web app
- Web API client
apps/web/src/lib/apiClient.ts
Shared client layer
- Practice hooks
packages/shared/src/hooks/practice.ts - Fetcher context
packages/shared/src/hooks/FetcherContext.ts - API route constants
packages/shared/src/constants/api.ts - Exam types
packages/shared/src/types/exam.ts - Practice types
packages/shared/src/types/practice.ts
Learning workflows
- Mobile practice session
apps/mobile/app/practice/session/[sessionId].tsx - Mobile exam review
apps/mobile/app/exam/[attemptId]/review.tsx - Web student practice
apps/web/src/app/(dashboard)/student/practice - Web exam session
apps/web/src/components/exam/ExamSessionClient.tsx
Role operations
- Role dashboards
apps/web/src/app/(dashboard) - Admin content and billing
apps/web/src/app/(dashboard)/admin - Contributor workflows
apps/web/src/app/(dashboard)/contributor - Parent and teacher views
apps/web/src/app/(dashboard)/parent
Other components
- Student
Connections 20
- Student → Mobile dashboard: opens
apps/mobile/app/(tabs)/index.tsx - Mobile dashboard → Dashboard cards: renders
apps/mobile/app/(tabs)/index.tsx - Student → Mobile practice session: practices
- Mobile practice session → Practice hooks: uses hooks
apps/mobile/app/practice/session/[sessionId].tsx - Mobile practice session → Math rendering: renders math
apps/mobile/app/practice/session/[sessionId].tsx - Mobile exam review → Mobile API client: loads review
apps/mobile/app/exam/[attemptId]/review.tsx - Mobile subscription → In-app purchases: uses purchases
apps/mobile/app/subscription.tsx - Mobile API client → Secure token storage: reads tokens
apps/mobile/src/lib/apiClient.ts - Mobile API client → Request observability: reports requests
apps/mobile/src/lib/apiClient.ts - Practice hooks → API route constants: uses routes
packages/shared/src/hooks/practice.ts - Practice hooks → Exam types: uses types
packages/shared/src/hooks/practice.ts - Practice hooks → Practice types: uses types
packages/shared/src/hooks/practice.ts - Fetcher context → Practice hooks: provides fetcher
packages/shared/src/hooks/practice.ts - Student → Web student practice: practices
- Student → Web exam session: takes exams
- Student → Role dashboards: uses dashboards
- Role dashboards → Admin content and billing: routes by role
- Role dashboards → Contributor workflows: routes by role
- Role dashboards → Parent and teacher views: routes by role
- Web student practice → Web API client: loads learning data