UGC Content Studio — AI Media Generation Pipeline
Automated media pipeline that combines product and model references into campaign images and short videos through Google AI and Cloudinary CDN.
Problem & context
Turn product and model reference uploads into an image, then an optional short video, while tracking the account's credits and project processing state.
My contribution
full-stack generation endpoints, account-scoped project records, media integrations, and the creation/result interface.

Inspect the workflow.
Explore the sample workflow without creating an account. The application renders bundled fixtures through its public preview interface.
Open sample workspaceRead-only fixtures · no sign-in · no real generation or financial action
Failure path: The image provider throws or returns no usable image after credits have been deducted.
The catch path stores the error when a project exists, clears its generating flag, attempts a five-credit increment, captures the exception, and returns an error response. Compensation itself can fail; no database transaction spanning the provider call is claimed.
Authenticated app ↗An engineering decision.
stored processing/error fields give subsequent project reads a concrete result to display, while explicit compensation handles caught provider errors. Separate mutations still require care around interrupted or concurrent requests.
Implemented approach
Persist project status and media URLs around the provider workflow, with compensating credit increments in caught failure paths.
Alternative & tradeoff
Keep generation state only in the browser and treat every provider request as an immediate result.
Follow the system.
Verified behavior & limitations.
What the evidence establishes
- Source review: image generation accepts reference uploads, deducts five credits, calls the image provider, and stores the generated Cloudinary URL.
- Source review: video generation polls the provider operation until done, uploads its output, and updates project processing state.
- Source review: caught image-generation failures record project error state and attempt to restore deducted credits.
- Source review: project lookup combines the project identifier with the authenticated Clerk user identifier.
Boundaries & remaining work
- These records establish source behavior. They do not establish a successful paid provider generation or production load test.
- Credit checks, deduction, provider work, and compensation are separate operations. This is not evidence of atomic billing or universal rollback; some video early returns occur after deduction.
- Video polling has no demonstrated bounded completion guarantee in this source snapshot.
Inspect the source.
References are pinned to the reviewed revision. Public sample screens demonstrate the interface with fixtures; source review and executed checks are labelled separately.