AI Image & Video Generation for E-commerce
An AI-powered creative platform that transforms product images into professional marketing assets. Built core infrastructure (subscriptions, teams, job queues) and shipped a Canva-style text editor with Google Vision OCR, AI-powered text removal, and brand identity automation for batch image processing.
- Client
- Genrupt
- Role
- Contract Full-Stack Engineer
- Service
- Full-Stack Development
- Technologies
- Next.js TypeScript PostgreSQL Prisma pg-boss Stripe Google Cloud Vision FAL.ai OpenAI Runway Kling
// 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.
Built a Canva-style text editing feature: Google Vision OCR detects text on images, AI inpainting models remove it cleanly, users replace with styled text. Implemented brand identity system with automatic header/subtitle classification and font replacement. Added multi-image batch processing with pipeline workflow and real-time status indicators.
// 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.
Shipped text editing feature enabling non-designers to create professional branded images—OCR text detection, AI-powered removal, and automatic brand font replacement across batch uploads.