CASE STUDY · AI-VIDEO SAAS

Leoza: a topic in, a finished 9:16 short out — voiceover, captions, visuals, effects, and TikTok upload all done by AI.

Built for creators who want to ship daily TikTok / Reels / Shorts without ever opening an editor. Two creator modes, 8-step wizard, full Stripe billing with sale countdowns, TikTok OAuth + upload, and a margin dashboard so the owner sees real cost-per-video on day one. 104 pytest tests passing.

Frontend: React + Tailwind + ShadcnBackend: FastAPI + Motor (async MongoDB)AI: GPT-5.2 · TTS-1 · Nano BananaStock: Unsplash + PexelsVideo: FFmpeg 1080×1920 H.264Payments: Stripe LIVE + signed webhooksAuth: JWT + brute-force lockoutTests: 104 pytest tests
8-step
Creator wizard
13
AI voices
13
Visual art styles
104
Backend tests passing

I built Leoza. I also run Leoza.

This isn't a client demo or a case-study teardown. It's a live production business I personally built, operate, and take real payments on — which is exactly why I can confidently build the same calibre of system for you. Every pitfall below has already been hit on my own money first.

  • Premium-only AI-video SaaS — Stripe LIVE mode, no test toggles in production
  • GPT-5.2 + OpenAI TTS + Gemini Nano Banana orchestrated through one universal key
  • TikTok Login Kit + Content Posting API — review-ready, Direct Post code path built
  • 104 pytest tests covering admin, series, login lockout, showcase, and the full pipeline

Premium creators get a clean, paid-only product.

No free tier confusion. The buyer either has a Series subscription or a credit balance — every action in the app respects that.

  • Email + password auth with JWT, brute-force protection, auto-lockout, password reset
  • Premium-only model — Series subscription OR credit balance required to generate
  • Public landing with real Leoza-generated showcase carousel (no fake views, no fake handles)
  • Pricing page with live admin-controlled prices, sale strikethrough, and live countdown timer
  • Stripe Checkout (LIVE mode) with webhook signature verification — no spoofed fulfilment
  • 8-step Creator Wizard — Niche · Voice · Music · Art Style · Captions · Effects · Delivery · Review
  • Smart-default art style based on niche (Scary → Horror, Mythology → Mythology, etc.)
  • Out-of-credits upsell card on the on-demand tab when balance runs low

Subscribe once, ship daily — without lifting a finger.

Series mode is the killer feature: pick a niche and a cadence, then Leoza writes, narrates, animates, and assembles videos on schedule until the customer pauses it.

  • 3 Series subscription plans: Lite (12/mo · 3×wk), Standard (30/mo · daily), Pro (60/mo · 2×day)
  • Single-active-series-per-user rule — keeps focus, simplifies billing
  • GPT-5.2 auto-generates topic backlog matching the niche; user can edit/regenerate any topic
  • Background scheduler keeps producing videos even after the user logs out
  • Pause / resume / stop controls on the active series
  • Live timeline of queued / processing / completed / failed videos with friendly status messages
  • Past series archive — completed and stopped runs stay browseable

What actually happens when you click Generate.

Ten orchestrated stages, real costs logged on every step, automatic refund if anything breaks. Nothing in this pipeline is mocked.

  • GPT-5.2 generates a JSON script — title, hook, 6–8 segments, per-segment image keywords, CTA
  • Auto 1.2-second visual hook bumper at t=0 to stop the scroll
  • Hybrid image sourcing: Unsplash + Pexels for stock styles, Gemini Nano Banana per-scene for AI styles
  • Visual consistency rule — if any AI scene fails, entire video falls back to stock (styles never mix mid-video)
  • OpenAI TTS-1 voiceover in a single synthesis call
  • TikTok-style word-level captions in safe zone above thumb reach
  • Per-style FFmpeg post-effects: film grain, breathing camera, text pop, zoom-pulse
  • 1080×1920 H.264 + AAC FFmpeg assembly with Ken Burns motion variants
  • MP4 + thumbnail uploaded to object storage; signed URLs returned
  • Auto credit refund if any step fails — buyer never pays for a broken render

OAuth + upload, end-to-end, review-ready.

Built for the TikTok app review demo: customers connect their account, send finished MP4s straight to their TikTok inbox, and disconnect at any time. Token refresh is fully automatic.

  • OAuth flow with user.info.basic + video.upload scopes (review-ready)
  • Connected status pill with TikTok display name + avatar; one-click Disconnect wipes tokens
  • Send-to-TikTok action on every completed video card AND inside the preview modal
  • Live progress states — Uploading → Confirming with TikTok → ✅ Sent
  • Auto refresh-token rotation — 24h access tokens silently refresh up to 1 year
  • Direct Post (auto-publish) code path ready — locked until TikTok review approves
  • YouTube Shorts / Instagram Reels / Facebook UI placeholders ready for OAuth keys

Run the entire SaaS without touching code.

  • Admin perks: 0-credit generations, no subscription required — perfect for QA and demos
  • Pricing controls: edit credits-per-video, all 3 credit packs, all 3 series plans
  • Per-plan sale pricing: toggle, sale price, badge text, optional end-time (drives the public countdown)
  • Live PATCH + deep-merge config save — no service restart, no DB migration
  • User management: search, adjust credits, reassign plan, toggle is_admin, hard-delete with cascade
  • Cost & profitability dashboard with stock vs AI vs mixed tiles + 7/30/90-day filter
  • Per-video cost data logged in 11 fields on every render — pre-existing 49 videos back-filled
  • Friendly progress message map in a single source-of-truth file

Real owner-side cost data on every render.

Most SaaS owners launch on vibes. Leoza launched with an actual margin dashboard — every video logs 11 fields of cost data so the owner sees real dollars-per-video filtered by stock vs AI vs mixed, across 7 / 30 / 90 days.

  • Stock video — about $0.022 owner cost
  • AI-art video — about $0.296 owner cost
  • Mixed average — about $0.16 owner cost
  • Pro plan ($89 / 60 videos) — 95% margin on stock, 77% on AI-art, 86% mixed

No fake handles. No fake views. No fake likes.

Leoza's landing page showcase only plays real Leoza-generated videos. No inflated TikTok screenshots, no purchased social proof. The same standard applies everywhere: backend stage names like finding_images never leak to the UI — users see "Finding the perfect visuals…" instead.

Want a SaaS like this? Stripe-billed, AI-powered, production-ready.

If you want a real software business — not a course, not a coaching offer, but a product that runs while you sleep — this is the pattern. Pricing engine, user mgmt, admin tools, AI orchestration, social-platform integrations. Custom-scoped and built end-to-end.