How farismnazri/learnmalay works
Learn Malay is a chapter-based Malaysian Malay learning game. Players choose or create a profile, progress through lessons on a chapter map, and unlock minigames; scores and progress are recorded through server APIs. The repository also documents admin user management, analytics, highscores, and privacy retention. The graph follows documented flows and relationships visible in indexed source references; unsampled implementation details are represented conservatively, and some optional or indirect connections are omitted.
Main entry points: page.tsx Chapter map · sessionAuth.ts Session authentication · route.ts Highscore API · userStore.ts Client user store
Components 25
Player experience
- Title screen
app/page.tsx
Lessons & minigames
- Chapter map
app/map/page.tsx - Progress & unlock rules
src/lib/minigameUnlocks.ts - Chapter lesson renderer
app/chapter/[id]/page.tsx - Chapter content
src/lib/chapters/index.ts - Lesson activity cards
src/components/game/BoxDragCard.tsx - Minigame hub
app/minigames/page.tsx - Minigame play pages
app/minigames - Highscore tables
app/minigames/highscores/page.tsx
Profiles & progress
- Profile selection
app/user/page.tsx - Client user store
src/lib/userStore.ts - User API routes
app/api/users
Server services
- Session authentication
src/server/sessionAuth.ts - Session repository
src/server/sessionRepo.ts - User repository
src/server/userRepo.ts - Storage adapter
src/server/db.ts - Highscore API
app/api/highscores/route.ts - Highscore repository
src/server/highscoreRepo.ts - Activity API
app/api/activity/route.ts - Activity repository
src/server/activityRepo.ts
Administration
- Admin dashboard
app/admin/page.tsx - Admin user management
app/admin/users - Analytics API
app/api/admin/analytics/route.ts - Privacy retention
src/server/privacyRetention.ts
Other components
- Player
Connections 30
- Player → Title screen: opens
README.md - Title screen → Chapter map: routes to
README.md - Title screen → Profile selection: routes to
README.md - Player → Profile selection: selects profile
README.md - Profile selection → Client user store: uses
app/user/page.tsx - Client user store → User API routes: requests
src/lib/userStore.ts - Chapter map → Progress & unlock rules: checks unlocks
app/map/page.tsx - Chapter map → Client user store: reads profile
app/map/page.tsx - Chapter map → Chapter lesson renderer: opens chapter
README.md - Chapter lesson renderer → Chapter content: loads lessons
app/chapter/[id]/page.tsx - Chapter lesson renderer → Lesson activity cards: renders activities
app/chapter/[id]/page.tsx - Minigame hub → Progress & unlock rules: checks unlocks
app/minigames/page.tsx - Minigame hub → Minigame play pages: opens games
README.md - Minigame play pages → Client user store: reads profile
app/minigames/misi-membeli/play/page.tsx - Minigame play pages → Highscore API: submits scores
- Highscore tables → Highscore API: loads scores
- User API routes → Session authentication: authenticates
app/api/users/current/route.ts - Session authentication → Session repository: reads and writes sessions
src/server/sessionAuth.ts - Session authentication → User repository: loads user
src/server/sessionAuth.ts - User repository → Storage adapter: reads and writes users
src/server/userRepo.ts - Highscore API → Highscore repository: handles scores
app/api/highscores/route.ts - Highscore API → Session authentication: checks session
app/api/highscores/route.ts - Highscore repository → Storage adapter: stores scores
- Activity API → Activity repository: records events
app/api/activity/route.ts - Activity repository → Storage adapter: stores activity
src/server/activityRepo.ts - Admin dashboard → Analytics API: loads analytics
- Admin dashboard → Admin user management: manages users
README.md - Admin user management → User API routes: uses user routes
- Analytics API → User repository: reads user data
- Privacy retention → Storage adapter: prunes retained data