Skip to content

YeboLearn - Product Requirements Document

Version: 2.0 Last Updated: 2026-03-19 Status: Production Ready Author: YeboLearn Team


Table of Contents

  1. Vision & Problem Statement
  2. Solution Overview
  3. Product Architecture
  4. Core Features by User Type
  5. Data Models
  6. API Reference
  7. Yebo Kids PWA
  8. Dashboard Breakdown
  9. Authentication & Authorization
  10. Billing & Pricing
  11. Technical Stack
  12. Gaps & Missing Features

1. Vision & Problem Statement

1.1 The Problem

African schools face unique challenges that existing EdTech solutions don't address:

  • Fragmented Systems: Schools use multiple disconnected tools for attendance, grades, fees, and communication
  • Limited Technology Access: Many schools lack technical infrastructure and internet reliability
  • Curriculum Diversity: Each African country has its own curriculum (CAPS, CBC, SGCSE, GCE, etc.)
  • Language Barriers: Students need support in local languages alongside English
  • Home Learning Gap: Parents lack tools to support their children's education at home
  • Early Childhood Neglect: ECD centers have no purpose-built management tools
  • Payment Challenges: Schools need mobile money integration (MTN MoMo, etc.) alongside traditional payments

1.2 Our Vision

YeboLearn is a comprehensive African education platform that unifies:

  1. School Management - Complete SIS for schools of all levels (ECD → University)
  2. Home Learning - B2C app for parents to support their children's education
  3. Yebo Kids - Engaging PWA for early childhood learning (ages 2-8)
  4. AI Tutoring - Avatar-based AI teachers aligned with African curricula

1.3 Target Markets

CountryPrimary CurriculumCurrencyStatus
South AfricaCAPS, IEBZARActive
EswatiniSGCSE, IGCSE, CambridgeSZLActive
KenyaCBC, 8-4-4KESActive
CameroonGCE, BaccalauréatXAFActive
BotswanaBGCSEBWPActive

2. Solution Overview

2.1 Platform Components

┌─────────────────────────────────────────────────────────────────────────────┐
│                           YEBOLEARN ECOSYSTEM                               │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐             │
│  │   SCHOOL MGMT   │  │   HOME LEARNING │  │   YEBO KIDS     │             │
│  │                 │  │                 │  │                 │             │
│  │ • Admin Dashboard│ │ • Parent Portal │  │ • Watch Videos  │             │
│  │ • Teacher Portal │ │ • Child Profiles│  │ • Play Games    │             │
│  │ • Student Portal │ │ • Milestones    │  │ • Sing Songs    │             │
│  │ • Parent Portal  │ │ • Progress      │  │ • Read Stories  │             │
│  └────────┬────────┘  └────────┬────────┘  └────────┬────────┘             │
│           │                    │                    │                       │
│           └────────────────────┼────────────────────┘                       │
│                                │                                            │
│                    ┌───────────▼───────────┐                               │
│                    │   YEBOLEARN BACKEND   │                               │
│                    │                       │                               │
│                    │ • Multi-tenant API    │                               │
│                    │ • PostgreSQL DB       │                               │
│                    │ • AI Avatar Teacher   │                               │
│                    │ • Gamification Engine │                               │
│                    │ • Payment Processing  │                               │
│                    └───────────────────────┘                               │
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │                     PLATFORM ADMIN (SUPERADMIN)                      │   │
│  │  School provisioning • Subscription management • Platform analytics  │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

2.2 School Types Supported

TypeAgesGrade StructureSpecial Features
ECD Only0-6Infant → PreschoolMilestone tracking, developmental domains, character-based learning
Primary Only6-13Grade 1-7Gamified learning, flashcards, AI tutoring
Secondary Only13-18Form 1-6Exam prep, transcripts, career guidance
Tertiary18+UniversityCourse management, research tools
Multi-LevelMixedAll levelsCombined features across levels

2.3 Educational Stages

typescript
type EducationalStage = 
  | 'infant'           // 0-1 years
  | 'toddler'          // 1-3 years
  | 'preschool'        // 3-5 years
  | 'primary_lower'    // 5-8 years (Grade 1-3)
  | 'primary_upper'    // 8-13 years (Grade 4-7)
  | 'secondary_junior' // 13-15 years (Form 1-3)
  | 'secondary_senior' // 15-18 years (Form 4-6)
  | 'tertiary';        // 18+ years

2.4 Yebo Friends Characters

Five mascot characters that guide learning across the platform:

CharacterAnimalPersonalityPrimary Use
Nala🐘 ElephantWise, nurturingECD & early primary
Tembo🦁 LionBrave, encouragingAcademic challenges
Zuzu🦒 GiraffeCurious, playfulExploration & discovery
Kiki🐦 BirdMusical, creativeSongs & arts
Simba🦛 HippoCalm, storytellingReading & stories

3. Product Architecture

3.1 Repository Structure

RepositoryTechnologyDescription
yebolearn-backendNode.js/Express/TypeScriptCore API, PostgreSQL, multi-tenant
yebolearn-schooladmin-dashboardReact/Vite/TypeScriptSchool administrator portal
yebolearn-teacher-dashboardReact/Vite/TypeScriptTeacher portal
yebolearn-student-dashboardReact/Vite/TypeScriptStudent portal with gamification
yebolearn-parent-dashboardReact/Vite/TypeScriptParent portal (B2B + B2C)
yebolearn-superadmin-dashboardReact/Vite/TypeScriptPlatform admin portal
yebolearn-hubReact/Vite/TypeScriptUnified hub/launcher
yebo-kidsReact/Vite/TypeScriptChildren's PWA (ages 2-8)
yebolearn-landingNext.js/ReactMarketing website
yebolearn-documentationVitePressUser documentation

3.2 Backend Architecture

yebolearn-backend/
├── src/
│   ├── config/          # Database, env config
│   ├── controllers/     # Route handlers
│   │   └── platform/    # Platform admin controllers
│   ├── middleware/      # Auth, validation, rate limiting
│   ├── routes/          # API routes
│   │   ├── platform/    # Platform admin routes
│   │   └── public/      # Public (no-auth) routes
│   ├── services/        # Business logic
│   ├── types/           # TypeScript interfaces
│   ├── utils/           # Helpers, errors, logger
│   └── validators/      # Zod schemas
├── migrations/          # SQL migrations
└── database/            # Seed scripts

3.3 Multi-Tenancy Model

  • School-scoped data: All school data isolated by school_id
  • Platform users: Separate platform_users table for YeboLearn team
  • JWT tokens: Include schoolId claim for automatic tenant scoping
  • Middleware: multiTenant.middleware.ts enforces school boundaries

3.4 Infrastructure

Cloud Run (GCP)
├── yebolearn-api (Node.js backend)
│   ├── Cloud SQL (PostgreSQL)
│   ├── Cloud Storage (media uploads)
│   └── Secret Manager (credentials)

Cloudflare Pages
├── yebolearn-landing
├── yebolearn-hub
├── yebolearn-*-dashboard (all frontend apps)
└── yebo-kids

4. Core Features by User Type

4.1 Student Features

FeatureDescriptionTier Required
DashboardXP, level, streak, class rank, today's scheduleFree
GradesView grades, averages, transcriptsFree
AttendanceView attendance history and statisticsFree
FeesView fee balance, payment historyFree
ScheduleDaily/weekly class timetableFree
NotificationsSchool announcements, grade alertsFree
FlashcardsStudy assigned flashcard decksBasic+
AI TutorAsk questions, get curriculum-aligned helpPremium+
BadgesEarn achievements for academic milestonesFree
GamificationXP, levels, daily challenges, streaksFree

4.2 Teacher Features

FeatureDescriptionTier Required
Class ManagementView/manage assigned classesFree
Attendance MarkingMark daily attendance (single/bulk)Free
Grade EntryEnter grades (single/bulk)Basic+
Student ProfilesView student details, guardiansFree
Flashcard DecksCreate/manage flashcard decksBasic+
Assign FlashcardsAssign decks to classesBasic+
Flashcard AnalyticsView class study statisticsPremium+
ReportsGenerate attendance/grade reportsPremium+
MessagesSend messages to parentsFree
ScheduleView teaching scheduleFree

4.3 Parent/Guardian Features

FeatureDescriptionTier Required
Child ProfilesView all children (school + home-only)Free
School ProgressGrades, attendance, fees for enrolled childrenFree
Fee PaymentsPay fees via Stripe/MTN MoMoFree
MessagesCommunicate with teachersFree
Home LearningManage home-only children (B2C)Premium
MilestonesTrack developmental milestonesPremium
Activity TrackingView Yebo Kids app usagePremium
Dashboard ConfigChoose active child, preferencesFree

4.4 School Admin Features

FeatureDescriptionTier Required
Student ManagementAdd/edit/delete studentsFree
Staff ManagementAdd/edit/delete teachers, finance usersFree
Class ManagementCreate classes, assign teachers/studentsFree
Fee ManagementCreate fees, assign to students/classesFree
Payment TrackingView all payments, reconciliationFree
Attendance ReportsSchool-wide attendance analyticsBasic+
Grade ReportsSchool-wide academic performanceBasic+
Custom ReportsBuild custom reportsPremium+
Scheduled ReportsAuto-generate recurring reportsEnterprise
SettingsSchool profile, academic year, termsFree
Analytics DashboardSchool overview, trendsBasic+

4.5 Super Admin (Platform) Features

FeatureDescription
School ManagementCreate/edit/deactivate schools
Subscription ManagementChange school subscription tiers
Platform User ManagementCreate platform admin/manager users
Platform AnalyticsCross-school analytics, usage metrics
Audit LogsView platform-wide audit trail
School OnboardingProcess new school applications

5. Data Models

5.1 Core Entities

Schools

sql
CREATE TABLE schools (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    name VARCHAR(255) NOT NULL,
    code VARCHAR(50) UNIQUE NOT NULL,          -- e.g., GREENWOOD-PRI
    address TEXT,
    contact VARCHAR(50),
    email VARCHAR(255),
    subscription_tier subscription_tier DEFAULT 'free',
    is_active BOOLEAN DEFAULT true,
    
    -- Localization
    country_code VARCHAR(2) NOT NULL,          -- ISO 3166-1 alpha-2
    currency_code VARCHAR(3) NOT NULL,         -- ISO 4217
    selected_curriculum VARCHAR(50),           -- CAPS, CBC, SGCSE, etc.
    locale VARCHAR(10) DEFAULT 'en',
    timezone VARCHAR(50) DEFAULT 'UTC',
    
    -- School type
    school_type school_type NOT NULL,          -- ecd_only, primary_only, secondary_only, tertiary, multi_level
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Users

sql
CREATE TABLE users (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    email VARCHAR(255) NOT NULL,
    password_hash VARCHAR(255) NOT NULL,
    
    -- Profile
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    phone VARCHAR(50),
    
    -- Role & Status
    role user_role NOT NULL,                   -- super_admin, school_admin, principal, teacher, parent, student, finance
    is_active BOOLEAN DEFAULT true,
    
    -- Security
    last_login TIMESTAMP,
    token_version INTEGER DEFAULT 0,
    password_changed_at TIMESTAMP,
    failed_login_attempts INTEGER DEFAULT 0,
    account_locked_until TIMESTAMP,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(school_id, email)
);

Students

sql
CREATE TABLE students (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    
    -- Identity
    admission_number VARCHAR(50) NOT NULL,
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    date_of_birth DATE NOT NULL,
    gender gender_type,
    
    -- Academic
    class_id UUID REFERENCES classes(id),
    enrollment_date DATE NOT NULL,
    is_active BOOLEAN DEFAULT true,
    
    -- Educational stage (auto-calculated from DOB)
    educational_stage educational_stage,
    
    -- Gamification link
    user_id UUID REFERENCES users(id),         -- For student login
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(school_id, admission_number)
);

Teachers

sql
CREATE TABLE teachers (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    
    employee_number VARCHAR(50) NOT NULL,
    department VARCHAR(100),
    specializations TEXT[],                    -- Array of subjects
    qualification VARCHAR(255),
    hire_date DATE,
    is_active BOOLEAN DEFAULT true,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(school_id, employee_number)
);

Classes

sql
CREATE TABLE classes (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    
    name VARCHAR(100) NOT NULL,                -- e.g., "Grade 5A"
    grade_level VARCHAR(50) NOT NULL,          -- e.g., "Grade 5"
    section VARCHAR(10),                       -- e.g., "A"
    academic_year VARCHAR(20) NOT NULL,
    
    teacher_id UUID REFERENCES teachers(id),   -- Class teacher
    capacity INTEGER DEFAULT 30,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(school_id, name, academic_year)
);

Guardians

sql
CREATE TABLE guardians (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    user_id UUID REFERENCES users(id) ON DELETE SET NULL,
    
    -- Contact info (can exist without user account)
    email VARCHAR(255),
    first_name VARCHAR(100),
    last_name VARCHAR(100),
    phone VARCHAR(50),
    
    relationship_type relationship_type NOT NULL,  -- father, mother, guardian, grandparent, sibling, other
    is_primary BOOLEAN DEFAULT false,
    emergency_contact BOOLEAN DEFAULT false,
    is_active BOOLEAN DEFAULT true,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
sql
CREATE TABLE student_guardians (
    student_id UUID NOT NULL REFERENCES students(id) ON DELETE CASCADE,
    guardian_id UUID NOT NULL REFERENCES guardians(id) ON DELETE CASCADE,
    is_primary BOOLEAN DEFAULT false,
    relationship relationship_type,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    PRIMARY KEY (student_id, guardian_id)
);

5.2 Academic Entities

Subjects

sql
CREATE TABLE subjects (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    
    name VARCHAR(100) NOT NULL,
    code VARCHAR(20) NOT NULL,
    description TEXT,
    grade_level VARCHAR(50),
    curriculum_framework VARCHAR(50),          -- CAPS, CBC, etc.
    
    is_active BOOLEAN DEFAULT true,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(school_id, code)
);

Attendance

sql
CREATE TABLE attendance (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    student_id UUID NOT NULL REFERENCES students(id) ON DELETE CASCADE,
    class_id UUID REFERENCES classes(id),
    
    date DATE NOT NULL,
    status attendance_status NOT NULL,         -- present, absent, late, excused
    notes TEXT,
    
    marked_by UUID REFERENCES users(id),
    marked_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(student_id, date)
);

Grades

sql
CREATE TABLE grades (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    student_id UUID NOT NULL REFERENCES students(id) ON DELETE CASCADE,
    subject_id UUID NOT NULL REFERENCES subjects(id),
    class_id UUID REFERENCES classes(id),
    
    -- Score
    score DECIMAL(5,2) NOT NULL,
    max_score DECIMAL(5,2) NOT NULL DEFAULT 100,
    grade_letter VARCHAR(5),                   -- Auto-calculated: A, B, C, etc.
    
    -- Assessment info
    assessment_type assessment_type NOT NULL,  -- quiz, test, midterm, final, assignment, project
    assessment_name VARCHAR(255),
    exam_date DATE,
    
    -- Academic period
    term VARCHAR(50),
    academic_year VARCHAR(20),
    
    graded_by UUID REFERENCES users(id),
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.3 Financial Entities

Fees

sql
CREATE TABLE fees (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    
    name VARCHAR(255) NOT NULL,
    description TEXT,
    fee_type VARCHAR(50),                      -- tuition, transport, uniform, etc.
    amount DECIMAL(10,2) NOT NULL,
    due_date DATE NOT NULL,
    
    academic_year VARCHAR(20),
    term VARCHAR(50),
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Student Fees (Assignment)

sql
CREATE TABLE student_fees (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    student_id UUID NOT NULL REFERENCES students(id) ON DELETE CASCADE,
    fee_id UUID NOT NULL REFERENCES fees(id) ON DELETE CASCADE,
    
    amount DECIMAL(10,2) NOT NULL,             -- Can differ from fee.amount (discounts)
    amount_paid DECIMAL(10,2) DEFAULT 0,
    status fee_status DEFAULT 'pending',       -- pending, partially_paid, paid, overdue, waived
    due_date DATE NOT NULL,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(student_id, fee_id)
);

Payments

sql
CREATE TABLE payments (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    student_id UUID NOT NULL REFERENCES students(id) ON DELETE CASCADE,
    fee_id UUID REFERENCES fees(id),
    student_fee_id UUID REFERENCES student_fees(id),
    
    amount DECIMAL(10,2) NOT NULL,
    payment_method payment_method NOT NULL,    -- cash, bank_transfer, mobile_money, card, cheque
    payment_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    -- Transaction tracking
    transaction_id VARCHAR(255),
    external_reference VARCHAR(255),           -- Stripe/MoMo reference
    status payment_status DEFAULT 'pending',   -- pending, processing, completed, failed, refunded
    
    -- MTN MoMo specific
    phone_number VARCHAR(50),
    
    -- Metadata
    notes TEXT,
    processed_by UUID REFERENCES users(id),
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.4 Gamification Entities

Gamification Profiles

sql
CREATE TABLE gamification_profiles (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID REFERENCES schools(id) ON DELETE CASCADE,
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    
    -- Currency
    total_coins INTEGER DEFAULT 0,
    lifetime_coins INTEGER DEFAULT 0,
    
    -- Experience
    current_xp INTEGER DEFAULT 0,
    level INTEGER DEFAULT 1,
    
    -- Streaks
    current_streak INTEGER DEFAULT 0,
    longest_streak INTEGER DEFAULT 0,
    last_activity_date DATE,
    
    -- Avatar
    avatar_url TEXT,
    avatar_items TEXT[],                       -- Purchased items
    preferred_character yebo_character,        -- nala, tembo, zuzu, kiki, simba
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(user_id)
);

Achievements

sql
CREATE TABLE achievements (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    code VARCHAR(50) UNIQUE NOT NULL,
    name VARCHAR(100) NOT NULL,
    description TEXT,
    category VARCHAR(50),                      -- academic, attendance, social, streak
    
    icon_url TEXT,
    character yebo_character,                  -- Associated character
    
    -- Rewards
    coins_reward INTEGER DEFAULT 0,
    xp_reward INTEGER DEFAULT 0,
    
    -- Unlock criteria (JSON)
    criteria JSONB,
    
    -- Targeting
    educational_stage educational_stage[],     -- Which stages can earn this
    is_hidden BOOLEAN DEFAULT false,           -- Secret achievements
    is_active BOOLEAN DEFAULT true,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

User Achievements

sql
CREATE TABLE user_achievements (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    achievement_id UUID NOT NULL REFERENCES achievements(id) ON DELETE CASCADE,
    
    earned_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    progress DECIMAL(5,2) DEFAULT 100,         -- For progressive achievements
    
    UNIQUE(user_id, achievement_id)
);

Coin Transactions

sql
CREATE TABLE coin_transactions (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    
    amount INTEGER NOT NULL,                   -- Positive = earned, Negative = spent
    balance_after INTEGER NOT NULL,
    transaction_type coin_transaction_type,    -- earned, spent, bonus, penalty
    source VARCHAR(50) NOT NULL,               -- quiz_complete, flashcard_session, avatar_purchase, etc.
    reference_id UUID,                         -- Link to related entity
    description TEXT,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.5 Flashcard Entities

Flashcard Decks

sql
CREATE TABLE flashcard_decks (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    created_by UUID NOT NULL REFERENCES users(id),
    
    title VARCHAR(255) NOT NULL,
    description TEXT,
    subject_id UUID REFERENCES subjects(id),
    class_id UUID REFERENCES classes(id),
    topic VARCHAR(255),
    
    difficulty_level difficulty_level,         -- easy, medium, hard
    is_public BOOLEAN DEFAULT false,           -- Visible to other schools
    is_personal BOOLEAN DEFAULT false,         -- Teacher's personal deck
    
    card_count INTEGER DEFAULT 0,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Flashcards

sql
CREATE TABLE flashcards (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    deck_id UUID NOT NULL REFERENCES flashcard_decks(id) ON DELETE CASCADE,
    
    front_content TEXT NOT NULL,               -- Question/prompt
    back_content TEXT NOT NULL,                -- Answer
    hint TEXT,
    
    media_url TEXT,
    media_type VARCHAR(50),                    -- image, audio, video
    
    card_order INTEGER DEFAULT 0,
    difficulty_level difficulty_level,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Study Sessions

sql
CREATE TABLE flashcard_study_sessions (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    deck_id UUID NOT NULL REFERENCES flashcard_decks(id) ON DELETE CASCADE,
    
    started_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    completed_at TIMESTAMP,
    
    cards_studied INTEGER DEFAULT 0,
    cards_correct INTEGER DEFAULT 0,
    total_time_seconds INTEGER DEFAULT 0,
    
    -- Spaced repetition
    cards_due_reviewed INTEGER DEFAULT 0,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Card Reviews (Spaced Repetition)

sql
CREATE TABLE flashcard_reviews (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    flashcard_id UUID NOT NULL REFERENCES flashcards(id) ON DELETE CASCADE,
    session_id UUID REFERENCES flashcard_study_sessions(id),
    
    confidence_level INTEGER NOT NULL,         -- 1-5 scale
    time_spent_seconds INTEGER,
    reviewed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    -- SM-2 Algorithm fields
    ease_factor DECIMAL(4,2) DEFAULT 2.5,
    interval_days INTEGER DEFAULT 1,
    repetition_count INTEGER DEFAULT 0,
    next_review_date DATE,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.6 B2C (Home Learning) Entities

Children (Home-Only)

sql
CREATE TABLE children (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    parent_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    date_of_birth DATE NOT NULL,
    gender gender_type,
    
    -- Auto-calculated from DOB
    educational_stage educational_stage,
    
    -- Mode
    child_type child_type DEFAULT 'home_only', -- home_only, school_enrolled, both
    
    -- Preferences
    preferred_character yebo_character DEFAULT 'nala',
    profile_photo_url TEXT,
    screen_time_limit_minutes INTEGER DEFAULT 60,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
sql
CREATE TABLE child_school_enrollments (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    child_id UUID NOT NULL REFERENCES children(id) ON DELETE CASCADE,
    school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE,
    student_id UUID REFERENCES students(id),   -- Link to school's student record
    
    enrollment_status VARCHAR(20) DEFAULT 'active', -- active, inactive, pending
    enrolled_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(child_id, school_id)
);

Developmental Milestones

sql
CREATE TABLE developmental_milestones (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    domain VARCHAR(50) NOT NULL,               -- physical, cognitive, language, social, emotional
    milestone_name VARCHAR(255) NOT NULL,
    description TEXT,
    
    expected_age_min_months INTEGER NOT NULL,
    expected_age_max_months INTEGER NOT NULL,
    
    indicators TEXT[],                         -- Observable behaviors
    activities TEXT[],                         -- Suggested activities
    
    is_active BOOLEAN DEFAULT true,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Child Home Milestones (Parent-Tracked)

sql
CREATE TABLE child_home_milestones (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    child_id UUID NOT NULL REFERENCES children(id) ON DELETE CASCADE,
    milestone_id UUID NOT NULL REFERENCES developmental_milestones(id),
    
    status milestone_status DEFAULT 'not_started', -- not_started, in_progress, achieved
    achieved_date DATE,
    
    reported_by UUID REFERENCES users(id),
    evidence_type VARCHAR(50),                 -- photo, video, note
    evidence_url TEXT,
    notes TEXT,
    
    ai_detected BOOLEAN DEFAULT false,         -- Auto-detected by AI
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(child_id, milestone_id)
);

App Sessions (Yebo Kids Usage)

sql
CREATE TABLE child_app_sessions (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    child_id UUID NOT NULL REFERENCES children(id) ON DELETE CASCADE,
    
    app_name VARCHAR(50) NOT NULL,             -- yebo_kids, yebolearn_student
    device_type VARCHAR(50),
    
    session_start TIMESTAMP NOT NULL,
    session_end TIMESTAMP,
    duration_seconds INTEGER,
    
    content_consumed INTEGER DEFAULT 0,
    games_played INTEGER DEFAULT 0,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.7 Content & Media Entities

Content Library

sql
CREATE TABLE content_library (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    title VARCHAR(255) NOT NULL,
    description TEXT,
    content_type content_type NOT NULL,        -- video, audio, interactive, document, ebook, quiz, simulation, ar_vr
    
    -- Targeting
    subject VARCHAR(100),
    topic VARCHAR(255),
    educational_stage educational_stage[],
    age_min_years INTEGER,
    age_max_years INTEGER,
    
    -- Media
    thumbnail_url TEXT,
    content_url TEXT NOT NULL,
    content_urls_by_quality JSONB,             -- {"720p": "...", "1080p": "..."}
    duration_minutes INTEGER,
    file_size_bytes BIGINT,
    
    -- Metadata
    difficulty_level INTEGER DEFAULT 1,
    character yebo_character,
    language VARCHAR(10) DEFAULT 'en',
    available_languages TEXT[],
    is_downloadable BOOLEAN DEFAULT true,
    
    -- Curriculum alignment
    curriculum_framework VARCHAR(50),
    learning_objectives TEXT[],
    keywords TEXT[],
    
    -- Stats
    view_count INTEGER DEFAULT 0,
    avg_rating DECIMAL(3,2),
    is_premium BOOLEAN DEFAULT false,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.8 Platform Entities

Platform Users (YeboLearn Team)

sql
CREATE TABLE platform_users (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    email VARCHAR(255) UNIQUE NOT NULL,
    password_hash VARCHAR(255) NOT NULL,
    
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    phone VARCHAR(50),
    
    role platform_role NOT NULL,               -- super_admin, admin, manager, support
    is_active BOOLEAN DEFAULT true,
    
    -- Security
    last_login TIMESTAMP,
    token_version INTEGER DEFAULT 0,
    password_changed_at TIMESTAMP,
    failed_login_attempts INTEGER DEFAULT 0,
    account_locked_until TIMESTAMP,
    
    created_by UUID REFERENCES platform_users(id),
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Platform Audit Logs

sql
CREATE TABLE platform_audit_logs (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    user_id UUID REFERENCES platform_users(id),
    action VARCHAR(100) NOT NULL,
    resource_type VARCHAR(50) NOT NULL,
    resource_id UUID,
    
    changes JSONB,
    ip_address INET,
    user_agent TEXT,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.9 Localization Entities

Countries

sql
CREATE TABLE countries (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    code VARCHAR(2) UNIQUE NOT NULL,           -- ISO 3166-1 alpha-2
    name VARCHAR(100) NOT NULL,
    flag_emoji VARCHAR(10),
    
    currency_code VARCHAR(3) NOT NULL,         -- ISO 4217
    currency_symbol VARCHAR(10),
    
    timezone VARCHAR(50) NOT NULL,
    locale VARCHAR(10) DEFAULT 'en',
    
    is_active BOOLEAN DEFAULT true,
    display_order INTEGER DEFAULT 0,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Curricula

sql
CREATE TABLE curricula (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    code VARCHAR(50) UNIQUE NOT NULL,          -- CAPS, CBC, SGCSE, GCE, etc.
    name VARCHAR(255) NOT NULL,
    description TEXT,
    grade_structure VARCHAR(100),              -- "R-12", "Form 1-5", etc.
    
    is_active BOOLEAN DEFAULT true,
    display_order INTEGER DEFAULT 0,
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Country-Curricula (Many-to-Many)

sql
CREATE TABLE country_curricula (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    
    country_id UUID NOT NULL REFERENCES countries(id) ON DELETE CASCADE,
    curriculum_id UUID NOT NULL REFERENCES curricula(id) ON DELETE CASCADE,
    
    is_primary BOOLEAN DEFAULT false,
    grade_levels TEXT[],
    languages TEXT[],
    
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    UNIQUE(country_id, curriculum_id)
);

6. API Reference

6.1 Base URL

Production: https://api.yebolearn.com/api/v1
Development: http://localhost:3000/api/v1

6.2 Authentication

EndpointMethodDescriptionAuth
POST /auth/loginPOSTLogin with email/passwordPublic
POST /auth/refreshPOSTRefresh access tokenPublic
POST /auth/logoutPOSTLogout (invalidate refresh token)Public
POST /auth/change-passwordPOSTChange passwordRequired
GET /auth/meGETGet current user profileRequired

6.3 Students

EndpointMethodDescriptionRoles
GET /studentsGETList students (paginated)All
GET /students/:idGETGet student by IDAll
POST /studentsPOSTCreate studentTeacher+
PUT /students/:idPUTUpdate studentTeacher+
DELETE /students/:idDELETEDelete studentTeacher+
GET /students/class/:classIdGETGet students by classAll

6.4 Teachers

EndpointMethodDescriptionRoles
GET /teachersGETList teachersAdmin/Principal
GET /teachers/:idGETGet teacher by IDAdmin/Principal
POST /teachersPOSTCreate teacherAdmin/Principal
PUT /teachers/:idPUTUpdate teacherAdmin/Principal
DELETE /teachers/:idDELETEDelete teacherAdmin/Principal
GET /teachers/:id/scheduleGETGet teacher scheduleTeacher+
GET /teachers/:id/classesGETGet teacher's classesTeacher+
GET /teachers/:id/statsGETGet teacher statisticsTeacher+

6.5 Classes

EndpointMethodDescriptionRoles
GET /classesGETList classesAll
GET /classes/:idGETGet class by IDAll
POST /classesPOSTCreate classAdmin/Principal
PUT /classes/:idPUTUpdate classAdmin/Principal
DELETE /classes/:idDELETEDelete classAdmin/Principal
GET /classes/:id/rosterGETGet class rosterAll
POST /classes/:id/assign-studentsPOSTAssign studentsTeacher+
POST /classes/:id/assign-teacherPOSTAssign teacherAdmin/Principal
GET /classes/:id/statsGETGet class statisticsAll

6.6 Guardians

EndpointMethodDescriptionRoles
GET /guardiansGETList guardiansTeacher+
GET /guardians/:idGETGet guardian by IDTeacher+
POST /guardiansPOSTCreate guardianTeacher+
PUT /guardians/:idPUTUpdate guardianTeacher+
DELETE /guardians/:idDELETEDelete guardianTeacher+
POST /guardians/:id/studentsPOSTAssign student to guardianTeacher+
DELETE /guardians/:id/students/:studentIdDELETERemove student from guardianTeacher+
GET /guardians/:id/studentsGETGet guardian's studentsTeacher+
GET /guardians/students/:studentIdGETGet student's guardiansTeacher+

6.7 Attendance

EndpointMethodDescriptionRoles
POST /attendancePOSTMark single attendanceTeacher+
POST /attendance/bulkPOSTBulk mark attendanceTeacher+
GET /attendance/student/:studentIdGETGet student attendanceAll
GET /attendance/class/:classIdGETGet class attendanceTeacher+
GET /attendance/student/:studentId/statsGETGet attendance statisticsAll

6.8 Grades

EndpointMethodDescriptionRolesTier
POST /gradesPOSTEnter single gradeTeacher+Basic+
POST /grades/bulkPOSTBulk enter gradesTeacher+Basic+
GET /grades/student/:studentIdGETGet student gradesAllBasic+
GET /grades/class/:classIdGETGet class gradesTeacher+Basic+
PUT /grades/:idPUTUpdate gradeTeacher+Basic+
DELETE /grades/:idDELETEDelete gradeAdmin/PrincipalBasic+
GET /grades/student/:studentId/averageGETGet student averageAllBasic+
GET /grades/student/:studentId/transcriptGETGenerate transcriptAllBasic+
GET /grades/subject/:subjectId/class/:classId/performanceGETSubject performanceTeacher+Basic+

6.9 Fees & Payments

EndpointMethodDescriptionRoles
GET /feesGETList feesAll
GET /fees/:idGETGet fee by IDAll
POST /feesPOSTCreate feeAdmin/Finance
PUT /fees/:idPUTUpdate feeAdmin/Finance
DELETE /fees/:idDELETEDelete feeAdmin/Principal
POST /fees/assign-studentPOSTAssign fee to studentAdmin/Finance
POST /fees/assign-classPOSTAssign fee to classAdmin/Finance
GET /fees/student/:studentIdGETGet student feesAll
GET /fees/outstandingGETGet outstanding feesAdmin/Finance
GET /fees/overdueGETGet overdue feesAdmin/Finance
EndpointMethodDescriptionRoles
POST /payments/stripe/create-payment-intentPOSTCreate Stripe paymentParent/Finance
POST /payments/mtn-momo/create-paymentPOSTCreate MTN MoMo paymentParent/Finance
POST /paymentsPOSTRecord manual paymentAdmin/Finance
GET /paymentsGETList paymentsAdmin/Finance
GET /payments/:idGETGet payment by IDAll
GET /payments/:id/receiptGETGenerate receiptAll
PUT /payments/:id/statusPUTUpdate payment statusAdmin/Finance
POST /payments/:id/refundPOSTProcess refundAdmin/Finance
GET /payments/statsGETPayment statisticsAdmin/Finance
GET /payments/reconcileGETReconciliation reportAdmin/Finance
GET /payments/mtn-momo/status/:referenceIdGETCheck MoMo statusAll
GET /payments/mtn-momo/balanceGETMoMo account balanceAdmin/Finance
POST /payments/mtn-momo/validate-accountPOSTValidate MoMo accountAll

6.10 Flashcards

EndpointMethodDescriptionRolesTier
POST /flashcards/decksPOSTCreate deckTeacherBasic+
GET /flashcards/decksGETList decksTeacherBasic+
GET /flashcards/decks/:idGETGet deckAllBasic+
PUT /flashcards/decks/:idPUTUpdate deckTeacherBasic+
DELETE /flashcards/decks/:idDELETEDelete deckTeacherBasic+
POST /flashcards/decks/:deckId/cardsPOSTAdd cardTeacherBasic+
GET /flashcards/decks/:deckId/cardsGETGet cardsAllBasic+
PUT /flashcards/decks/:deckId/cards/:cardIdPUTUpdate cardTeacherBasic+
DELETE /flashcards/decks/:deckId/cards/:cardIdDELETEDelete cardTeacherBasic+
POST /flashcards/sessionsPOSTStart study sessionStudentBasic+
PUT /flashcards/sessions/:sessionId/completePUTComplete sessionStudentBasic+
GET /flashcards/sessionsGETGet student sessionsStudentBasic+
POST /flashcards/reviewsPOSTSubmit card reviewStudentBasic+
GET /flashcards/reviews/dueGETGet due cardsStudentBasic+
GET /flashcards/decks/:deckId/progressGETGet progressStudentBasic+
POST /flashcards/assignmentsPOSTAssign deck to classTeacherBasic+
GET /flashcards/my-decksGETStudent's assigned decksStudentBasic+
GET /flashcards/analytics/deck/:deckId/class/:classIdGETDeck analyticsTeacherPremium+

6.11 Avatar Teacher (AI)

EndpointMethodDescriptionAuthTier
GET /avatar-teacher/healthGETHealth checkPublic-
GET /avatar-teacher/languagesGETSupported languagesPublic-
GET /avatar-teacher/curriculaGETSupported curriculaPublic-
POST /avatar-teacher/demo/mathPOSTDemo math questionPublic-
POST /avatar-teacher/lessons/startPOSTStart lesson sessionStudentPremium+
POST /avatar-teacher/askPOSTAsk text questionStudentPremium+
POST /avatar-teacher/speakPOSTVoice inputStudentPremium+

6.12 Reports & Analytics

EndpointMethodDescriptionRolesTier
GET /analytics/overviewGETSchool overviewAllBasic+
GET /analytics/attendanceGETAttendance trendAllBasic+
GET /analytics/feesGETFee collection trendAllBasic+
GET /analytics/students-by-gradeGETStudents by gradeAllBasic+
GET /analytics/top-classesGETTop classesAllBasic+
GET /analytics/recent-paymentsGETRecent paymentsAllBasic+
GET /reports/attendanceGETAttendance reportAdmin/PrincipalPremium+
GET /reports/gradesGETGrades reportTeacher+Premium+
GET /reports/feesGETFees reportAdmin/FinancePremium+
GET /reports/studentsGETStudents reportAdmin/PrincipalPremium+
GET /reports/dashboardGETDashboard analyticsAdmin/PrincipalPremium+
GET /reports/csv/:reportTypeGETCSV exportTeacher+Premium+
GET /reports/scheduledGETScheduled reportsAdmin/PrincipalEnterprise
POST /reports/scheduledPOSTCreate scheduled reportAdmin/PrincipalEnterprise
POST /reports/customPOSTGenerate custom reportAdmin/PrincipalPremium+
POST /reports/comparePOSTComparative reportAdmin/PrincipalPremium+

6.13 Platform Admin Routes

EndpointMethodDescriptionRoles
POST /platform/auth/loginPOSTPlatform user loginPublic
POST /platform/auth/registerPOSTCreate platform userSuperAdmin
POST /platform/auth/refreshPOSTRefresh tokenPublic
GET /platform/auth/meGETGet current platform userPlatform
GET /platform/schoolsGETList all schoolsManager+
POST /platform/schoolsPOSTCreate schoolAdmin+
GET /platform/schools/:idGETGet schoolManager+
PUT /platform/schools/:idPUTUpdate schoolAdmin+
PUT /platform/schools/:id/subscriptionPUTUpdate subscriptionAdmin+
PUT /platform/schools/:id/statusPUTToggle school statusAdmin+
GET /platform/schools/:id/statsGETSchool statisticsManager+
GET /platform/analyticsGETPlatform analyticsManager+
GET /platform/auditGETAudit logsAdmin+

6.14 Parent B2C Routes

EndpointMethodDescriptionAuth
GET /parent/childrenGETList all childrenRequired
POST /parent/childrenPOSTAdd home-only childRequired
GET /parent/children/:idGETGet child detailsRequired
PUT /parent/children/:idPUTUpdate childRequired
DELETE /parent/children/:idDELETERemove childRequired
GET /parent/children/:id/home-activityGETYebo Kids activityRequired
GET /parent/children/:id/milestonesGETGet milestonesRequired
POST /parent/children/:id/milestonesPOSTRecord milestoneRequired
GET /parent/dashboard-configGETGet dashboard configRequired
PUT /parent/dashboard-config/active-childPUTSet active childRequired
PUT /parent/dashboard-config/preferencesPUTUpdate preferencesRequired

6.15 Public Routes (No Auth)

EndpointMethodDescription
POST /onboarding/submitPOSTSubmit school onboarding application
GET /public/curriculaGETGet available curricula
GET /public/countriesGETGet supported countries
GET /countriesGETGet all countries
POST /public/contactPOSTSubmit contact form

7. Yebo Kids PWA

7.1 Overview

Yebo Kids is a Progressive Web App designed for children ages 2-8, featuring:

  • Colorful, touch-friendly UI with large buttons
  • Character-based navigation with Yebo Friends mascots
  • Offline support via service workers
  • Parental controls via YeboLearn parent dashboard

7.2 Core Sections

SectionIconDescription
Watch🎬Educational videos, cartoons, learning shows
Play🎮Interactive games, puzzles, activities
Sing🎵Nursery rhymes, songs, sing-alongs
Stories📚Animated storybooks, read-aloud stories

7.3 Features

  • Character Selection: Choose preferred Yebo Friend (Nala, Tembo, Zuzu, Kiki, Simba)
  • Star Rewards: Earn stars for completing content
  • Streak Tracking: Daily engagement streaks
  • Sticker Collection: Unlock stickers as rewards
  • Progress Dashboard: Daily stats for parents
  • Age-Appropriate Content: Filtered by educational stage
  • Multi-Language: English + local languages

7.4 Technical Details

yebo-kids/
├── src/
│   ├── pages/
│   │   ├── HomePage.tsx          # Main hub with sections
│   │   ├── WatchPage.tsx         # Video browser
│   │   ├── VideoDetailPage.tsx   # Video player
│   │   ├── PlayPage.tsx          # Game browser
│   │   ├── GameDetailPage.tsx    # Game player
│   │   ├── SingPage.tsx          # Song browser
│   │   ├── SongDetailPage.tsx    # Song player
│   │   ├── StoriesPage.tsx       # Story browser
│   │   └── StoryDetailPage.tsx   # Story reader
│   ├── components/
│   │   └── LandingPage/          # Landing/onboarding
│   ├── contexts/
│   │   └── ChildContext.tsx      # Child profile & rewards
│   └── lib/
│       └── api.ts                # Backend API client
├── public/
│   └── manifest.json             # PWA manifest
└── vite.config.ts                # PWA configuration

7.5 Integration with Parent Dashboard

  • Parents add children in Parent Dashboard
  • Child profiles sync to Yebo Kids
  • Activity tracking sent back to Parent Dashboard
  • Screen time limits enforced
  • Milestone auto-detection from content interaction

8. Dashboard Breakdown

8.1 School Admin Dashboard

URL: https://admin.yebolearn.com

PageFeatures
DashboardOverview cards (students, teachers, fees), recent activity, quick actions
StudentsStudent list, search/filter, add/edit students, bulk import
Add StudentForm: personal details, class assignment, guardian linking
StaffTeacher list, other staff, add/edit employees
Add StaffForm: employee details, role assignment, specializations
ClassesClass list, manage rosters, assign teachers
AttendanceMark attendance, view reports, bulk marking
FeesFee structures, assign to students/classes, payment tracking
SettingsSchool profile, academic year, terms, branding
AnalyticsCharts: enrollment trends, attendance rates, fee collection

8.2 Teacher Dashboard

URL: https://teacher.yebolearn.com

PageFeatures
DashboardToday's schedule, class overviews, pending tasks
My ClassesAssigned classes, student rosters
AttendanceMark class attendance (single/bulk)
GradesEnter grades, view class performance
FlashcardsCreate decks, manage cards, assign to classes
StudentsView student profiles, contact guardians
MessagesSend/receive messages to parents
ScheduleWeekly timetable view

8.3 Student Dashboard

URL: https://student.yebolearn.com

PageFeatures
DashboardXP/level display, streak counter, today's schedule, grade summary, notifications
GradesSubject grades with trends, term reports, transcripts
AttendanceAttendance calendar, statistics
ScheduleDaily/weekly timetable
FlashcardsAssigned decks, study sessions, progress tracking
AI TutorChat interface with Avatar Teacher
BadgesAchievement gallery, unlocked/locked badges
FeesFee balance, payment history
NotificationsAnnouncements, grade alerts, messages
ProfilePersonal info, avatar customization

8.4 Parent Dashboard

URL: https://parent.yebolearn.com

PageFeatures
DashboardChildren overview, active child selector, quick stats
ChildrenList all children (school + home-only), add B2C children
School ProgressGrades, attendance, fees for enrolled children
Home LearningYebo Kids activity, content history, screen time
MilestonesDevelopmental tracking, evidence upload
FeesOutstanding balances, pay fees, receipts
MessagesCommunication with teachers
SettingsPreferences, notifications, child profiles

8.5 Super Admin Dashboard

URL: https://platform.yebolearn.com

PageFeatures
DashboardPlatform overview: total schools, users, revenue
SchoolsList all schools, create/edit, subscription management
School DetailsSchool statistics, user counts, usage metrics
UsersPlatform user management (admins, managers, support)
OnboardingPending school applications, approval workflow
Audit LogsPlatform-wide activity logs
AnalyticsCross-school analytics, trends, reports

9. Authentication & Authorization

9.1 Authentication Flow

┌─────────┐      ┌─────────┐      ┌─────────┐
│  Login  │ ───▶ │ Verify  │ ───▶ │  Issue  │
│  Form   │      │ Creds   │      │ Tokens  │
└─────────┘      └─────────┘      └─────────┘

                     ┌─────────────────┘

            ┌─────────────────┐
            │  Access Token   │  (15 min expiry)
            │  Refresh Token  │  (7 day expiry)
            └─────────────────┘


            ┌─────────────────┐
            │   API Requests  │
            │ Authorization:  │
            │ Bearer <token>  │
            └─────────────────┘

9.2 JWT Token Structure

Access Token Payload:

json
{
  "userId": "uuid",
  "schoolId": "uuid",
  "role": "teacher",
  "email": "teacher@school.com",
  "tokenVersion": 1,
  "iat": 1700000000,
  "exp": 1700000900
}

Platform Token Payload:

json
{
  "userId": "uuid",
  "role": "admin",
  "email": "admin@yebolearn.com",
  "tokenVersion": 1,
  "iat": 1700000000,
  "exp": 1700000900
}

9.3 Role Hierarchy

School Roles:

super_admin (legacy, same as school_admin)

    ├── school_admin
    │       │
    │       ├── principal
    │       │       │
    │       │       ├── teacher
    │       │       │       │
    │       │       │       └── student
    │       │       │
    │       │       └── finance
    │       │
    │       └── parent (guardian access)

Platform Roles:

super_admin (YeboLearn team lead)

    ├── admin (full access)

    ├── manager (read + limited write)

    └── support (read-only)

9.4 Permission System

School Permissions (schoolPermissions.ts):

typescript
export const SCHOOL_PERMISSIONS = {
  // Student Management
  CREATE_STUDENT: 'create:student',
  READ_STUDENT: 'read:student',
  UPDATE_STUDENT: 'update:student',
  DELETE_STUDENT: 'delete:student',
  
  // Guardian Management
  CREATE_GUARDIAN: 'create:guardian',
  READ_GUARDIAN: 'read:guardian',
  UPDATE_GUARDIAN: 'update:guardian',
  DELETE_GUARDIAN: 'delete:guardian',
  
  // Class Management
  CREATE_CLASS: 'create:class',
  READ_CLASS: 'read:class',
  UPDATE_CLASS: 'update:class',
  DELETE_CLASS: 'delete:class',
  
  // Attendance
  MARK_ATTENDANCE: 'mark:attendance',
  READ_ATTENDANCE: 'read:attendance',
  
  // Grades
  CREATE_GRADE: 'create:grade',
  READ_GRADE: 'read:grade',
  UPDATE_GRADE: 'update:grade',
  DELETE_GRADE: 'delete:grade',
  
  // Fees & Payments
  CREATE_FEE: 'create:fee',
  READ_FEE: 'read:fee',
  UPDATE_FEE: 'update:fee',
  DELETE_FEE: 'delete:fee',
  PROCESS_PAYMENT: 'process:payment',
  READ_PAYMENT: 'read:payment',
  UPDATE_PAYMENT: 'update:payment',
  
  // Reports
  GENERATE_REPORTS: 'generate:reports',
  
  // Settings
  MANAGE_SETTINGS: 'manage:settings',
};

export const ROLE_PERMISSIONS: Record<UserRole, string[]> = {
  school_admin: Object.values(SCHOOL_PERMISSIONS),
  principal: [/* subset */],
  teacher: [/* subset */],
  finance: [/* finance subset */],
  parent: ['read:student', 'read:grade', 'read:attendance', 'read:fee', 'process:payment'],
  student: ['read:grade', 'read:attendance', 'read:fee'],
};

9.5 Middleware Chain

typescript
// Typical protected route
router.get('/students',
  authenticate,           // Verify JWT
  multiTenant,            // Extract schoolId, enforce tenant
  loadSchoolSubscription, // Load tier for feature gating
  can.readStudent,        // Check permission
  studentController.findAll
);

10. Billing & Pricing

10.1 Subscription Tiers

FeatureFREEBASICPREMIUMENTERPRISE
Price (Monthly)$0$49$199Custom
Students502501,000Unlimited
Teachers525100Unlimited
Attendance
Grades
Fee ManagementBasic
Flashcards
AI Tutor
Custom Reports
Scheduled Reports
API Access
White Label
Dedicated SupportEmailPhoneAccount Manager

10.2 Feature Gating

typescript
// middleware/featureGate.middleware.ts

export const TIER_FEATURES: Record<SubscriptionTier, string[]> = {
  free: ['attendance', 'basic_fees', 'messaging'],
  basic: ['attendance', 'grades', 'fees', 'flashcards', 'messaging', 'basic_reports'],
  premium: ['all_basic', 'ai_tutor', 'custom_reports', 'advanced_analytics'],
  enterprise: ['all_premium', 'scheduled_reports', 'api_access', 'white_label', 'sso'],
};

export const TIER_LIMITS: Record<SubscriptionTier, { students: number; teachers: number }> = {
  free: { students: 50, teachers: 5 },
  basic: { students: 250, teachers: 25 },
  premium: { students: 1000, teachers: 100 },
  enterprise: { students: Infinity, teachers: Infinity },
};

export const checkLimits = {
  students: async (req, res, next) => {
    const { subscription } = req;
    const currentCount = await getStudentCount(req.schoolId);
    const limit = TIER_LIMITS[subscription.tier].students;
    if (currentCount >= limit) {
      return res.status(403).json({
        success: false,
        message: `Student limit reached (${limit}). Upgrade to add more students.`,
      });
    }
    next();
  },
  teachers: async (req, res, next) => {
    // Similar logic
  },
};

export const requireFeatures = {
  grades: (req, res, next) => {
    if (!TIER_FEATURES[req.subscription.tier].includes('grades')) {
      return res.status(403).json({
        success: false,
        message: 'Grades feature requires BASIC tier or above.',
      });
    }
    next();
  },
  // ... other feature gates
};

10.3 Payment Integration

Stripe:

  • Card payments (international)
  • Payment intents for secure checkout
  • Webhook for payment confirmation

MTN Mobile Money:

  • Collection API integration
  • Phone number validation
  • Push payment requests
  • Status polling
  • Webhook callbacks

11. Technical Stack

11.1 Backend

ComponentTechnology
RuntimeNode.js v22+
FrameworkExpress.js 4.x
LanguageTypeScript 5.x
DatabasePostgreSQL 15
ORMRaw SQL (pg driver)
ValidationZod
AuthJWT (jsonwebtoken, bcrypt)
LoggingWinston
API DocsSwagger/OpenAPI
TestingJest

11.2 Frontend (All Dashboards)

ComponentTechnology
FrameworkReact 18+
Build ToolVite 5
LanguageTypeScript 5.x
StylingTailwind CSS 3.x
UI Componentsshadcn/ui
State ManagementReact Context + Hooks
HTTP ClientFetch API
RoutingReact Router 6
ChartsRecharts

11.3 Infrastructure

ComponentService
ComputeGoogle Cloud Run
DatabaseCloud SQL (PostgreSQL)
StorageCloud Storage
SecretsSecret Manager
Frontend HostingCloudflare Pages
DNSCloudflare
CDNCloudflare
MonitoringCloud Logging

11.4 External Services

ServicePurpose
StripeCard payments
MTN MoMoMobile money (Africa)
Google GeminiAI tutoring
ElevenLabsText-to-speech (Avatar)
DeepgramSpeech-to-text

12. Gaps & Missing Features

12.1 Critical Gaps

GapImpactPriority
No SMS notificationsParents without smartphones miss alertsHIGH
No offline modeSchools with poor connectivity can't use appHIGH
No data importSchools can't migrate from existing systemsHIGH
No multi-language UILimited to English interfaceMEDIUM

12.2 Feature Gaps

FeatureDescriptionPriority
Timetable BuilderVisual schedule creation toolMEDIUM
Exam SchedulingExam calendar managementMEDIUM
Library ManagementBook lending, digital resourcesLOW
Transport ManagementBus routes, trackingLOW
Hostel ManagementBoarding school accommodationLOW
Alumni PortalGraduate tracking, networkingLOW
Parent-Teacher ConferenceMeeting schedulingMEDIUM
Digital Report CardsPDF generation, email deliveryHIGH
Bulk SMSSMS notification serviceHIGH
WhatsApp IntegrationWhatsApp notificationsMEDIUM

12.3 Technical Debt

IssueDescriptionPriority
No Prisma ORMRaw SQL queries scatteredLOW
No Redis cachingNo caching layer for performanceMEDIUM
No job queueNo background job processingMEDIUM
No E2E testsFrontend testing missingHIGH
No CI/CD pipelineManual deploymentsHIGH
No error trackingNo Sentry or similarHIGH

12.4 Yebo Kids Gaps

GapDescriptionPriority
No content CMSContent hardcoded, no admin panelHIGH
No parental PINNo child lock featuresMEDIUM
No offline contentRequires internet for all contentHIGH
Limited languagesOnly English contentMEDIUM
No AR featuresNo augmented reality gamesLOW

12.5 AI System Gaps

GapDescriptionPriority
No conversation historySessions don't persistMEDIUM
Limited curriculaNot all topics coveredHIGH
No math renderingLaTeX/equations display issuesMEDIUM
No image understandingCan't analyze diagramsLOW
No progress trackingAI doesn't track learning pathMEDIUM

Appendix A: Enums

sql
-- User roles
CREATE TYPE user_role AS ENUM (
  'super_admin', 'school_admin', 'principal', 
  'teacher', 'parent', 'student', 'finance'
);

-- Platform roles
CREATE TYPE platform_role AS ENUM (
  'super_admin', 'admin', 'manager', 'support'
);

-- Subscription tiers
CREATE TYPE subscription_tier AS ENUM (
  'free', 'basic', 'premium', 'enterprise'
);

-- School types
CREATE TYPE school_type AS ENUM (
  'ecd_only', 'primary_only', 'secondary_only', 
  'tertiary', 'multi_level'
);

-- Educational stages
CREATE TYPE educational_stage AS ENUM (
  'infant', 'toddler', 'preschool', 
  'primary_lower', 'primary_upper', 
  'secondary_junior', 'secondary_senior', 
  'tertiary'
);

-- Yebo Friends characters
CREATE TYPE yebo_character AS ENUM (
  'nala', 'tembo', 'zuzu', 'kiki', 'simba'
);

-- Child types (B2C)
CREATE TYPE child_type AS ENUM (
  'home_only', 'school_enrolled', 'both'
);

-- Gender
CREATE TYPE gender_type AS ENUM (
  'male', 'female', 'other'
);

-- Attendance status
CREATE TYPE attendance_status AS ENUM (
  'present', 'absent', 'late', 'excused'
);

-- Fee status
CREATE TYPE fee_status AS ENUM (
  'pending', 'partially_paid', 'paid', 'overdue', 'waived'
);

-- Payment status
CREATE TYPE payment_status AS ENUM (
  'pending', 'processing', 'completed', 'failed', 'refunded'
);

-- Payment method
CREATE TYPE payment_method AS ENUM (
  'cash', 'bank_transfer', 'mobile_money', 'card', 'cheque'
);

-- Assessment types
CREATE TYPE assessment_type AS ENUM (
  'quiz', 'test', 'midterm', 'final', 'assignment', 'project'
);

-- Relationship types
CREATE TYPE relationship_type AS ENUM (
  'father', 'mother', 'guardian', 'grandparent', 'sibling', 'other'
);

-- Difficulty levels
CREATE TYPE difficulty_level AS ENUM (
  'easy', 'medium', 'hard'
);

-- Content types
CREATE TYPE content_type AS ENUM (
  'video', 'audio', 'interactive', 'document', 
  'ebook', 'quiz', 'simulation', 'ar_vr'
);

-- Milestone status
CREATE TYPE milestone_status AS ENUM (
  'not_started', 'in_progress', 'achieved'
);

-- Notification types
CREATE TYPE notification_type AS ENUM (
  'announcement', 'attendance', 'grade', 'fee', 'message', 'system'
);

-- Notification priority
CREATE TYPE notification_priority AS ENUM (
  'low', 'medium', 'high', 'urgent'
);

-- Coin transaction types
CREATE TYPE coin_transaction_type AS ENUM (
  'earned', 'spent', 'bonus', 'penalty'
);

Appendix B: Supported Curricula

CodeNameCountriesGrade Structure
CAPSCurriculum and Assessment Policy StatementSouth AfricaR-12
IEBIndependent Examinations BoardSouth AfricaR-12
SGCSESwaziland General Certificate of Secondary EducationEswatiniForm 1-5
IGCSEInternational General Certificate of Secondary EducationEswatini, MultiForm 1-5
CambridgeCambridge International AS/A LevelsEswatini, MultiForm 6
CBCCompetency-Based CurriculumKenyaPP1-Grade 9
8-4-4Kenya 8-4-4 System (Legacy)KenyaStd 1-Form 4
GCEGeneral Certificate of EducationCameroonForm 1-Upper Sixth
BaccalauréatFrench BaccalauréatCameroon6ème-Terminale
BGCSEBotswana General Certificate of Secondary EducationBotswanaForm 1-5

Appendix C: API Error Codes

CodeHTTP StatusDescription
AUTH_REQUIRED401No authentication token provided
INVALID_TOKEN401Token is invalid or expired
FORBIDDEN403Insufficient permissions
FEATURE_NOT_AVAILABLE403Feature requires higher tier
LIMIT_EXCEEDED403Subscription limit reached
NOT_FOUND404Resource not found
VALIDATION_ERROR400Request validation failed
CONFLICT409Resource already exists
RATE_LIMITED429Too many requests
SERVER_ERROR500Internal server error

Document generated from live codebase analysis. For latest updates, refer to the source repositories.

One chat. Everything done.