# symus/mlearning architecture

> Architecture diagram of the GitHub repository symus/mlearning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/symus/mlearning
- Repository: https://github.com/symus/mlearning

## Overview

Arivupulla is an adaptive learning app for children aged 3–12, with parent and teacher areas and an editorial review flow. The child journey moves from sign-in and profile selection through age-appropriate recommendations and activities to recorded progress; parents and teachers review learning separately. Groups capture the main user-facing domains and the learning, identity, and persistence layers behind them. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled implementations and their internal wiring are not inferred.

Main entry points: [`src/app/play/(child)/page.tsx`](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/play/(child)/page.tsx) (Child universe), [`src/lib/db.ts`](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/db.ts) (Application database), [`src/lib/learning/queries.ts`](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/learning/queries.ts) (Learning records), [`src/app/parent/page.tsx`](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/parent/page.tsx) (Parent dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and accounts"]
  node_landing["Welcome and plans<br/>[page.tsx]"]
  node_auth["Sign-in and signup<br/>[page.tsx]"]
  node_session["Sessions and roles<br/>[session.ts]"]
  node_accessdal["Protected access<br/>[dal.ts]"]
end

subgraph group_learning["Child learning"]
  node_childhome["Child universe<br/>[page.tsx]"]
  node_journey["Learning journeys<br/>[journey.ts]"]
  node_activity["Activity player<br/>[player.tsx]"]
  node_playactions["Activity actions<br/>[play.ts]"]
  node_learningdata["Learning records<br/>[queries.ts]"]
  node_worlds["World catalog<br/>[worlds.ts]"]
end

subgraph group_family["Family insights"]
  node_parenthome["Parent dashboard<br/>[page.tsx]"]
  node_childprogress["Child progress<br/>[page.tsx]"]
  node_report["Weekly reports<br/>[report.ts]"]
  node_childcontrols["Child controls<br/>[child-controls.tsx]"]
end

subgraph group_school["Teacher workspace"]
  node_teacherhome["Teacher dashboard<br/>[page.tsx]"]
  node_classroom["Class workspace<br/>[page.tsx]"]
  node_classdata["Class data<br/>[class-data.ts]"]
end

subgraph group_platform["Learning platform"]
  node_admin["Content review<br/>[page.tsx]"]
  node_content["Activity contract<br/>[schema.ts]"]
  node_db[("Application database<br/>[db.ts]")]
end

node_child(("Child learner"))
node_adult(("Parent or teacher"))

node_adult -->|"opens app"| node_landing
node_landing -->|"routes signup"| node_auth
node_adult -.->|"signs in"| node_auth
node_auth -.->|"creates session"| node_session
node_session -->|"stores session"| node_db
node_accessdal -->|"reads token"| node_session
node_accessdal -->|"loads identity"| node_db
node_child -.->|"explores"| node_childhome
node_childhome -->|"requires child"| node_accessdal
node_childhome -->|"loads journeys"| node_journey
node_childhome -->|"loads paths"| node_learningdata
node_childhome -->|"loads assignments"| node_classdata
node_childhome -->|"shows worlds"| node_worlds
node_activity -->|"checks activity"| node_content
node_activity -->|"submits play"| node_playactions
node_playactions -.->|"records attempts"| node_learningdata
node_learningdata -->|"queries progress"| node_db
node_adult -.->|"reviews family"| node_parenthome
node_parenthome -->|"requires parent"| node_accessdal
node_parenthome -->|"loads reports"| node_learningdata
node_parenthome -->|"loads children"| node_db
node_parenthome -->|"opens progress"| node_childprogress
node_childprogress -->|"loads learning"| node_learningdata
node_childprogress -.->|"shows report"| node_report
node_childcontrols -.->|"updates controls"| node_db
node_adult -.->|"opens class area"| node_teacherhome
node_teacherhome -->|"requires teacher"| node_accessdal
node_teacherhome -.->|"opens class"| node_classroom
node_classroom -->|"loads class data"| node_classdata
node_classdata -->|"reads class records"| node_db
node_classroom -.->|"checks learning"| node_learningdata
node_adult -.->|"reviews content"| node_admin
node_admin -->|"loads review queue"| node_db
node_admin -.->|"reviews activities"| node_content

click node_landing "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/page.tsx"
click node_auth "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/(auth)/login/page.tsx"
click node_session "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/auth/session.ts"
click node_accessdal "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/auth/dal.ts"
click node_childhome "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/play/(child)/page.tsx"
click node_journey "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/learning/journey.ts"
click node_activity "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/components/child/player.tsx"
click node_playactions "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/actions/play.ts"
click node_learningdata "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/learning/queries.ts"
click node_worlds "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/worlds.ts"
click node_parenthome "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/parent/page.tsx"
click node_childprogress "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/parent/children/%5Bid%5D/page.tsx"
click node_report "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/learning/report.ts"
click node_childcontrols "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/components/parent/child-controls.tsx"
click node_teacherhome "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/teacher/page.tsx"
click node_classroom "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/teacher/classes/%5Bid%5D/page.tsx"
click node_classdata "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/teacher/class-data.ts"
click node_admin "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/admin/page.tsx"
click node_content "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/content/schema.ts"
click node_db "https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/db.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_landing,node_auth,node_session,node_accessdal toneBlue
class node_childhome,node_journey,node_activity,node_playactions,node_learningdata,node_worlds toneAmber
class node_parenthome,node_childprogress,node_report,node_childcontrols toneMint
class node_teacherhome,node_classroom,node_classdata toneRose
class node_admin,node_content,node_db,node_child,node_adult toneIndigo
```

## Components

### Access and accounts

- [Welcome and plans](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/page.tsx): `src/app/page.tsx`
- [Sign-in and signup](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/(auth)/login/page.tsx): `src/app/(auth)/login/page.tsx`
- [Sessions and roles](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/auth/session.ts): `src/lib/auth/session.ts`
- [Protected access](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/auth/dal.ts): `src/lib/auth/dal.ts`

### Child learning

- [Child universe](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/play/(child)/page.tsx): `src/app/play/(child)/page.tsx`
- [Learning journeys](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/learning/journey.ts): `src/lib/learning/journey.ts`
- [Activity player](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/components/child/player.tsx): `src/components/child/player.tsx`
- [Activity actions](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/actions/play.ts): `src/app/actions/play.ts`
- [Learning records](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/learning/queries.ts): `src/lib/learning/queries.ts`
- [World catalog](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/worlds.ts): `src/lib/worlds.ts`

### Family insights

- [Parent dashboard](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/parent/page.tsx): `src/app/parent/page.tsx`
- [Child progress](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/parent/children/%5Bid%5D/page.tsx): `src/app/parent/children/[id]/page.tsx`
- [Weekly reports](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/learning/report.ts): `src/lib/learning/report.ts`
- [Child controls](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/components/parent/child-controls.tsx): `src/components/parent/child-controls.tsx`

### Teacher workspace

- [Teacher dashboard](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/teacher/page.tsx): `src/app/teacher/page.tsx`
- [Class workspace](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/teacher/classes/%5Bid%5D/page.tsx): `src/app/teacher/classes/[id]/page.tsx`
- [Class data](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/teacher/class-data.ts): `src/lib/teacher/class-data.ts`

### Learning platform

- [Content review](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Activity contract](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/content/schema.ts): `src/lib/content/schema.ts`
- [Application database](https://github.com/symus/mlearning/blob/ccr-36c59038-mxcfxv/src/lib/db.ts): `src/lib/db.ts`

### Other components

- **Child learner**
- **Parent or teacher**

## Connections

- Parent or teacher → Welcome and plans: opens app (evidence: `src/app/page.tsx`)
- Welcome and plans → Sign-in and signup: routes signup (evidence: `src/app/page.tsx`)
- Parent or teacher → Sign-in and signup: signs in (evidence: `README.md`)
- Sign-in and signup → Sessions and roles: creates session
- Sessions and roles → Application database: stores session (evidence: `src/lib/auth/session.ts`)
- Protected access → Sessions and roles: reads token (evidence: `src/lib/auth/dal.ts`)
- Protected access → Application database: loads identity (evidence: `src/lib/auth/dal.ts`)
- Child learner → Child universe: explores (evidence: `README.md`)
- Child universe → Protected access: requires child (evidence: `src/app/play/(child)/page.tsx`)
- Child universe → Learning journeys: loads journeys (evidence: `src/app/play/(child)/page.tsx`)
- Child universe → Learning records: loads paths (evidence: `src/app/play/(child)/page.tsx`)
- Child universe → Class data: loads assignments (evidence: `src/app/play/(child)/page.tsx`)
- Child universe → World catalog: shows worlds (evidence: `src/app/play/(child)/page.tsx`)
- Activity player → Activity contract: checks activity (evidence: `src/components/child/player.tsx`)
- Activity player → Activity actions: submits play (evidence: `src/components/child/player.tsx`)
- Activity actions → Learning records: records attempts
- Learning records → Application database: queries progress (evidence: `src/lib/learning/queries.ts`)
- Parent or teacher → Parent dashboard: reviews family (evidence: `README.md`)
- Parent dashboard → Protected access: requires parent (evidence: `src/app/parent/page.tsx`)
- Parent dashboard → Learning records: loads reports (evidence: `src/app/parent/page.tsx`)
- Parent dashboard → Application database: loads children (evidence: `src/app/parent/page.tsx`)
- Parent dashboard → Child progress: opens progress (evidence: `src/app/parent/page.tsx`)
- Child progress → Learning records: loads learning (evidence: `src/app/parent/children/[id]/page.tsx`)
- Child progress → Weekly reports: shows report
- Child controls → Application database: updates controls
- Parent or teacher → Teacher dashboard: opens class area (evidence: `README.md`)
- Teacher dashboard → Protected access: requires teacher (evidence: `src/app/teacher/page.tsx`)
- Teacher dashboard → Class workspace: opens class (evidence: `README.md`)
- Class workspace → Class data: loads class data (evidence: `src/app/teacher/classes/[id]/page.tsx`)
- Class data → Application database: reads class records (evidence: `src/lib/teacher/class-data.ts`)
- Class workspace → Learning records: checks learning
- Parent or teacher → Content review: reviews content (evidence: `README.md`)
- Content review → Application database: loads review queue (evidence: `src/app/admin/page.tsx`)
- Content review → Activity contract: reviews activities (evidence: `README.md`)
