← Projects

Clipzy

AI photo and video app: pick a template, add photos or a prompt, get a cinematic clip.

Clipzy is an AI creative app for iOS and Android. You pick a template and a look, add photos or a prompt, and Clipzy generates a finished image or a short video clip without any manual editing.

Generations

The API is Hono on Cloudflare Workers, with Drizzle and PostgreSQL, Better Auth (including Sign in with Apple) and R2 for media through presigned uploads. Each generation runs as its own Cloudflare Workflow: it submits the job to a fal.ai model and waits for fal’s signed webhook instead of polling. Generation requests carry idempotency keys, so a double tap doesn’t start two jobs. Errors are split into retriable and final, a failed generation refunds its coins, and a retry charges again. KV handles rate limiting, and crons clean up behind the workflows.

How a Clipzy generation runs The API charges coins and starts one Workflow per generation. The Workflow submits the job to fal and sleeps until fal's signed webhook wakes it, so nothing polls. A failed generation refunds its coins.
  1. Clipzy app to API Worker: generate + idempotency key
  2. API Worker to Postgres: insert + spend coins
  3. API Worker to Workflow: start Workflow
  4. API Worker to Clipzy app: generation pending
  5. Workflow: enhance the prompt
  6. Workflow to fal.ai: submit with webhook URL
  7. Workflow: wait for the event
  8. fal.ai to API Worker: signed webhook
  9. API Worker to Workflow: verify, then send event
  10. Workflow: copy outputs to R2
  11. Workflow to Postgres: complete (or fail + refund)
  12. Workflow to Clipzy app: push notification

Templates as data

Templates are rows in the database, not code. Admins create and price them through admin endpoints, a translation workflow localises each one into every app language, and a prompt-enhancement endpoint rewrites the user’s prompt before it reaches the model. Finished work can be published to an explore feed, and template use counts decide what shows first.

How templates reach the app Templates are data, not code. Admins create and price them through the API, and a second Workflow translates each one into every app language.

Parts: Admin (template APIs), Clipzy app (template gallery), API Worker (Hono · zod-openapi), Translation flow (every app language), Postgres (templates · prices), fal.ai LLM (translation).

  • Admin to API Worker (create)
  • Clipzy app to API Worker
  • API Worker to Translation flow
  • API Worker to Postgres
  • Translation flow to fal.ai LLM

The app

The Expo app has onboarding, the template gallery, a RevenueCat coin store and paywall with intro offers, AI consent, and push notifications that deep-link to a result when it’s ready. Analytics run on PostHog and Firebase, with Crashlytics for crashes. Store and social videos are rendered from code with Remotion.

Photo templates
Prompt and upload screen
AI-generated video
Discover feed