How thecompilerbro/ai_playground-kids-learning-platform works
AI Playground combines child-focused lessons, an interactive classifier lab, local progress/profile features, and parent-facing safety/settings with a session-based authentication service. The main learner flow is routed through learning pages and activities, with progress recorded locally; login and OTP requests travel through the auth client and backend routes to session and email delivery. Backend relationships follow the supplied excerpts and README; frontend branches not sampled are included where documented, with uncertain links omitted.
Main entry points: auth.service.ts OTP and account service · LabView.tsx AI classifier lab · email.service.ts Email provider selection · email-outbox.worker.ts Outbox delivery worker
Components 28
Learning experience
- Page routing
src/app/router.tsx - Lessons and dashboard
src/pages - Lesson activities
src/components/lesson - Bands and lessons
src/data - AI classifier lab
src/components/lab/LabView.tsx - Classifier demo
src/services/classifierDemo.ts - Lab samples
src/data/labData.ts
Progress and profiles
- Profile and parent settings
src/pages/ProfilePage.tsx - Progress state
src/hooks/useProgress.ts - Progress rules
src/services/progressService.ts - Local progress storage
src/services/storage.ts
Frontend authentication
- Login and signup
src/pages/LoginPage.tsx - Session context
src/context/AuthContext.tsx - Auth API client
src/services/authApi.ts
Authentication backend
- Auth routes and middleware
backend/src/routes/auth.routes.ts - Auth controller
backend/src/controllers/auth.controller.ts - OTP and account service
backend/src/services/auth.service.ts - User records
backend/src/models/user.model.ts - OTP challenges
backend/src/models/otp-challenge.model.ts - Idempotency records
backend/src/services/idempotency.service.ts - Cryptographic utilities
backend/src/utils/crypto.ts
Email delivery
- Encrypted email outbox
backend/src/models/email-outbox.model.ts - Outbox delivery worker
backend/src/workers/email-outbox.worker.ts - Email provider selection
backend/src/services/email.service.ts - Resend provider
backend/src/services/email-adapters/resend.adapter.ts - SMTP provider
backend/src/services/email-adapters/smtp.adapter.ts
Other components
- Learner / parent
- Email recipient
Connections 28
- Learner / parent → Page routing: opens pages
src/app/router.tsx - Page routing → Lessons and dashboard: routes to
src/app/router.tsx - Lessons and dashboard → Lesson activities: presents activities
- Lessons and dashboard → Bands and lessons: uses lesson content
src/pages/ProfilePage.tsx - Learner / parent → AI classifier lab: uses lab
- AI classifier lab → Classifier demo: runs classifier
src/components/lab/LabView.tsx - AI classifier lab → Lab samples: loads samples
src/components/lab/LabView.tsx - AI classifier lab → Progress state: records trials
src/components/lab/LabView.tsx - Profile and parent settings → Progress state: reads and updates
src/pages/ProfilePage.tsx - Progress state → Progress rules: delegates progress
src/hooks/useProgress.ts - Progress rules → Local progress storage: persists progress
src/services/progressService.ts - Learner / parent → Login and signup: signs in
- Login and signup → Session context: uses auth actions
src/pages/LoginPage.tsx - Session context → Auth API client: calls
src/context/AuthContext.tsx - Auth API client → Auth routes and middleware: sends auth requests
- Auth routes and middleware → Auth controller: routes requests
backend/src/routes/auth.routes.ts - Auth controller → OTP and account service: invokes auth actions
backend/src/controllers/auth.controller.ts - OTP and account service → User records: reads and writes
backend/src/services/auth.service.ts - OTP and account service → OTP challenges: creates and verifies
backend/src/services/auth.service.ts - Auth routes and middleware → Idempotency records: guards mutations
- OTP and account service → Cryptographic utilities: hashes and encrypts
backend/src/services/auth.service.ts - OTP and account service → Encrypted email outbox: stages email job
backend/src/services/auth.service.ts - Outbox delivery worker → Encrypted email outbox: polls and updates
backend/src/workers/email-outbox.worker.ts - Outbox delivery worker → Cryptographic utilities: decrypts payload
backend/src/workers/email-outbox.worker.ts - Outbox delivery worker → Email provider selection: dispatches email
backend/src/workers/email-outbox.worker.ts - Email provider selection → Resend provider: selects provider
backend/src/services/email.service.ts - Email provider selection → SMTP provider: selects provider
backend/src/services/email.service.ts - Email provider selection → Email recipient: sends message