AI Image & Video Generation for E-commerce
An AI-powered image and video generation platform that transforms Amazon product listings into professional video advertisements. As a contract engineer, built core platform infrastructure including the subscription billing system, teams functionality, distributed job queue for AI workloads, and led major state management refactors across the frontend.
- Client
- Genrupt
- Role
- Contract Full-Stack Engineer
- Service
- Full-Stack Development
- Technologies
- Next.js TypeScript PostgreSQL Prisma pg-boss Stripe AI Providers (OpenAI, Runway, Kling, Google)
// The Challenge
The platform needed to evolve from MVP to scalable SaaS. Key gaps included: no subscription or billing system, unreliable async job handling for long-running AI operations, and frontend state management that had become difficult to maintain as features grew.
The system also needed to orchestrate 10+ AI providers (OpenAI, Runway, Kling, Google VEO) while accurately tracking costs.
// The Approach
Built end-to-end ML inference pipeline: Dockerized diffusion model, deployed to serverless GPU, integrated with Next.js application.
Built the complete subscription system end-to-end: designed the Prisma schema for tiered pricing and credit pools, implemented Stripe webhook handlers for subscription lifecycle events, created the pricing page with checkout flow, and built admin interfaces for subscription management.
Implemented pg-boss job queue infrastructure for distributed image and video generation, replacing unreliable polling with persistent, retryable jobs. Added idempotent retry logic ensuring users aren't double-charged when jobs fail and retry.
Led a multi-phase frontend refactor: migrated from prop drilling to Zustand stores for storyboard state, introduced React Query for server state with proper cache invalidation, and extracted 8+ custom hooks from monolithic controllers.
Engineered a custom two-pool credit billing system with Stripe integration; implemented idempotent webhook processing and atomic database operations to ensure financial accuracy during concurrent usage.
// The Outcome
Shipped a production subscription system now handling paying customers across Free, Basic, Premium, and Lifetime tiers. Two-pool credit system (purchased + monthly allotment) provides flexible billing model.
Job queue processes parallel AI workloads reliably, with automatic retries and real-time status updates via SSE. Idempotent billing prevents duplicate charges during failure recovery.
Refactored frontend reduced component complexity and enabled faster feature development across database schema, API routes, React components, and background workers.