The Problem
Solo creators and small media teams managing multiple social accounts end up fragmenting their production workflow across Notion tables, Google Drive audio folders, WhatsApp self-chats, and scattered LLM prompt tabs. Tracking which script is approved, which voice-over file belongs to which brand persona, and what is queued for batch publishing turns into constant context switching.
The goal of Vibemotion was to unify multi-account brand guidelines, batch scheduling, voice-over audio assets, and AI prompt generation inside one fast, mobile-first PWA.
My Role & Constraints
I architected and shipped the fullstack PWA end-to-end across frontend routes, TanStack Server Functions, Cloudflare edge storage, database schema, and authentication.
Key technical constraints:
- Edge-native zero-cold-start latency: the app needed to feel snappy on mobile networks without maintaining traditional VPS infrastructure.
- Large audio asset handling inside edge limits: voice-over recordings could not bloat edge worker memory or pass through SQLite blobs.
- Strict multi-account isolation: brand guidelines, persona prompts, and production checklists had to stay cleanly scoped per creator workspace.
Key Decisions
1. Strict 5-layer architecture on Cloudflare Workers, D1, R2, and KV
Using TanStack Start paired with Cloudflare Workers, D1 (SQLite + Drizzle ORM), R2 (object storage), and KV (edge session cache) gave us globally distributed performance at near-zero idle cost.
- Trade-off: D1's SQLite semantics require disciplined query structuring and strict migration discipline via Drizzle ORM compared to managed Postgres, but pairing KV session lookups with Better Auth kept authenticated route transitions crisp from mobile devices.
2. Direct streaming to R2 for voice-over audio assets
Rather than buffering multi-megabyte audio narrations inside worker payloads, the production tracker separates structured metadata (stored in D1) from binary media streams stored in Cloudflare R2, allowing responsive mobile playback and asset verification inside checklists.
5-layer serverless routing with direct R2 binary offload
Keeping multi-megabyte voice-overs out of Worker RAM and SQLite.
3. AI Prompt Studio with selectable animation styles & active skill presets
Instead of embedding an opaque wrapper chat window that hides prompts, the Studio AI Prompt compiles each account's brand guidelines, persona, visual animation style (Style RicksClip3000, 2D Motion Explainer, Isometrik 2.5D, Kinetic Typography, Map Animation), duration parameters, and continuation numbering (Lanjut Day 23) into structured Markdown plans ready for direct import into Content Batches and the Kanban board.
Making persona guidelines, active skills, and visual styles explicit, inspectable inputs kept generated content plans consistent across multi-account batches.
From structured brand prompt to scheduled batch publish
Eliminating scattered Notion tables, Drive links, and raw LLM tabs.
Studio AI Prompt
Combines account persona, visual preset (2.5D / Explainer), duration & day count.
Markdown Batch Import
Parses structured LLM output directly into scoped episode cards.
Kanban & R2 Media
Track script status and preview voice-over audio or video renders in-app.
Caption & Schedule
One-tap copy for TikTok, IG, and YouTube metadata aligned with the calendar.
The Build
With TanStack Start, React 19, Drizzle ORM, and Zod, server functions enforce strict schema validation right at the edge boundary (L2 Application) while audio uploads use presigned URLs (aws4fetch) or zero-buffer Worker stream fallback (PUT /api/audio/$contentId) before saving keys into D1 (audio_asset):
// Verified PRODUCTION_STATUSES & R2 audio boundary (vibemotion/src/db/schema.ts & audio.fn.ts)
import { z } from "zod";
export const PRODUCTION_STATUSES = [
"not_started",
"ready",
"in_progress",
"review",
"ready_to_publish",
"scheduled",
"published",
"needs_revision",
] as const;
export const AudioUploadMetaSchema = z.object({
contentId: z.string().min(1),
filename: z.string().trim().min(1).max(200),
size: z.number().int().positive().max(50 * 1024 * 1024),
mime: z.string().regex(/^audio\//),
});Session state and multi-account authentication are backed by Better Auth + Cloudflare KV, while the mobile-first PWA UI stays focused on rapid batch status toggling and prompt execution on the go.
Outcome
- Shipped production-grade multi-account Content Studio PWA at vibemotion.tartilahub.web.id.
- Unified multi-account workspaces, Markdown batch imports (Content Batches), Kanban & Calendar scheduling, Studio AI Prompt, Media Aset video/audio previews, and Publikasi & Caption copy workflows in one installable PWA.
- Validated TanStack Start + Cloudflare (Workers/D1/R2/KV) + Drizzle ORM as a fast, low-overhead fullstack architecture for edge products.
Reflection
Building directly on edge primitives early kept data boundaries disciplined. If expanding to multi-member agency teams later, adding optimistic offline queue sync for checklist updates on flaky mobile connections would be the main UX improvement.



