Built DatePhotos AI (https://datephotos.ai) on Vercel and wanted to share the architecture, since orchestrating long-running AI jobs from a serverless app comes up a lot here:
- Each order kicks off a ~30-min Flux LoRA training + a ~100-photo generation batch — far beyond function limits, so QStash queues drive the pipeline and Replicate webhooks call back into API routes with prediction-ID idempotency
- Next.js 16 / React 19 / Prisma → Neon Postgres, photos stored in Cloudflare R2
- 100k+ photos generated in 2026, ~18k/month currently
Happy to answer questions about the webhook/idempotency setup.