Jorrii Spark

Admin Docs

Internal Only โ† Back to Site
๐Ÿ“… Last Updated: March 12, 2026

๐ŸŸข System Health

๐Ÿ›ฐ๏ธ Live Status
Not checked yet
๐Ÿ—„๏ธ Supabase
Checking...
Database & Auth
โšก Lambda API
Checking...
jorrii-spark-api
๐ŸŽฌ Replicate
Checking...
Video & Image AI
๐Ÿค– OpenAI
Checking...
Images & TTS
๐Ÿ”ต Google AI
Checking...
Imagen & Veo
๐ŸŽ™๏ธ ElevenLabs
Checking...
Voice & SFX
๐ŸŒ Hostinger
Checking...
Static Hosting

System Overview

Jorrii Spark is a kid-first AI creativity platform for ages 6-12 with a Pixar-inspired bubbly design. Kids can create images, videos, music, sounds, and multi-step projects using safe, curated AI tools โ€” all managed by a parent dashboard.

Core Concept

Parents sign up with Google or email โ†’ create kid accounts with PINs โ†’ kids log in with their PIN โ†’ create content within plan limits โ†’ parents review everything from the dashboard.

Parent Signs Up โ†’ Creates Kid Accounts โ†’ Kid Enters PIN โ†’ Creates Content โ†’ Parent Reviews โ†’ Usage Tracked

๐Ÿ“Š Business Dashboard

โš™๏ธ Loading dashboard...

Architecture

Tech Stack

LayerTechnologyDetails
FrontendStatic HTML/CSS/JSHosted on Hostinger, no framework
Auth & DBSupabaseGoogle OAuth, email/password, Row Level Security
APIAWS API Gateway + LambdaShared with adult Jorrii backend
StorageAWS S3 + CloudFrontGenerated images, videos, audio files
DatabaseSupabase PostgreSQL + DynamoDBUsers/kids in Supabase, generations in DynamoDB
FontsGoogle FontsFredoka (headings), Quicksand (body)

Domain & Hosting

WhatWhere
Domainjorrii.io
HostingHostinger (static files)
Supabase Projectcwudeohugaraangftkfz.supabase.co
API Endpoint (Adult)xm35vp0qoh.execute-api.us-east-2.amazonaws.com
API Endpoint (Kids/Spark)ymf072zyfd.execute-api.us-east-2.amazonaws.com

Pages & Status

PageFileStatusNotes
Homepageindex.htmlDoneHero, showcase, tools, safety, footer. Links updated.
Parent Loginparent-login.htmlDoneSplit layout: video + login. Google OAuth working (PKCE).
Parent Dashboardparent-dashboard.htmlDonePlan, kids, usage, creations, quick actions.
Kid PIN Loginkid-pin.htmlDoneFullscreen video + arcade numpad + confetti. Redirects to kid-dashboard.
Kid Dashboardkid-dashboard.htmlDoneWelcome banner, usage bars, quick tools, recent creations. No pricing/admin.
Pricingpricing.htmlDone5 tiers with toggle monthly/yearly, feature comparison.
Make a Picturemake-a-picture.htmlDone3-panel layout. 6 real models (GPT Image 1, Gemini Imagen 3, Flux, Recraft, Ideogram, Nano Banana). Character Look picker (skin/hair/extras). Style chips. Ratio selector. Reference image upload โ€” when uploaded, routes to /api/edit-image (GPT image edit, identity-preserving). New: "Pick from My Creations" gallery picker โ€” select any previously generated image as reference without downloading. Completion sound. Auto-save to gallery. Lambda routes: /api/generate-image, /api/edit-image.
Edit a Pictureedit-a-picture.htmlDoneUpload or pick image from gallery โ†’ text prompt โ†’ GPT Image Edit (gpt-image-1) โ†’ inpainting/editing. Auto-save to gallery. Full kid auth + completion sound.
Make a Videomake-a-video.htmlDone3-panel layout, purple theme. Two modes: Text-to-Video (t2v) and Image-to-Video (i2v). T2V models: Hailuo-2, Seedance, Veo 3 Fast, Veo 3.1, Veo 3.1 Fast, Kling 3. I2V models: Hailuo-2, Kling 3, Luma Photon, Veo 3.1 โ€” all routed to /api/anchored-video for identity-locked animation (preserves person's face/appearance). I2V image picker has two tabs: My Creations (gallery) and Upload. Motion chips, duration selector, ratio selector, video loader overlay with ETA. Completion sound. Auto-save to gallery. Lambda routes: /api/kling-video (t2v), /api/anchored-video + /api/process-anchored-video (i2v).
๐Ÿ•บ Magic Movemotion-control.htmlDoneUpload character photo + dance video โ†’ Kling v2.6 Motion Control (Replicate). Presigned S3 upload for video (bypasses Lambda payload limit). Fast/Pro mode, Short/Long orientation, scene chips, keep-sound toggle. Full loader overlay. Auto-save to gallery. Lambda routes: /api/get-upload-url, /api/kling-motion, /api/process-kling-motion. S3 CORS policy added.
Edit a Pictureedit-a-picture.htmlDoneUpload or pick image from gallery โ†’ text prompt โ†’ GPT Image Edit (gpt-image-1) โ†’ inpainting/editing. Auto-save to gallery. Full kid auth + completion sound.
Make a Videomake-a-video.htmlDone3-panel layout, purple theme. Two modes: Text-to-Video (t2v) and Image-to-Video (i2v). T2V models: Hailuo-2, Seedance, Veo 3 Fast, Veo 3.1, Veo 3.1 Fast, Kling 3. I2V models: Hailuo-2, Kling 3, Luma Photon, Veo 3.1 โ€” all routed to /api/anchored-video for identity-locked animation (preserves person's face/appearance). I2V image picker has two tabs: My Creations (gallery) and Upload. Motion chips, duration selector, ratio selector, video loader overlay with ETA. Completion sound. Auto-save to gallery. Lambda routes: /api/kling-video (t2v), /api/anchored-video + /api/process-anchored-video (i2v).
๐Ÿ•บ Magic Movemotion-control.htmlDoneUpload character photo + dance video โ†’ Kling v2.6 Motion Control (Replicate). Presigned S3 upload for video (bypasses Lambda payload limit). Fast/Pro mode, Short/Long orientation, scene chips, keep-sound toggle. Full loader overlay. Auto-save to gallery. Lambda routes: /api/get-upload-url, /api/kling-motion, /api/process-kling-motion. S3 CORS policy added.
Make Soundsmake-sounds.htmlDone3 tabs: Voice (9 presets + custom ElevenLabs ID), SFX (9 quick picks), Music (9 genres). Completion sound effects per type.
Make It Talk (redirect)make-it-talk.htmlRedirectRedirects to make-sounds.html?tab=voice
Make Music (redirect)make-music.htmlRedirectRedirects to make-sounds.html?tab=music
My Creationsmy-creations.htmlDoneGallery with filter bar (images, videos, voices, music, books, movies), lightbox, flipbook reader for books, video player for movies, share-to-showcase.
Showcaseshowcase.htmlDonePublic gallery of shared creations. Nav links updated with Book Maker + Movie Maker.
Spark Studiospark-studio.htmlDisabledVisual node pipeline UI โ€” currently disabled/not linked from nav. API endpoints not fully connected.
Spark Labspark-lab.htmlDonePrompt builder with category suggestions. ๐Ÿ‘ค Character Builder panel (person, age, skin tone, hair, color, build, extras). Random prompt dice. Send-to-tool routing.
Spark Missionsspark-missions.htmlDoneGuided tutorials for kids. Nav links updated with Book Maker + Movie Maker.
Book Makerbook-maker.htmlDone8-page storybook wizard with full Character Builder (person/age/skin/hair/personality/extras), setting/adventure/ending/art-style โ†’ GPT-4o โ†’ per-page images โ†’ flipbook viewer โ†’ PDF export โ†’ Save to Gallery via /api/save-book. Completion sound.
Make a Gamemake-a-game.htmlDoneSpark Game Studio hub โ€” two-track selector: ๐Ÿ Python Curriculum (7-lesson path) and โšก Quick Build (AI-generated game). Links to game-quickbuild.html and game-curriculum.html (curriculum coming soon). Hero stats, game type cards, How It Works steps. Full sidebar + mobile menu.
Game Quick Buildgame-quickbuild.htmlDone4-step wizard with visual asset pickers: Step 2 shows 7 hero cards (Zara/Nova/Lyra/Blaze/Finn/Koa/Sparky) with real images from /game-assets/. Step 3 shows 7 world background cards. GPT-4o generates self-contained HTML5 canvas game with real assets loaded via new Image(). Keyboard forwarding from parent page into iframe via event dispatch + 50ms key-state sync + explicit R key handler. CORS fixed on both API gateways. Background scrolling + camera follow for platformer. Save + Publish buttons wired to POST /api/save-game.
My Gamesmy-games.htmlDonePersonal game gallery: filter by game type, game cards with type icon + date, fullscreen iframe play modal (fetches code from S3 via /api/get-game-code), publish/unpublish toggle, delete. Works for both parent and kid sessions. Embedded sidebar CSS.
Games Showcasegames-showcase.htmlDonePublic community gallery: hero with live stats (total games, unique creators), featured game card, search bar, game type filter chips, grid of all published games. Play modal with iframe. Calls GET /api/get-showcase-games. No auth required to browse.
Code Questgame-curriculum.htmlDone7-lesson Python curriculum with embedded Skulpt editor. Dashboard view (lesson map with XP bar, progress stats, node states: done/current/locked/ai-unlock). Lesson detail view (concept explanation, syntax-highlighted examples, live Python editor via Skulpt, challenge validator, hint button). Progress saved to Supabase code_quest_progress table. Confetti + XP on completion. Lessons 5โ€“6 link to Make a Picture / Make Sounds. Lesson 7 finale links to Make a Game.
Movie Makermovie-maker.htmlDoneStoryboard editor: 5 clip sources (My Videos, ๐Ÿ•บ Magic Move, My Images, upload, title cards), 4 transitions (cut/fade/slide-left/slide-right), background music, sound effects track with timestamps, preview player, Canvas+MediaRecorder export โ†’ auto-save to gallery via /api/save-movie. Completion sound. Nav updated with Edit a Picture + Magic Move sidebar links.
Lip Synclip-sync.htmlDisabled4 modes: Sing (character + song lyrics โ†’ TTS โ†’ lip sync), Talk (character + typed text โ†’ TTS โ†’ lip sync), Animate (upload face + audio โ†’ lip sync), Record (upload face + mic recording โ†’ lip sync). 7 character presets (robot, princess, alien, wizard, monster, fairy, dino) hosted at jorrii.io/character/. 3 Replicate models: SadTalker, Wav2Lip, LivePortrait. Auto-save to gallery, share to showcase. Uses /api/generate-lipsync (async) + /api/voice for TTS.
Disclosuresdisclosures.htmlTODOLegal disclosures page. Footer link added.
Admin Docsadmin.htmlDoneThis page โ€” now with live business dashboard.

Supabase Setup

Project Details

Important: Separate from Adult Jorrii

This is a separate Supabase project from the adult Jorrii site. They share the same AWS API backend but have independent auth systems and databases.

Database Schema

kids table

CREATE TABLE kids (
  id          UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  parent_id   UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
  name        TEXT NOT NULL,
  pin         TEXT NOT NULL,
  avatar      INTEGER DEFAULT 1,
  created_at  TIMESTAMPTZ DEFAULT now()
);

-- RLS Policies
"Parents see own kids"    โ†’ SELECT WHERE parent_id = auth.uid()
"Parents add own kids"    โ†’ INSERT WITH CHECK parent_id = auth.uid()
"Parents update own kids" โ†’ UPDATE WHERE parent_id = auth.uid()
"Parents delete own kids" โ†’ DELETE WHERE parent_id = auth.uid()
"Anyone can verify PIN"   โ†’ SELECT WHERE true (for kid login)

subscriptions table

CREATE TABLE subscriptions (
  id          UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  parent_id   UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
  plan        TEXT NOT NULL DEFAULT 'spark',
  status      TEXT NOT NULL DEFAULT 'active',
  billing     TEXT DEFAULT 'monthly',
  stripe_id   TEXT,
  created_at  TIMESTAMPTZ DEFAULT now(),
  expires_at  TIMESTAMPTZ
);

-- Plans: spark (free), glow, blaze, supernova, infinite
-- Status: active, cancelled, trialing, expired

usage_tracking table

CREATE TABLE usage_tracking (
  id          UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  parent_id   UUID NOT NULL REFERENCES auth.users(id),
  type        TEXT NOT NULL,  -- image, video, voice, sfx, music
  date        DATE NOT NULL DEFAULT CURRENT_DATE,
  count       INTEGER DEFAULT 0,
  UNIQUE(parent_id, type, date)
);

-- Helper functions:
-- check_usage(p_parent_id, p_type) โ†’ {allowed, remaining, limit}
-- increment_usage(p_parent_id, p_type) โ†’ increments daily count

gallery_items table (MIGRATED to DynamoDB)

-- Supabase gallery_items is NO LONGER USED for storage.
-- Gallery data is now in DynamoDB: spark-gallery
-- DynamoDB Key: userId (HASH) + createdAt (RANGE)
-- GSI: isPublic-createdAt-index (for Showcase)
-- S3 Bucket: jorrii-spark-creations (public read)
-- S3 Temp: jorrii-spark-jobs-output (1-day TTL)
-- Lambda: jorrii-spark-api (auto-saves on generation)
-- API endpoints: /api/gallery, /api/gallery/share, /api/showcase

-- Supabase tables STILL ACTIVE:
-- subscriptions, kids, usage_tracking (check_usage/increment_usage)
-- generation_log (logging only)

generation_log table

CREATE TABLE generation_log (
  id          UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  parent_id   UUID REFERENCES auth.users(id),
  kid_id      UUID REFERENCES kids(id),
  type        TEXT NOT NULL,
  model       TEXT,
  prompt      TEXT,
  status      TEXT DEFAULT 'completed',
  file_url    TEXT,
  created_at  TIMESTAMPTZ DEFAULT now()
);

plan_limits view

-- View that returns daily limits per plan per type
-- Used by check_usage() function
-- Plans: spark โ†’ glow โ†’ blaze โ†’ supernova โ†’ infinite
-- Types: image, video, voice, sfx, music

Authentication

Parent Auth (Supabase)

Parent visits parent-login.html โ†’ Google OAuth or Email โ†’ Supabase creates session โ†’ Redirect to dashboard

Resolved: OAuth Redirect Loop

Google OAuth redirect loop was caused by PKCE code exchange failing silently. Fixed by using flowType: 'pkce' in Supabase client config and ensuring correct redirect URIs in Google Cloud Console.

Status: โœ… Fixed and working.

Kid Auth (PIN-based)

Kid visits kid-pin.html โ†’ Enters 4-digit PIN โ†’ Supabase query: kids WHERE pin = ? โ†’ Match โ†’ sessionStorage + redirect

Kid sessions are stored in sessionStorage (not Supabase auth). This means kid sessions don't persist across tabs or browser restarts โ€” this is intentional for safety.

Supabase URL Configuration

SettingValue
Site URLhttps://jorrii.io
Redirect URLshttps://jorrii.io/parent-login.html
https://jorrii.io/parent-dashboard.html

Google OAuth Config

SettingValue
Google Cloud Projecttots2025
Authorized Redirect URIhttps://cwudeohugaraangftkfz.supabase.co/auth/v1/callback
Client ID & SecretStored in Supabase โ†’ Authentication โ†’ Providers โ†’ Google

API / Backend

Shared Backend

Jorrii Spark shares the same AWS backend as the adult Jorrii site:

Endpoints Used (Spark API โ€” ymf072zyfd)

EndpointMethodPurposePayload
๐ŸŽจ Images (async โ€” poll /api/check-job)
/api/generate-imagePOSTGPT Image 1 generation (async โ€” poll /api/check-job){prompt, size, quality, count, model}
/api/edit-imagePOSTGPT Image 1 edit โ€” preserves identity/appearance from reference photo. Used by make-a-picture when a reference image is uploaded. Synchronous โ€” returns output URL directly, no polling needed.{image (base64), imageType, prompt, size}
/api/nano-bananaPOSTGemini Image generation{prompt}
/api/flux-schnellPOSTFlux Schnell (Replicate){prompt}
/api/sd35POSTStable Diffusion 3.5 Large{prompt}
/api/recraftPOSTRecraft v3{prompt}
๐ŸŽฌ Videos (async โ€” poll /api/check-job)
/api/text-to-videoPOSTWan 2.1 video (Replicate){prompt, aspect_ratio}
/api/kling-videoPOSTKling / Hailuo / Veo / Luma text-to-video (Replicate){prompt, aspect_ratio, duration, model, start_image?}
/api/anchored-videoPOSTIdentity-locked image-to-video โ€” animates uploaded photo without changing the person's appearance. Supports hailuo-2, kling-3, luma-photon, veo-3.1, seedance.{prompt, image (base64), imageType, model, duration?, aspect_ratio?}
/api/process-anchored-videoPOSTInternal async processor for anchored-video (self-invoked by Lambda){jobId, prompt, imageUrl, model, duration, aspect_ratio, parentId, kidId, kidName}
๐Ÿ”Š Audio
/api/voicePOSTTTS via OpenAI (synchronous){text, voice}
/api/elevenlabs-sfxPOSTSound effects via ElevenLabs (synchronous){text, duration_seconds}
/api/musicPOSTMusic via MusicGen (async โ€” poll){prompt, duration}
/api/audiobookPOSTNarration via Kokoro TTS (async){text, voice, speed}
๐Ÿ“š Books
/api/save-gamePOSTSaves completed game HTML to S3 (jorrii-jobs-output) and writes gallery entry (type=game) to DynamoDB. Supports published flag for showcase. Registered on xm35vp0qoh.
/api/get-gamesGETFetches user's saved games from gallery table filtered by type=game. Supports ?userId and ?kidId params. Returns array without gameCode (code fetched separately).
/api/get-game-codePOSTFetches full HTML game code from S3 for a specific game (by userId + createdAt). Used by play modal in My Games and Games Showcase.
/api/get-showcase-gamesGETReturns all published games (type=game, isPublic=true) via GSI. Public endpoint โ€” no auth required. Used by games-showcase.html.
/api/generate-gamePOSTStarts async game generation job via GPT-4o. Returns jobId. Registered on xm35vp0qoh (jorrii-api Lambda). Supports: platformer, catch, quiz, maze. Game types injected into tailored prompts.
/api/generate-storyPOSTGenerate 8-page storybook (async){character, setting, adventure, ending, artStyle}
/api/save-bookPOSTSave complete book to gallery (async){bookData (JSON string of title + pages)}
๐ŸŽž๏ธ Movies
/api/save-moviePOSTSave exported movie to gallery (async){data (base64 video), title}
๐Ÿ‘„ Lip Sync
/api/generate-lipsyncPOSTLip sync video generation (async โ€” poll /api/check-job). Supports 3 Replicate models: SadTalker (a519cc0c), Wav2Lip (8d65e3f4), LivePortrait (067dd98c). Face input via character name โ†’ jorrii.io/character/{name}.png or user-uploaded image โ†’ S3 temp. Audio input via audioUrl or base64 audioData โ†’ S3 temp.{character|faceImage, audioUrl|audioData, model, mode}
๐Ÿ–ผ๏ธ Gallery & Showcase
/api/galleryPOSTList: {_action:"list"} ยท Delete: {_action:"delete", createdAt}+ X-Parent-Id header
/api/gallery/sharePOSTToggle public sharing on gallery item{createdAt (Number), isPublic (bool)}
/api/showcaseGETPublic gallery (GSI: isPublic-createdAt-index)?limit=50&type=image
/api/check-jobPOSTPoll async job status{jobId}
/api/healthPOSTHealth check โ€” returns API key statusโ€”

Async Generation Flow (Images, Videos, Music, Books, Save-Book, Save-Movie)

1. POST to endpoint (e.g. /api/generate-image, /api/text-to-video, /api/save-book) โ†’ returns {jobId, status:"processing"}
2. Poll /api/check-job every 3 seconds โ†’ returns {jobId, status, output} when done
3. output contains base64 data URI or file URL
4. Lambda auto-saves to DynamoDB spark-gallery + S3 jorrii-spark-creations
5. Auth via X-Parent-Id + optional X-Kid-Id / X-Kid-Name headers

Synchronous Endpoints (Voice, SFX)

/api/voice and /api/elevenlabs-sfx return immediately with {output: "data:audio/mpeg;base64,..."}. No polling needed. Lambda auto-saves to gallery.

Error Codes (Kid-Friendly via sanitizeError)

E101 โ€” Quota exhausted ยท E102 โ€” Rate limited ยท E103 โ€” Billing/model unavailable
E202 โ€” API key not configured ยท E301 โ€” Model not found ยท E302 โ€” Timeout
E303 โ€” No output returned ยท E401 โ€” Safety filter blocked prompt
E402 โ€” Invalid request ยท E500 โ€” Unknown error (includes actual error message for debugging)

Book Maker Story Generation Flow

1. POST to /api/generate-story with character, setting, adventure, ending, artStyle
2. Lambda doGenerateStory() calls GPT-4o with system prompt โ†’ returns 8-page JSON
3. Each page has text (1-2 sentences, max 25 words) and imagePrompt
4. Image prompts begin with consistent character description for visual continuity
5. Frontend then generates images for each page via /api/generate-image
6. Uses string concatenation (not template literals) to avoid Lambda escaping issues

Design System

Colors

NameHexUsage
Spark Teal#44D5DCPrimary accent, glow lines, CTAs
Spark Purple#A78BFASecondary accent, kid pin, sidebar
Deep Purple#7C3AEDButtons, headings, links
Spark Pink#F9A8D4Music, accents
Spark Orange#FDBA74Sounds, warnings
Spark Blue#7DD3FCStudio, info

Typography

FontWeightUsage
Fredoka500-700All headings, buttons, labels, nav
Quicksand400-600Body text, descriptions, inputs

Shared CSS

All pages (except kid-pin.html and parent-login.html) import spark-styles.css which contains the top nav, sidebar, footer, and base styles. Always cache-bust with ?v=N.

Key Sizing

ElementSize
Nav height72px
Sidebar width180px
Nav logo56px height
Sidebar icons38px
Tool card icons80% width, max 140px
Safety/Parent card icons70% width, max 120px
How It Works circles140px

Icon Assets

All custom icons are in the images/ folder. Created in Photoshop at 792ร—792px (11ร—11 inches at 72ppi).

Sidebar Icons

FileLabelFallback Emoji
picture1.pngMake a Picture๐ŸŽจ
video1.pngMake a Video๐ŸŽฌ
music1.pngMake Music๐ŸŽต
sound1.pngMake Sounds๐Ÿ”Š
studio1.pngSpark Studioโšก
creation1.pngMy Creations๐Ÿ–ผ๏ธ

Section Icons

FileSection
picture.pngTool cards โ€” Make a Picture
video.pngTool cards โ€” Make a Video
music.pngTool cards โ€” Make Music
sound.pngTool cards โ€” Make Sounds
sparkstudio.pngTool cards โ€” Spark Studio
think.pngHow It Works โ€” Step 1
makeit.pngHow It Works โ€” Step 2
sparkit.pngHow It Works โ€” Step 3
kidsafe.pngSafety โ€” Kid Safe
prompts.pngSafety โ€” Smart Prompts
content.pngSafety โ€” Content Filters
notsocial.pngSafety โ€” Not Social
learn.pngParents โ€” Learn
classroom.pngParents โ€” Classroom
parent.pngParents โ€” Controls
positive.pngParents โ€” Positive
signin1.pngSign In button icon
pin1.pngKid PIN button icon

Videos

FilePageFormat
videos/roller.mp4Homepage banner16:9
videos/login.mp4Parent login (left side)16:9
videos/kidvideo.mp4Kid PIN login (fullscreen bg)16:9

Top Navigation

White background with glass blur, teal glow line on bottom. Contains: logo + tagline, nav links (Home, Safety/Parents, Pricing), Sign In button, Kid Pin button, hamburger for mobile.

Nav text: "Spark your creativity" (not "Jorrii Spark")

Left Sidebar

Blue-to-purple gradient (#4A8FE7 โ†’ #C27DEB) with teal glow line on right edge. Dark teal text (#0D3B4A). Contains tool links grouped into Create / Build / Learn / Library sections.

Sidebar Links

SectionLinks
CreateMake a Picture, Make a Video, Make Music, Make Sounds
BuildSpark Studio, ๐Ÿ“š Book Maker, ๐ŸŽž๏ธ Movie Maker, Spark Lab
LearnSpark Missions
LibraryMy Creations, Showcase

Present on: index.html, kid-dashboard.html, all create tool pages, book-maker.html, movie-maker.html, my-creations.html, showcase.html, spark-lab.html, spark-missions.html

Absent on: parent-login.html, kid-pin.html (immersive layouts)

Responsive Breakpoints

BreakpointBehavior
900pxDashboard grid โ†’ single column
768pxSidebar hidden, hamburger menu appears, content full-width
600pxTool cards: 5 โ†’ 3 โ†’ 2 columns
480pxCompact spacing, smaller fonts

Auth Flows

Parent Google Sign-In

  1. Parent clicks "Continue with Google" on parent-login.html
  2. Redirects to Google consent screen
  3. Google sends back to https://cwudeohugaraangftkfz.supabase.co/auth/v1/callback
  4. Supabase exchanges code and redirects to https://jorrii.io/parent-login.html
  5. Page detects session โ†’ redirects to parent-dashboard.html

Parent Email Sign-In

  1. Parent clicks "Continue with Email"
  2. Enters email + password
  3. Calls sb.auth.signInWithPassword()
  4. On success โ†’ redirect to dashboard

Kid PIN Login

  1. Kid visits kid-pin.html
  2. Taps 4-digit PIN on arcade numpad
  3. Queries kids table: WHERE pin = ?
  4. Match โ†’ confetti + welcome screen โ†’ sessionStorage โ†’ redirect to homepage
  5. No match โ†’ shake animation + "try again"

Kid PIN System

How It Works

PIN Collision Risk

With 4-digit PINs (10,000 possible values), collisions become likely around 100+ kids. Future improvement: scope PINs per parent account, or increase to 5-6 digits.

Pricing Plans

TierPriceYearlyKidsImg/dayVid/dayVoice/dayMusic/daySaves
โœจ SparkFreeโ€”1403010
๐ŸŒŸ Glow$7.99$5.59215210250
๐Ÿ”ฅ Blaze$12.99$9.093405255200
๐Ÿš€ Supernova$29.99$20.99580155015500
๐ŸŒŒ Infinite$99$69.30โˆž1005010050โˆž

30% yearly discount on all paid plans. Model access increases with tier (free = Nano Banana only, top tiers = all models).

Model Access by Tier

TierImage ModelsVideo Models
SparkNano Banana onlyNone
Glow+ Imagen Fast, GPT MiniWan
Blaze+ GPT Image, Imagen Ultra+ Veo 3
SupernovaAll modelsAll models
InfiniteAll modelsAll models

Usage Tracking

Current State

Usage tracking is live. The check_usage() and increment_usage() Supabase functions enforce daily limits per plan. All create pages call these before and after generation. The kid dashboard and tool pages display remaining counts.

How It Works

AI Models

Image Generation

Model KeyProviderMin TierNotes
gpt-image-1OpenAISparkBest quality, 4 tokens per generation
gpt-image-miniOpenAISparkFast creative results, 1 token
imagen-3GoogleGlowHigh quality generation
flux-1Black Forest LabsGlowFast artistic generation
recraft-v3RecraftBlazeDesign-focused, sharp outputs
ideogram-v2IdeogramBlazeGreat with text in images

Video Generation

Model KeyProviderMin TierNotes
veo-2GoogleGlowGreat quality and motion
veo-3GoogleBlazeCinematic quality with audio
kling-1.6Kling AIGlowFast, smooth motion
kling-2.0Kling AIBlazeHigh quality, precise camera
minimax-videoMiniMax/HailuoSupernovaCreative and expressive
runway-gen3RunwaySupernovaIndustry standard

Audio Generation

Model KeyProviderTypeTab
elevenlabs-v2ElevenLabsText-to-speechVoice
elevenlabs-v3ElevenLabsText-to-speechVoice
openai-ttsOpenAIText-to-speechVoice
google-ttsGoogleText-to-speechVoice
elevenlabs-sfxElevenLabsSound effectsSFX
audiogenAudioGenSound effectsSFX
stable-audioStability AISound effectsSFX
sunoSunoMusic generationMusic
udioUdioMusic generationMusic
musicgenMetaMusic generationMusic
stable-audio-musicStability AIMusic generationMusic

๐Ÿ”Š Completion Sound Effects

Overview

Every generation page plays a sound effect when creation completes or fails. Sound files are hosted in a sounds/ folder on Hostinger. Uses simple new Audio('sounds/file.mp3').play() wrapped in try/catch.

PageSuccess SoundError Sound
Make a Picturesounds/picturedone.mp3sounds/error.mp3
Make a Videosounds/videodone.mp3sounds/error.mp3
Make Sounds (voice/sfx)sounds/voicesfxdone.mp3sounds/error.mp3
Make Sounds (music)sounds/musicdone.mp3sounds/error.mp3
Book Makersounds/bookdone.mp3โ€”
Movie Makersounds/moviedone.mp3sounds/error.mp3
Spark Studiosounds/picturedone.mp3sounds/error.mp3

How to Generate Sounds

Use ElevenLabs Sound Effects to generate each file. Keep them 2-3 seconds long. Upload to /sounds/ directory on Hostinger. Files are loaded on-demand (no preloading).

๐Ÿ‘ค Character Builder

Overview

Visual character description builder that lets kids see themselves in their creations. Uses physical feature descriptions (skin tone, hair style/color) instead of race/ethnicity labels โ€” this works with AI image generators without triggering safety filters. Appears in three places: Make a Picture (toggle panel), Spark Lab (collapsible section), and Book Maker (Step 1 wizard replacement).

CategoryOptions
PersonGirl, Boy, Woman, Man, Baby, Child (+ Cat, Dog, Dragon, Robot in Book Maker)
AgeToddler, Kid (6-10), Tween, Teen, Young adult, Adult, Elderly
Skin Tone7 color swatches: #FDEBD0, #F5CBA7, #D4A574, #C68642, #A0522D, #6B3A2A, #3B2219
Hair StyleShort, Long, Curly, Afro, Braids, Locs, Ponytail, Twists, Bun, Mohawk, Pigtails, Bald
Hair ColorBlack, Brown, Blonde, Red, Gray, White, Purple, Blue, Pink
BuildSlim, Average, Athletic, Curvy, Stocky, Tall, Short (Make a Picture + Spark Lab only)
PersonalityBrave, Shy, Silly, Smart, Kind, Curious, Magical, Adventurous (Book Maker only)
ExtrasGlasses, Freckles, Beard, Mustache, Dimples, Scar, Braces, Tattoos, Headband, Cape, Crown, Wings

Implementation per Page

๐Ÿงช Spark Lab

Overview

Advanced prompt building workspace. Category-based suggestion chips for images, videos, voice, SFX, and music. Character Builder panel. Random prompt dice. "Send to" buttons route completed prompts to any generation tool.

FeatureDetails
Suggestion CategoriesImages: Subject, Setting, Style, Mood. Videos: Scene, Motion, Atmosphere. Voice: Lines, Emotions. SFX: Action, Nature, Fun. Music: Genre, Instruments, Mood.
Character BuilderCollapsible ๐Ÿ‘ค panel with person/age/skin/hair/color/build/extras. Live preview. "โž• Add to Prompt" button.
Random Prompts๐ŸŽฒ Random Prompt (category-appropriate) and โœจ Surprise Me (fully random)
Send ToRoutes prompt text to Make a Picture, Make a Video, Make Music, Make Voices, Book Maker via sessionStorage

โšก Spark Studio

Overview

Visual node-based creative pipeline. Kids connect nodes (text prompts, image generators, video generators, voice/SFX, file uploads) with wires and run the pipeline. Executes in topological order, passing outputs through connections.

FeatureDetails
Node TypesText Prompt, Generate Image (5 models), Generate Video (2 models), Generate Voice (4 presets), Generate SFX, Upload File, Preview
ExecutionTopological sort of connected nodes โ†’ sequential API calls โ†’ poll jobs โ†’ pass outputs through wires
Model MapsImage: Quick Sketchโ†’flux-schnell, Speed Paintโ†’nano-banana, Color Burstโ†’sd35, Super Artโ†’generate-image, Ultra Dreamโ†’recraft. Video: Dream Motionโ†’text-to-video, Mega Movieโ†’kling-video
File UploadReads file as base64 via FileReader, stores in fileInput._base64, passes to connected nodes
Completion soundsounds/picturedone.mp3 on success, sounds/error.mp3 on failure

๐Ÿ“š Book Maker

Overview

8-page illustrated storybook generator. Kids build a character with the Character Builder (person, age, skin tone, hair, personality, extras) or type a custom description, then pick setting, adventure type, ending, and art style โ†’ GPT-4o writes the story โ†’ images are generated for each page โ†’ interactive book viewer with PDF export โ†’ Save to My Creations gallery.

User Flow

Tier Check โ†’ Character Builder โ†’ GPT-4o Story โ†’ Image Gen (8 pages) โ†’ Book Viewer โ†’ PDF / Save to Gallery

Wizard Steps

StepInputOptions
1. CharacterCharacter Builder OR custom textBuilder: Person (Girl/Boy/Woman/Man/Baby/Cat/Dog/Dragon/Robot), Age (Toddlerโ†’Elderly), Skin Tone (7 swatches), Hair Style (11 types), Hair Color (8 colors), Personality (Brave/Shy/Silly/Smart/Kind/Curious/Magical/Adventurous), Extras (Glasses/Freckles/Cape/Crown/Wings/Scar/Braces/Headband). Live preview builds description. Or type custom.
2. SettingPreset cardsEnchanted Forest, Outer Space, Underwater Kingdom, Candy Land, Dinosaur Island, Magical Castle
3. AdventurePreset cardsRescue mission, Treasure hunt, Making friends, Solving a mystery, Learning a lesson, Big competition
4. EndingPreset cardsHappy celebration, Funny surprise, Heartwarming lesson, Cliffhanger, Magical transformation
5. Art StylePreset cardsPixar 3D, Watercolor, Storybook illustration, Comic book, Japanese anime, Claymation

Backend: doGenerateStory()

DetailValue
Lambda routePOST /api/generate-story
AI ModelGPT-4o (gpt-4o)
Response formatJSON: {title, characterDescription, pages: [{text, imagePrompt}]}
Text rules1-2 sentences per page, max 25 words, age 6-8 reading level
Image promptsStart with consistent character description for visual continuity
Escaping noteUses string concatenation (not template literals) to avoid Lambda escaping issues

Tier Gating

PlanBooks/Month
Spark / Glow / BlazeโŒ Not available
Supernova5 books
Infinite10 books

Key Files

FilePurpose
book-maker.htmlFrontend โ€” character builder, wizard, viewer, PDF export, save to gallery
index.mjs (Lambda)Backend โ€” doGenerateStory(), doSaveBook(), /api/generate-story + /api/save-book routes

๐ŸŽž๏ธ Movie Maker

Overview

Storyboard-style video editor. Kids drag and drop clips onto a timeline, add images as still clips, insert title cards, pick from 4 transitions, add sound effects at specific timestamps, pick background music, then export as a single video. Exported movies auto-save to gallery via /api/save-movie. Zero server cost for editing โ€” all processing happens in the browser via Canvas API + MediaRecorder.

User Flow

Add Clips โ†’ Drag to Reorder โ†’ Set Transitions โ†’ Add Music + SFX โ†’ Preview โ†’ Export + Save

Clip Sources

SourceHowDetails
๐ŸŽฌ My VideosGallery APIFetches video items from /api/gallery with auth. Shows thumbnail grid.
๐Ÿ–ผ๏ธ My ImagesGallery APIFetches image items from gallery. Set duration (2-5s). Renders as full-frame still during export.
๐Ÿ“ UploadFile inputMP4, WebM, MOV. Max 50MB. Creates blob URL.
๐ŸŽฌ Title CardBuilt-in creatorCustom text + 8 gradient/solid backgrounds. Duration: 2-5 seconds.

Features

FeatureImplementation
Drag & drop reorderHTML5 Drag API on clip cards
Transitions (4 types)Click indicator โ†’ popup menu: โœ‚๏ธ Cut, ๐ŸŒŠ Fade, โฌ…๏ธ Slide Left, โžก๏ธ Slide Right
Background musicFrom gallery (audio items) or file upload. Mixed via Web Audio API.
Sound effects trackAdd SFX from gallery or upload. Set timestamp for each. Rendered as setTimeout() during export.
Image clipsGallery images rendered via drawImage() with cover-fit for clip duration
PreviewSequential clip playback in built-in video player. Title/image clips rendered to canvas overlay.
Exportcanvas.captureStream(30) โ†’ MediaRecorder (VP9) โ†’ download as .webm
Auto-save to galleryAfter export, base64 video sent to /api/save-movie โ†’ S3 + DynamoDB
Completion soundsounds/moviedone.mp3 plays on successful export

Technical Architecture

Mostly Client-Side

Tier Gating

PlanAccess
Spark (free)โŒ Not available
Glow and aboveโœ… Full access (no API cost since it's browser-based)

Hosting

Hostinger Setup

Deployment

How to Update

  1. Delete old file from Hostinger
  2. Upload new file
  3. Hard refresh browser: Ctrl + Shift + R
  4. If CSS not updating, bump the version: spark-styles.css?v=4

Cache Busting

Browser caches files aggressively. Always bump the ?v=N parameter on spark-styles.css after making CSS changes. Current version: ?v=2

Troubleshooting

Common Issues

CSS not updating after upload

Fix: Bump ?v=N on the CSS link in HTML, or Ctrl+Shift+R to hard refresh.

Google OAuth redirect loop (RESOLVED)

Status: Fixed. Root cause was PKCE code exchange failure. Fixed by using flowType: 'pkce' in Supabase client config and ensuring correct redirect URIs.

Images show different sizes despite same canvas

Fix: CSS now uses percentage-based sizing (width: 80%) with object-fit: contain. Ensure artwork fills 90%+ of the PNG canvas in Photoshop.

Lambda template literal escaping (RESOLVED)

Issue: Patch script using cat << 'FUNC' in CloudShell mangled backtick template literals inside the doGenerateStory() function, causing SyntaxError: Invalid or unexpected token at deployment.

Fix: Rebuilt function using string concatenation ('string ' + 'string') instead of template literals. Deployed by pasting complete index.mjs directly in Lambda console editor.

Lesson: Never use backtick template literals in Lambda code deployed via shell heredocs. Use string concatenation or deploy via .zip upload instead.

PNGs show black background

Fix: Re-export from Photoshop as PNG with transparency checkbox enabled. Verify checkerboard pattern is visible behind artwork before saving.

Changelog

2026-03-14
๐ŸŽฎ Game Quick Build โ€” Visual Asset Pickers + Bug Fixes โ€” Step 2 (Hero) replaced text input with 7 clickable hero cards showing real Pixar-style character images from jorrii.io/game-assets/ (Zara, Nova, Lyra, Blaze, Finn, Koa, Sparky). Step 3 (World) replaced text input with 7 world background thumbnail cards (Candy Kingdom, Outer Space, Jungle, Floating Islands, Underwater City, Haunted Forest, Volcanic Island). Asset library created: 25+ game assets uploaded to jorrii.io/game-assets/ including heroes, enemies (ghost, monster, red robot, bomb), collectibles (coin, star, jewel, heart, treasure), backgrounds, platform, door, shield. Lambda prompt updated: GPT now loads real images via new Image() + crossOrigin, draws background as scrolling tiled pattern, camera follows hero via ctx.translate(-cameraX, 0), HUD drawn after ctx.restore(). R/r/KeyR restart check added. CORS fixed on both API gateways (xm35vp0qoh and ymf072zyfd) via update-api --cors-configuration AllowOrigins=*. Keyboard forwarding: parent page intercepts all keydown/keyup, dispatches to both contentWindow and contentWindow.document, syncs keys object every 50ms via interval, explicit R key handler. save-game route deployed to jorrii-api + registered on xm35vp0qoh.
2026-03-14
โŒจ๏ธ Code Quest (game-curriculum.html) โ€” COMPLETED โ€” Full 7-lesson Python curriculum with two JS views on one page. Dashboard view: XP progress bar, stats (lessons done / XP earned), 7-node lesson path with visual states (done=green โœ“, current=glowing blue pulse, locked=faded, AI unlock=gold). Lesson detail view: concept card with syntax-highlighted Python examples, "Copy to Editor" button, live Skulpt Python editor (runs real Python in browser, tab-key indentation supported), challenge card with requirements list + hint button + output validator, confetti + XP reward on completion, progress auto-saved to Supabase code_quest_progress table. 7 lessons: (1) Variables/print โ€” name your hero, (2) If/else โ€” boss battle, (3) Loops โ€” score multiplier, (4) Functions โ€” AI tools unlock ๐Ÿค–, (5) AI Images โ€” links to Make a Picture, (6) AI Sounds โ€” links to Make Sounds, (7) Ship It โ€” fill game config โ†’ "Build My Game!" โ†’ make-a-game.html. Supabase table created: code_quest_progress (user_id, lesson_id, completed, xp, completed_at, unique constraint). Spark Game Studio feature set 100% complete.
2026-03-14
๐Ÿ•น๏ธ My Games + ๐Ÿ† Games Showcase โ€” COMPLETED โ€” my-games.html: Personal game gallery with filter bar (All/Platformer/Catch/Quiz/Maze), game cards showing type icon + title + date + kid name, hover-reveal play button, fullscreen iframe play modal that fetches game HTML from S3 via POST /api/get-game-code, publish/unpublish toggle, delete, empty state. Works for both parent and kid sessions. games-showcase.html: Public community gallery โ€” hero section with live stats (total games published, unique creators), featured game spotlight card with creator avatar, search bar, game type filter chips, grid of all published games, play modal. No login required to browse. Calls GET /api/get-showcase-games. 3 new Lambda routes deployed on jorrii-api (xm35vp0qoh): GET /api/get-games (user's saved games), POST /api/get-game-code (fetch game HTML from S3), GET /api/get-showcase-games (all published games via GSI). Nav updated: Games Showcase added to sidebar + mobile menu on all pages. Code Quest rename (was Game Curriculum) applied site-wide under Learn section. Spark Game Studio feature set now complete โ€” only game-curriculum.html (Python lessons) remains for a future session.
2026-03-14
๐ŸŽฎ Spark Game Studio โ€” NEW FEATURE (IN PROGRESS) โ€” Full game creation system with two tracks. Hub page (make-a-game.html): track selector with Python Curriculum card (lesson preview, AI unlock at lesson 4) and Quick Build card. Game type grid (Platformer, Catch, Quiz, Maze). How It Works 4-step flow. Quick Build page (game-quickbuild.html): 4-step wizard (game type โ†’ hero โ†’ world โ†’ review/generate) with suggestion chips on every field, animated step indicator, 45s generating overlay with live status steps, game rendered in sandboxed iframe, Save + Publish buttons. Lambda route POST /api/generate-game added to jorrii-api (xm35vp0qoh). Uses GPT-4o with 4 tailored prompts per game type. Returns raw HTML5 canvas game string saved to S3 via saveJob. Fixes applied: checkJob now reads jobId from both body and query string params (event.queryStringParameters); frontend polls via POST with JSON body; output is plain string not nested object. Sidebar updated on all 14 pages: ๐ŸŽฎ Make a Game (Build section, after Movie Maker) and ๐Ÿ•น๏ธ My Games (Library section, after My Creations). Still TODO: my-games.html, games-showcase.html, game-curriculum.html.
2026-03-12
๐Ÿงญ Site-Wide Nav Overhaul โ€” Removed "Parents" link from top navigation on all 12 app pages (kids shouldn't see that). Added โœ๏ธ Edit a Picture and ๐Ÿ•บ Magic Move to the sidebar and mobile menu across every page. Sidebar now has 14 links in correct order: Dashboard (hidden) โ†’ Make a Picture โ†’ Edit a Picture โ†’ Make a Video โ†’ Magic Move โ†’ Make Sounds โ†’ Spark Lab โ†’ Book Maker โ†’ Movie Maker โ†’ Spark Missions โ†’ My Creations โ†’ Showcase.
2026-03-12
โš ๏ธ Pages Disabled / Removed from Nav โ€” Lip Sync (lip-sync.html) removed from all sidebar and mobile menus โ€” page exists but is not linked. Spark Studio (spark-studio.html) removed from nav โ€” UI-only, API endpoints not connected. Both marked as Disabled in this admin doc.
2026-03-09
๐ŸŽฌ Video Generator โ€” Self-Invoke Pattern + New Models โ€” Videos now use the same self-invoke architecture as images to bypass API Gateway 29s timeout. doReplicateVideo() fires a background Lambda (/api/process-video) and returns jobId instantly. Kling AI removed (no longer on Replicate). New models: Hailuo-02 (Minimax, default), Seedance-1-lite (ByteDance), Google Veo 3 Fast. Frontend model selector updated. All await (async()=>{})() IIFEs replaced with non-awaited fire-and-forget throughout Lambda.
2026-03-09
๐Ÿ–ผ๏ธ Image Generator โ€” Self-Invoke Restored โ€” doGenerateImage() self-invoke pattern was missing from Lambda after a CloudShell session reset. Re-added LambdaClient, InvokeCommand, /api/process-image route, and doProcessImage() background worker. Images now generate reliably without 503 errors.
2026-03-09
๐ŸŽต Music Generator โ€” Fixed Endpoint + Fire-and-Forget โ€” MusicGen model path (meta/musicgen) no longer exists on Replicate. Switched to versioned endpoint using hash 671ac645.... Removed await from music IIFE so Lambda returns jobId instantly instead of timing out after 29s.
2026-03-09
๐Ÿ”Š Voice + Poll Fixes โ€” Fixed voice endpoint mismatch: frontend was calling /api/elevenlabs-voice (doesn't exist) โ†’ corrected to /api/voice. ElevenLabs voice_id now supported with OpenAI TTS fallback. All poll functions updated to accept status === 'succeeded' (Lambda returns succeeded, not completed). Fixed nested output parsing: result.output.output โ†’ URL unwrap across image, video, and sound pages.
2026-03-09
๐Ÿ”’ Lambda Version Saved โ€” Published Lambda version tagged as alias stable-mar9 with description: "Working: images, video (hailuo/seedance/veo3), music, voice, sfx โ€” Mar 9 2026". Can roll back to this version if future deployments break things.
2026-03-08
๐Ÿ’ณ Stripe Live Payments โ€” Switched from test to live mode. Updated Lambda env vars: STRIPE_SECRET_KEY โ†’ sk_live_.... Updated pricing.html with live publishable key pk_live_.... Webhook whsec_... confirmed live on "Jorrii Spark Checkout" endpoint. Payment system is now fully live.
2026-03-08
๐Ÿ“š Book Maker โ€” Auto-Save + My Books Gallery โ€” Books now auto-save to gallery after generation completes (no manual save needed). Save flow: story โ†’ images โ†’ /api/save-book โ†’ poll until succeeded โ†’ refresh My Books section. Cover image (page 1 illustration) stored in metadata and displayed on book card. loadMyBooks() called automatically after save.
2026-03-08
๐ŸŽจ Book Maker โ€” Image Consistency Fix โ€” Story AI now returns a characterDescription field with precise visual details (age, hair, eyes, skin tone, clothing). This description is prepended to every page image prompt so the character looks consistent across all 8 illustrations. Art style also appended to every prompt. Lambda doGenerateStory() system prompt updated to include character bible in JSON response.
2026-03-08
๐Ÿ–ผ๏ธ Image Generation โ€” Fixed Fire-and-Forget Bug (CRITICAL) โ€” Lambda was killing async image jobs before completion due to API Gateway's 29-second timeout. Fixed using Lambda self-invoke pattern: /api/generate-image now creates a job, fires a background Lambda invocation (InvocationType: Event) to /api/process-image, and immediately returns jobId. Background worker runs up to 15 min without timeout. IAM policy lambda-self-invoke added to jorrii-spark-lambda-role. LambdaClient + InvokeCommand imported from @aws-sdk/client-lambda.
2026-03-08
๐Ÿ–ผ๏ธ Image Generation โ€” Quality Fix โ€” gpt-image-1 API was receiving quality: 'standard' which is not a valid value. Fixed default to quality: 'high'. Valid values are: low, medium, high, auto. Book Maker image requests now use quality: 'medium' for speed.
2026-03-08
๐Ÿ“š Book Maker โ€” Endpoint Fix โ€” generatePageImage() was calling non-existent /api/flux-schnell. Switched to /api/generate-image. Fixed output parsing: Lambda returns { output: { output: "url" } } (nested), now correctly unwrapped as data.output?.output || data.output. Poll timeout increased to 60 attempts ร— 3s = 3 min per image.
2026-03-08
๐Ÿ—„๏ธ Lambda Save-Book Metadata โ€” doSaveBook() now saves coverImage in metadata alongside pageCount. Cover image = book.coverImage or fallback to book.pages[0].imageUrl. Enables book card thumbnails in My Books gallery.
2026-03-08
๐Ÿ”„ Lambda Restoration โ€” A parallel thread overwrote jorrii-spark-api, breaking: family-code lookup, book-maker, showcase, and gallery. Restored by downloading current Lambda zip, re-injecting doFamilyCode() with AWS SDK v3 (ScanCommand, GetItemCommand, PutItemCommand), fixing body is not defined error, and redeploying. All affected routes confirmed working post-restore.
2026-03-08
๐Ÿ” DynamoDB Family Code Migration โ€” Moved family code storage from Supabase (schema cache issues) to DynamoDB spark-families table. Lambda doFamilyCode() handles: GET (scan by parent_id, auto-generate if missing), VERIFY (lookup by code). IAM policy spark-families-dynamodb added to Lambda role. Working test code: SPARK-DGAG โ†’ parent_id: 807d1132-99f1-48df-b92d-df8609d2b9fd.
2026-03-08
๐Ÿ“‹ Admin Docs Updated (March 8) โ€” Added new changelog entries for all March 8 work. Updated TODO table: Stripe live payments โœ…, image generation fixed โœ…, book maker auto-save โœ…, book endpoint fix โœ…. Updated last updated date.
2026-03-08
๐Ÿ’ณ Stripe Live Payments โ€” Switched from test to live mode. Lambda env vars updated with sk_live_.... pricing.html updated with pk_live_.... Live webhook "Jorrii Spark Checkout" confirmed active. Payments are now live.
2026-03-08
๐Ÿ–ผ๏ธ Image Generation โ€” Lambda Self-Invoke Fix (CRITICAL) โ€” API Gateway 29s timeout was killing async image jobs. Fixed with Lambda self-invoke: /api/generate-image fires background worker via InvokeCommand (InvocationType: Event) to /api/process-image, returns jobId instantly. IAM policy lambda-self-invoke added to Lambda role. Images now generate reliably in background.
2026-03-08
๐Ÿ–ผ๏ธ Image Quality Fix โ€” gpt-image-1 was receiving invalid quality: 'standard'. Fixed default to quality: 'high'. Book Maker uses quality: 'medium'. Valid values: low, medium, high, auto.
2026-03-08
๐Ÿ“š Book Maker โ€” Auto-Save + My Books Gallery โ€” Books now auto-save after generation. Flow: story โ†’ images โ†’ /api/save-book โ†’ poll โ†’ refresh My Books. Cover image (page 1) saved in DynamoDB metadata. Book cards show cover art thumbnail. loadMyBooks() auto-refreshes after save.
2026-03-08
๐ŸŽจ Book Maker โ€” Image Consistency โ€” Lambda doGenerateStory() now returns characterDescription field with precise visual details. Prepended to every page image prompt so character looks the same across all 8 pages. Art style also appended to every prompt.
2026-03-08
๐Ÿ“š Book Maker โ€” Endpoint + Output Fix โ€” generatePageImage() was calling non-existent /api/flux-schnell. Switched to /api/generate-image. Fixed nested output parsing: data.output?.output || data.output.
2026-03-08
๐Ÿ“Š Admin Business Dashboard Fix โ€” Dashboard was crashing due to query on non-existent generation_log Supabase table. Removed that query โ€” dashboard now loads KPIs from subscriptions, kids, and Spark gallery API only.
2026-03-08
๐Ÿ”„ Lambda Restoration + DynamoDB Family Codes โ€” Restored Lambda after parallel thread overwrote it. Migrated family codes from Supabase to DynamoDB spark-families table. Working code: SPARK-DGAG. IAM policy spark-families-dynamodb added to Lambda role.
2026-03-04
๐Ÿ›ฐ๏ธ System Health Dashboard โ€” Added live health check panel to top of admin.html. Checks Supabase DB, Lambda API, Replicate, OpenAI, Google AI, ElevenLabs, and Hostinger on load and every 5 minutes. Color-coded cards (green/yellow/red) with pulsing indicators and latency readouts. Actionable error banners with specific fix instructions (e.g. which Lambda env var to update). Manual refresh button.
2026-03-04
๐Ÿ”’ Family Code + PIN Security โ€” Replaced single-PIN kid login with two-factor Family Code + PIN system. Created profiles Supabase table with unique family_code per parent (format: SPARK-XXXX). Auto-trigger generates code for new signups. Kid PIN query now scoped to verified parent only (~100M combinations vs 10K before). Added 5-attempt rate limiting with 15-minute lockout (localStorage). Parent dashboard shows Family Code with copy button. kid-pin.html redesigned with two-step flow: code entry โ†’ numpad PIN.
2026-03-04
๐ŸŽฌ Video Model Upgrade โ€” Removed Wan 2.1. Added Google Veo 3 Fast, Luma Ray 2, and Hailuo 2 via new unified /api/replicate-video Lambda route. Kling 2.1 unchanged. New endpoint accepts {prompt, model, aspect_ratio, start_image}. Lambda polls Replicate until completion before saving to DynamoDB. API Gateway route deployed to ymf072zyfd. All 4 models tested end-to-end.
๐Ÿ‘„ Lip Sync (NEW) โ€” Full lip sync tool: 4 modes (Sing, Talk, Animate, Record), 7 character presets hosted at jorrii.io/character/, 3 Replicate models (SadTalker, Wav2Lip, LivePortrait). Integrated into existing jorrii-spark-api Lambda (no new function needed). API Gateway route: POST /api/generate-lipsync. Frontend uses /api/voice for TTS + /api/generate-lipsync for async video generation. Auto-save to gallery, share to showcase. Full Supabase auth with kid PIN session support.
2026-02-27
๐ŸŽจ Site-Wide Navigation Update โ€” Added ๐Ÿ‘„ Lip Sync link to sidebar and mobile menu across all 11 pages. Fixed movie-maker, my-creations, and parent-dashboard sidebars from white/plain to yellow Chewy font styling (matching all other pages). All pages now have consistent 12-link yellow Chewy sidebar.
2026-02-27
๐ŸŒ™ Kid Dashboard Redesign โ€” Dark cosmic theme with glowing tool cards (8 tools, each with unique color gradient + glow halo). Usage bars now show count/limit with animated percentage fill and added Books + Movies rows. Recent Creations section now has filter tabs (All, Images, Videos, Voices, Music, Books, Movies) with count badges. Bubblegum Sans font for greeting, Chewy for titles with gradient text colors. Sidebar unchanged.
2026-02-24
๐Ÿ”Š Completion Sound Effects (ALL PAGES) โ€” Added sound effect playback on generation success/error across every creation page. make-a-picture (picturedone.mp3/error.mp3), make-a-video (videodone.mp3/error.mp3), make-sounds voice/sfx (voicesfxdone.mp3), make-sounds music (musicdone.mp3), book-maker (bookdone.mp3), movie-maker (moviedone.mp3), spark-studio (picturedone.mp3). All wrapped in try/catch. Hosted in /sounds/ folder.
2026-02-24
๐ŸŽž๏ธ Movie Maker โ€” Images, SFX Track, Transitions โ€” Added ๐Ÿ–ผ๏ธ My Images tab to Add Clip modal (gallery images as still clips with configurable 2-5s duration). New ๐Ÿ”Š Sound Effects Track section โ€” add sounds from gallery or upload, set timestamp for each, play during export via setTimeout. Expanded transitions from 2โ†’4: โœ‚๏ธ Cut, ๐ŸŒŠ Fade, โฌ…๏ธ Slide Left, โžก๏ธ Slide Right โ€” with popup menu instead of simple toggle. Image clips render via drawImage() with cover-fit in both preview and export.
2026-02-24
๐Ÿ“š Book Maker โ€” Character Builder โ€” Replaced Step 1 choice cards with full Character Builder: Person (Girl/Boy/Woman/Man/Baby/Cat/Dog/Dragon/Robot), Age (7 levels), Skin Tone (7 swatches), Hair Style (11 types), Hair Color (8 colors), Personality (8 traits), Extras (8 accessories). Live preview builds description. Custom text input fallback. "Who's Your Story About?" heading changed to white text.
2026-02-24
๐Ÿงช Spark Lab โ€” Character Builder โ€” Added collapsible ๐Ÿ‘ค Character Builder panel to spark-lab.html prompt workspace. Categories: Person, Age, Skin Tone (7 swatches), Hair Style (12), Hair Color (9), Build (7), Extras (9 multi-select). Live preview with "โž• Add to Prompt" and ๐Ÿ—‘๏ธ Clear buttons.
2026-02-24
๐Ÿ–ผ๏ธ Detail View Sizing Fix โ€” make-a-picture and make-a-video detail preview images/videos changed from fixed max-height:450px to viewport-relative max-height:40vh. Ensures full image/video visible with room for prompt/actions below. Feed card previews reduced from 300pxโ†’220px.
2026-02-24
๐Ÿ“‹ Admin Docs Updated โ€” Added sections: ๐Ÿ”Š Sound Effects, ๐Ÿ‘ค Character Builder, ๐Ÿงช Spark Lab, โšก Spark Studio. Updated Pages & Status table (Spark Studioโ†’Done, all new features noted). Added /api/save-book and /api/save-movie to endpoints table. Updated Book Maker (character builder steps), Movie Maker (images, SFX track, 4 transitions). Updated changelog and TODO.
2026-02-23
Character Look Picker (NEW) โ€” Added ๐Ÿ‘ค Character Look section to make-a-picture.html so kids can see themselves in their creations. Toggle on/off panel with: 7 skin tone swatches (light to deep dark), 12 hair styles (Short, Long, Curly, Afro, Braids, Locs, Ponytail, Twists, Bun, Mohawk, Pigtails), 8 hair colors (Natural, Black, Brown, Blonde, Red, Purple, Blue, Pink). Builds physical-feature descriptions (e.g. "a child with rich dark brown skin, black curly hair") that work with GPT Image without triggering safety filters โ€” solving the AI bias issue where specifying race/ethnicity gets blocked but describing physical features works perfectly.
2026-02-23
Endpoint Routing Fixes (CRITICAL) โ€” All generation pages were routing to /api/generate-image for everything, producing images instead of videos/sounds. Fixed: make-a-video now uses /api/text-to-video (Wan 2.1) and /api/kling-video (Kling 2.1) โ€” removed 6 fake models (veo-2, veo-3, kling-1.6, kling-2.0, minimax-video, runway-gen3) replaced with 2 real ones. make-sounds now uses /api/voice (OpenAI TTS, synchronous), /api/elevenlabs-sfx (ElevenLabs SFX, synchronous), and /api/music (MusicGen, async poll). Fixed sound feed filter to include voice/sfx/elevenlabs-sfx/music types.
2026-02-23
Usage Gates Removed + Unlimited Platform โ€” Removed all check_usage Supabase RPC gates from generation pages (make-a-picture, make-a-video, make-sounds). Spark platform is now fully unlimited โ€” no tier restrictions on any feature. All loadUsage shows "โœจ Unlimited". Kid nav shows โˆž for all counters. loadModels in make-a-video no longer queries subscriptions table โ€” all models always available. Book Maker tiers: all plans allowed, infinite plan = 9999 books.
2026-02-23
Gallery Share + Showcase Fix โ€” Lambda saveToGallery now sets isPublic:'false' on item creation (was missing, blocking GSI showcase queries). Share toggle sends createdAt as Number() for DynamoDB key match. Delete also fixed with Number(). Lambda sanitizeError now includes actual error message in E500 responses for debugging. Added CloudWatch logging to share/showcase handlers.
2026-02-23
Admin Docs Updated โ€” Replaced single-endpoint API table with full 20-endpoint reference organized by category (Images, Videos, Audio, Books, Gallery). Added synchronous endpoint docs (voice, SFX). Added error code reference (E101โ€“E500). Updated async flow to document Lambda auto-save and auth headers.
2026-02-22
Spark Lambda Migration (MAJOR) โ€” Complete separation of kids platform (jorrii.io) from adult platform (jorrii.com). Created dedicated jorrii-spark-api Lambda with isolated DynamoDB tables (spark-gallery, spark-jobs) and S3 buckets (jorrii-spark-creations, jorrii-spark-jobs-output). API Gateway: ymf072zyfd.execute-api.us-east-2.amazonaws.com. Lambda auto-saves all generations to S3 + DynamoDB (no more Supabase gallery_items). Gallery, share-to-showcase, and delete all routed through Spark API. Kid PIN sessions now take priority over parent Google login across all pages. Fixed GPT Image 1 size validation (1024x1024, 1024x1536, 1536x1024 only). Updated 10 HTML files: make-a-picture, make-a-video, make-sounds, book-maker, movie-maker, my-creations, showcase, kid-dashboard, parent-dashboard, admin.
2025-02-20
Movie Maker (NEW) โ€” Built movie-maker.html: storyboard video editor where kids drag & drop clips to create mini movies. 3 clip sources: My Videos (gallery), file upload, and title cards with color gradients. Cut/fade transitions between clips. Background music from gallery or upload. Sequential preview player. Canvas + MediaRecorder export to .webm. Zero server cost โ€” 100% browser-based. Added ๐ŸŽž๏ธ Movie Maker nav links across all 8 pages.
2025-02-20
Book Maker Nav Integration โ€” Added ๐Ÿ“š Book Maker links to sidebar, mobile menu, tool card grid, and footer across index.html, kid-dashboard.html, my-creations.html, showcase.html, spark-lab.html, spark-missions.html. New .tool-card.book CSS with pink border. Movie Maker links also added to all pages.
2025-02-20
Book Maker Lambda Fix & Deployment โ€” Fixed SyntaxError in Lambda caused by patch script mangling template literals in doGenerateStory(). Rebuilt complete index.mjs using string concatenation instead of backtick templates. Deployed via Lambda console editor. API Gateway route POST /api/generate-story confirmed working. Full test returned valid 8-page JSON.
2025-02-20
Book Maker (NEW) โ€” Built book-maker.html: 8-page storybook wizard. Character/setting/adventure/ending/art-style inputs โ†’ GPT-4o story generation โ†’ per-page image generation โ†’ book viewer with page flip โ†’ PDF export via jsPDF โ†’ Supabase save. Tier-gated: Supernova (5 books/mo), Infinite (10 books/mo).
2025-02-20
Parent Login Trust Section โ€” Added safety messaging section to parent-login.html with trust indicators for parents.
2025-02-19
Admin Business Dashboard โ€” Added live BI dashboard to admin.html: KPI cards, revenue breakdown, subscription details, user/kid stats, generation analytics, content metrics, churn tracking. All data pulled live from Supabase.
2025-02-19
Kid Dashboard โ€” Built kid-dashboard.html: time-aware welcome banner, 5 usage progress bars, quick tool cards, recent creations grid, kid nav with avatar + usage counts. No pricing or admin links shown to kids.
2025-02-19
Footer Redesign โ€” Changed footer from white/glass to solid purple (#7C3AED) with white text across all pages. Added Disclosures link. Updated AI disclaimer text.
2025-02-19
Link Cleanup โ€” Updated make-it-talk โ†’ make-sounds.html?tab=voice and make-music โ†’ make-sounds.html?tab=music across all 10+ pages (sidebar, mobile menu, footer, tool cards, quick actions). Created redirect files for old URLs.
2025-02-19
Make Sounds Page โ€” Built unified audio page with 3 tabs (Voice, SFX, Music). Voice: 9 character presets + custom voice ID + speed/stability sliders. SFX: 9 quick picks + duration. Music: 9 genres + duration (15s-2m). Model dropdown on each tab.
2025-02-19
API Integration Fixed โ€” Discovered async polling pattern: POST /api/generate-image โ†’ poll /api/check-job. Updated make-a-picture + make-a-video. Added animated progress bar. API works without Cognito auth. Model value now sent in payload.
2025-02-19
Real Model Lists โ€” Updated image page: GPT Image 1, GPT Image Mini, Imagen 3, Flux 1, Recraft v3, Ideogram v2. Video page: Veo 2/3, Kling 1.6/2.0, MiniMax, Runway Gen-3. Audio: ElevenLabs, OpenAI TTS, Suno, Udio, etc.
2025-02-19
Make a Video Page โ€” 3-panel layout with purple theme. Models: Veo 2/3, Kling 1.6/2.0. "Bring it to Life" receiver from picture page. Motion presets, duration selector, async polling + progress bar.
2025-02-19
Make a Picture Page โ€” 3-panel Kling-inspired layout. 6 real image models, 9 style presets, aspect ratios, reference image upload. Async polling with progress bar. Auto-saves to DynamoDB spark-gallery + S3 via Lambda.
2025-02-19
My Creations Gallery โ€” Built gallery with filter tabs (All, Images, Videos, Voices, Music, Favorites), lightbox detail view, download/favorite/share/delete actions, share-to-showcase feature.
2025-02-19
Database Tables Created โ€” Supabase: subscriptions, usage_tracking, generation_log, plan_limits view. DynamoDB: spark-gallery (with isPublic-createdAt-index GSI), spark-jobs. S3: jorrii-spark-creations (gallery files), jorrii-spark-jobs-output (temp). Added check_usage() and increment_usage() Supabase functions.
2025-02-19
Kid PIN Fix โ€” Fixed session key mismatch (spark-kid โ†’ sparkKid). PIN login now redirects to kid-dashboard.html instead of index.html.
2025-02-19
Admin Docs Created โ€” This documentation page.

TODO

PriorityTaskStatus
โœ…Fix Google OAuth redirect loopDone
โœ…Build pricing.html pageDone
โœ…Build make-a-picture.htmlDone
โœ…Build make-a-video.htmlDone
โœ…Build make-sounds.html (Voice + SFX + Music)Done
โœ…Build my-creations.html (gallery)Done
โœ…Build kid-dashboard.htmlDone
โœ…Create usage_tracking table + functionsDone
โœ…Create gallery storage (DynamoDB spark-gallery + S3)Done
โœ…Create subscriptions tableDone
โœ…Fix kid PIN session key + redirectDone
โœ…Purple footer on all pages + Disclosures linkDone
โœ…Update all sidebar/mobile/footer linksDone
โœ…Build book-maker.html (8-page storybook wizard)Done
โœ…Lambda: /api/generate-story endpoint + doGenerateStory()Done
โœ…Build movie-maker.html (storyboard video editor)Done
โœ…Add Book Maker + Movie Maker to all page navsDone
โœ…Parent login trust sectionDone
โœ…Build spark-studio.html (visual node pipeline)Done
๐Ÿ”ด HighBuild disclosures.htmlTODO
โœ…Kid nav on tool pages (hide pricing, show usage when kid logged in)Done
โœ…Movie Maker: save exported movies to galleryDone
โœ…Book Maker: save books to gallery with flipbook readerDone
โœ…Character Builder on make-a-picture, spark-lab, book-makerDone
โœ…Completion sound effects on all generation pagesDone
โœ…Movie Maker: image clips, SFX track, 4 transitionsDone
โœ…Build lip-sync.html (4 modes, 7 characters, 3 models)Done
โœ…Lambda: /api/generate-lipsync endpoint + doLipSync()Done
โœ…API Gateway route: POST /api/generate-lipsyncDone
โœ…Add ๐Ÿ‘„ Lip Sync to all page sidebars + mobile menusDone
โœ…Fix whiteโ†’yellow Chewy sidebar on movie-maker, my-creations, parent-dashboardDone
โœ…Kid dashboard colorful redesign (dark theme, glowing cards, usage bars with limits, filter tabs)Done
โœ…Reference image support for Wan 2.1 video (auto i2v switch)Done
โœ…Spark Studio real API wiring (was fake timeouts)Done
โœ…Detail view sizing fix (40vh viewport-relative)Done
โœ…Wire Stripe for paid subscriptions (live mode)Done
๐ŸŸก MediumUpload sound effect files to /sounds/ folder on HostingerTODO
โœ…Deploy Lambda with save-book + save-movie routesDone
โœ…API Gateway routes: POST /api/save-book, POST /api/save-movieDone
๐ŸŸก MediumMovie Maker: actual transition rendering during export (fade/slide canvas effects)TODO
โœ…Public Showcase page (shared gallery via /api/showcase)Done
๐ŸŸก MediumContent review feature in parent dashboardTODO
๐ŸŸข LowPIN collision prevention (scope per parent)TODO
๐ŸŸข LowSeparate showcase API for kid-specific contentTODO
๐ŸŸข Lowvideos/login.mp4 โ€” create parent landing videoTODO
๐ŸŸข Lowvideos/kidvideo.mp4 โ€” create kid PIN videoTODO
๐Ÿ”ด HighFix Book Maker โ€” not generating/saving correctlyTODO
๐ŸŸก MediumRegister /api/process-video route in API Gateway (self-invoke works but route not formal)TODO
๐ŸŸก MediumVerify voice page end-to-end with ElevenLabs voice IDsTODO
๐ŸŸข LowKid dashboard video backgroundTODO
โœ…Book Maker: auto-save books to My Books gallery with cover imageDone
โœ…Image generation: fix fire-and-forget Lambda self-invoke patternDone
โœ…Book Maker: character description injected into all image prompts for consistencyDone
๐ŸŸข LowMovie Maker: FFmpeg.wasm for MP4 export (currently .webm only)TODO
๐ŸŸก MediumUpload sound effect files to /sounds/ folder on Hostinger (bookdone, videodone, error etc.)TODO
๐ŸŸก MediumConnect Spark Studio nodes to real API endpointsTODO
๐ŸŸก MediumOG image redesign โ€” include Jorrii Spark logo for social sharingTODO
๐Ÿ”ด HighBuild disclosures.html (legal page)TODO