Dattavani Backend: Data Model, Content and AI

Dattavani Backend: Data Model, Content and AI An entity-relationship diagram generated by Archify. learning path quizzes narration audio inbox config ask tataji live voice & avatar stories story tags reference parent feedback books · Entity · learning path books PK id bigint name varchar(200) icon_url text description text metadata jsonb thumbnail_url text order_index integer is_active boolean created_by bigint → parent_profile.id created_at timestamptz updated_at timestamptz learning_nodes · Entity · learning path learning_nodes PK id bigint FK book_id bigint FK parent_id bigint title varchar(200) thumbnail_url text image_url text type learning_node_type_enum order_index integer metadata jsonb created_at timestamptz chapters · Entity · learning path chapters PK id bigint FK node_id bigint title varchar(200) content_type varchar(20) content text thumbnail_url text audio_url text video_url text image_url text key_takeaway text FK quiz_id bigint metadata jsonb order_index integer is_active boolean created_by bigint → parent_profile.id created_at timestamptz updated_at timestamptz ask_tataji_question text intro_audios_media_path text chapter_scenes · Entity · learning path chapter_scenes PK id bigint FK chapter_id bigint image_url text order_index integer is_active boolean created_at timestamptz updated_at timestamptz landscape_image_url text portrait_image_url text chapter_scene_chunks · Entity · learning path chapter_scene_chunks PK id bigint FK chapter_scene_id bigint text_content text order_index integer is_active boolean created_at timestamptz updated_at timestamptz media_path text book_bonus_quizzes · Entity · quizzes book_bonus_quizzes PK id bigint FK book_id bigint FK quiz_id bigint unlock_after_n_chapters integer FK easy_quiz_id bigint FK medium_quiz_id bigint FK hard_quiz_id bigint kid_id bigint → kid_profiles.id question_ids jsonb quizzes · Entity · quizzes quizzes PK id bigint title text type quiz_type_enum is_super_quiz boolean is_bonus_quiz boolean coins_base integer questions_count integer config jsonb created_by bigint → parent_profile.id created_at timestamptz section_bonus_quizzes · Entity · quizzes section_bonus_quizzes PK id bigint FK section_node_id bigint FK quiz_id bigint unlock_after_n_chapters integer FK easy_quiz_id bigint FK medium_quiz_id bigint FK hard_quiz_id bigint kid_id bigint → kid_profiles.id question_ids jsonb quiz_questions · Entity · quizzes quiz_questions PK id bigint FK quiz_id bigint type varchar(20) question_text text options jsonb correct_answer text hint text explanation text difficulty varchar(10) order_index integer metadata jsonb created_by bigint → parent_profile.id created_at timestamptz chapter_intro_audios · Entity · narration audio chapter_intro_audios PK id bigint FKUK chapter_id bigint UK voice_type varchar(20) audio_url text transcript jsonb created_at timestamptz updated_at timestamptz chapter_chunk_audios · Entity · narration audio chapter_chunk_audios PK id bigint FK chapter_chunk_id bigint voice_type varchar(20) audio_url text transcript jsonb created_at timestamptz content_type varchar(50) notifications · Entity · inbox notifications PK id bigint kid_id bigint → kid_profiles.id parent_id bigint → parent_profile.id recipient_type varchar(20) recipient_id bigint type varchar(50) title varchar(200) body text is_read boolean created_at timestamptz updated_at timestamptz metadata jsonb app_config · Entity · config app_config PK id bigint UK key varchar(100) value text description text updated_by bigint → parent_profile.id updated_at timestamptz feature_flags · Entity · config feature_flags PK id bigint UK flag_key varchar(100) module varchar(50) enabled boolean description text updated_at timestamptz updated_by bigint → parent_profile.id conversations · Entity · ask tataji conversations PK id bigint kid_id bigint → kid_profiles.id title text output_type_preference varchar(10) metadata jsonb created_at timestamptz updated_at timestamptz anonymized_at timestamptz curated_prompts · Entity · ask tataji curated_prompts PK id bigint prompt_text text context_type varchar(50) is_active boolean week_start date created_by bigint → parent_profile.id created_at timestamptz suggested_mode varchar(10) UK display_order smallint cached_response jsonb cached_media_url text messages · Entity · ask tataji messages PK id bigint FK conversation_id bigint role message_role_enum content text type message_type_enum media_url text feedback_reaction feedback_reaction_enum feedback_comment text is_flagged boolean metadata jsonb created_at timestamptz ai_video_jobs · Entity · ask tataji ai_video_jobs PK id bigint FK conversation_id bigint FK message_id bigint kid_id bigint → kid_profiles.id prompt_text text status varchar(20) video_url text estimated_ready_at timestamptz completed_at timestamptz created_at timestamptz message_feedback · Entity · ask tataji message_feedback PK id bigint FK message_id bigint kid_id bigint → kid_profiles.id rating varchar(10) comment text created_at timestamptz tataji_fair_usage_windows · Entity · ask tataji tataji_fair_usage_windows PK kid_id bigint → kid_profiles.id window_started_at timestamptz question_count integer updated_at timestamptz swamiji_conversations · Entity · live voice & avatar swamiji_conversations PK room_id text identity text parent_id bigint → parent_profile.id kid_id bigint → kid_profiles.id created_at timestamptz ended_at timestamptz duration_s integer end_reason text swamiji_turns · Entity · live voice & avatar swamiji_turns PK id bigint UK event_id text FK room_id text parent_id bigint → parent_profile.id kid_id bigint → kid_profiles.id turn_id integer route text user_text text swamiji_text text full_text text interrupted boolean sources integer error text started_at timestamptz completed_at timestamptz received_at timestamptz avatar_sessions · Entity · live voice & avatar avatar_sessions PK id bigint session_id text parent_id bigint → parent_profile.id kid_id bigint → kid_profiles.id email text status text provider text started_at timestamptz ended_at timestamptz metadata jsonb bedtime_stories · Entity · stories bedtime_stories PK id bigint title varchar(200) audio_url text video_url text cover_url text duration_seconds integer order_index integer is_active boolean created_by bigint → parent_profile.id created_at timestamptz description text metadata jsonb story_scenes · Entity · stories story_scenes PK id bigint FK story_id bigint image_url text order_index integer is_active boolean created_at timestamptz updated_at timestamptz landscape_image_url text portrait_image_url text story_scene_chunks · Entity · stories story_scene_chunks PK id bigint FK story_scene_id bigint text_content text order_index integer is_active boolean created_at timestamptz updated_at timestamptz media_path text story_chunk_audios · Entity · stories story_chunk_audios PK id bigint FK story_chunk_id bigint voice_type varchar(20) audio_url text transcript jsonb created_at timestamptz story_character_mapping · Entity · story tags story_character_mapping PK id bigint FK story_id bigint FK character_id bigint created_at timestamptz story_characters · Entity · story tags story_characters PK id bigint name text image_url text description text metadata jsonb created_at timestamptz story_theme_mapping · Entity · story tags story_theme_mapping PK id bigint FK story_id bigint FK theme_id bigint created_at timestamptz story_themes · Entity · story tags story_themes PK id bigint name text description text created_at timestamptz tags · Entity · reference tags PK id bigint UK name text type text created_at timestamptz daily_quotes · Entity · reference daily_quotes PK id bigint quote_text text quote_date date created_at timestamptz parent_app_feedback · Entity · parent feedback parent_app_feedback PK id bigint parent_id bigint → parent_profile.id message text created_at timestamptz store_review_prompt_attempts · Entity · parent feedback store_review_prompt_attempts PK id bigint parent_id bigint → parent_profile.id prompted_at timestamptz created_at timestamptz quiz_id 4 quiz FKs section_node_id 4 quiz FKs room_id Legend PK Primary key FK Foreign key UK Unique key One Many Optional