I recently launched Dressora, an AI clothes changer that swaps outfits onto a single photo for virtual try-on. The product side is fun, but the parts I actually sweated over were the boring backend bits: orchestrating multiple AI providers, handling long-running generation jobs, and building a credit system that never double-charges or loses money. Here's what I learned.

Stack

Next.js 15 (App Router) + React 19 + TypeScript

PostgreSQL + Drizzle ORM

Cloudflare R2 for media storage