Blog 🌙 My Sleepy Tale
Engineering · June 2026

How We Built
My Sleepy Tale

564 stories, 12 traditions, 9 languages, 59 series — and the technology that makes it all work. A transparent look at our stack.

The Numbers

MetricCount
Total content pieces564
Standalone stories211
Story series59
Series episodes305
Collections48
Cultural traditions12
Languages (multilingual demo)9
Blog posts36+
Email notification types15
API endpoints20+

The Stack

Frontend

  • React — Single-page application with Vite bundler
  • Tailwind CSS — Utility-first styling with CSS variables for dark/light theme
  • Framer Motion — Page transitions and animations
  • i18next — Internationalization (EN/FR/ES)
  • PWA — Installable on mobile with offline manifest

Backend

  • AWS Lambda — Serverless API (20+ endpoints)
  • AWS S3 + CloudFront — Static hosting with global CDN
  • Firebase Firestore — Real-time database for user data
  • Firebase Auth — Google sign-in authentication
  • Firebase Storage — Audio files, images, receipts

AI & Content

  • OpenAI GPT-4o — Story generation with cultural context
  • OpenAI gpt-image-1 — Cover art for every story
  • OpenAI TTS — English narration (sage, coral, echo voices)
  • ElevenLabs — Multilingual narration (9 languages)
  • Claude AI (Anthropic) — Translation, content writing
  • Gemini (Google) — Image generation for social media

Infrastructure

  • GitHub Actions — CI/CD pipeline on push to main
  • AWS SES — 15 email notification types with throttling
  • Stripe — Subscription payments (Pro/Family tiers)
  • CloudFront — Security headers (HSTS, CSP, nosniff)
  • IndexNow — Instant search engine notification

How a Story Gets Made

Here is what happens when a parent taps "play" on a bedtime story:

  1. Content — 211 stories are handwritten and stored in the codebase. Each has a `{childName}` placeholder that gets replaced with the child's real name.
  2. Personalization — The story text is filled with the child's name, family members, pet, and cultural context from their profile.
  3. Audio — If pre-generated audio exists (cached in Firebase), it plays instantly. If not, OpenAI TTS generates it in real-time with the selected narrator voice.
  4. Images — Each story has a unique image prompt. OpenAI gpt-image-1 generates cover art that matches the story — no stock photos, no generic teddy bears.
  5. Caching — Audio is cached in IndexedDB locally + Firebase Storage globally. Second plays are instant.

How We Keep It Efficient

Smart caching

Pre-generate, don't live-generate. We generate audio and images once per story, cache them globally. A million users playing the same story uses the same cached file — not a million API calls. Personalized audio (with the child's name) is a Pro feature that generates on-demand and caches per child.

Security & Privacy

We take your family's data seriously. Here is what we do:

What We Do

  • HSTS + security headers on every response
  • Stripe webhook signature verification
  • HTML sanitization on all email content
  • Email throttling (5 activity/day, 1 marketing/week)
  • No child names in Google Analytics
  • Admin authentication on all sensitive endpoints

What We Never Do

  • Never sell your data to third parties
  • Never send child PII to analytics
  • Never store passwords (Google Auth only)
  • Never show religious content without consent
  • Never spam (throttle layer enforced)
  • Never hardcode secrets in source code

Features We Built

FeatureDetails
Belief filtering12 traditions. Universal by default. Parents choose in Settings.
Private seriesCreate personal stories, share with family, let them contribute episodes.
Contributor flowSubmit episodes → owner reviews → approve/reject → publish.
Multilingual9 languages with culture-specific illustrations.
Personalized audioPro subscribers hear their child's actual name narrated.
Dark/Light themeToggle in Settings. CSS variables + Tailwind.
Creator programWrite stories/series, earn credits, community publishing.
Outreach CRM1,243 leads, admin panel, email tracking.
Expense trackerMonthly costs with receipt uploads.
15 email typesWelcome, contributions, sharing, newsletters, subscriptions.

Open Source Spirit

While our codebase is private, we believe in transparency. This blog, our security audit, our email throttling guide, and our belief system documentation are all public. We build in the open because we believe parents should know exactly how the platform their children use is built.

Built by Parents, for Parents

We are Prat and Deepti — a small team in Toronto who built My Sleepy Tale for our son Veda. Every decision we make starts with one question: would we want our child to use this?

Explore My Sleepy Tale →