Dattavani Backend: Learning Content

Dattavani Backend: Learning Content A sequence diagram generated by Archify. GET /api/v2/learnings/books book_id, chapter_id,include_chunks verify kid JWT consent and kid_activeread from claims kid_id, parent_id read book content 300 s TTL, per workerprocess get_book_content_rpc on miss result is stored in thecache get_book_progress_rpc per kid, never cached completions + liked chapters book tree + media_path locks and percentagescomputed in Python GET media file {cdn_public_base_url}/{media_path} POST /api/check-usage before opening new content check_content_access_rpc consent, membership,minutes, trial cap allowed or error key 200, or 403 with code POST .../chunks/complete v2_complete_chunk_progression_rpc re-checks membership andtrial cap chunk, scene, chapter done chapter 0 adds epic introXP once completion flags + quizzes POST .../quizzes/{id}/submit score + reward math coins and XP on attempt 1only v2_submit_quiz_rpc one atomic call, neverretried coins, XP, level, streak insert user_badges awaited, so the app cancelebrate unlock quizzes, milestones background tasks after thereply ClientQuizResult score, XP, level, badges POST /api/v2/stories/chunks/complete v2_complete_story_chunk_rpc story newly completed first story today earns+10 XP update_daily_stats_rpc sets the story_done flag story progress + XP Browse a book Open a chapter or story Read a chunk Submit a quiz Finish a story Kid App · mobile, kid JWT · Sequence participant Kid App mobile, kid JWT Access gate · kid JWT + check-usage · Sequence participant Access gate kid JWT + check-usage Learnings v2 API · books, quizzes, stories · Sequence participant Learnings v2 API books, quizzes, stories Content cache · in-process TTLCache · Sequence participant Content cache in-process TTLCache Rewards service · coins, XP, badges · Sequence participant Rewards service coins, XP, badges Supabase Postgres · RPCs + tables · Sequence participant Supabase Postgres RPCs + tables R2 CDN · audio, video, images · Sequence participant R2 CDN audio, video, images Legend main request return security async trace message