← All projects
Sole backend engineer — API, AI orchestration, queues, data model and deployment2026

ROMIMI

A production NestJS backend that turns raw product photos into on-brand ad creatives and studio packshots, orchestrating Claude, Gemini and Vertex Imagen behind Redis-backed BullMQ queues.

107REST endpoints
~32KSource lines
3 (Claude/Gemini/Imagen)AI providers
3Generation pipelines
723Commits

The problem

Producing brand-consistent advertising creatives and studio packshots is slow and expensive — photographers, models, studios and designers. Off-the-shelf image generators do not preserve product fidelity, ignore brand art-direction, leak personal/demographic descriptions into prompts, and cannot reliably run large batches without hitting provider rate limits or blocking the user.

The solution

A NestJS backend that splits the workflow into analysis and rendering: Claude converts product photos into validated structured JSON; a large prompt-builder merges that with reusable art-direction presets, pose/lighting libraries and brand marketing angles into fidelity-checked prompts; and Gemini/Vertex Imagen render the images. Generation runs asynchronously on Redis-backed BullMQ queues with retries, stalled-job recovery and a round-robin API-key pool, while Socket.IO streams progress and finished batches download as streamed ZIP archives. A PII-sanitization layer and provider safety settings keep prompts compliant.

Overview

ROMIMI is an AI ad-creative and packshot studio built as a TypeScript NestJS backend (~32K lines across 15 controllers and 107 REST endpoints). It ingests a brand product photography and, through a multi-stage AI pipeline, produces three classes of output: photorealistic on-model product visuals, recreated advertising creatives derived from a brand marketing playbook, and clean studio packshots. The system cleanly separates the two halves of generative imaging — using Anthropic Claude as a structured-vision analyst that converts photos into validated JSON product descriptors, then using Google Gemini and Vertex AI Imagen as the rendering engines.

Heavy image generation never blocks the request thread: each pipeline pushes jobs onto dedicated BullMQ (Redis) queues with tuned concurrency, exponential-backoff retries, stalled-job recovery, lock renewal and per-job timeouts up to 15 minutes. A Socket.IO gateway plus polling endpoints stream live progress (percent complete, elapsed, ETA), and completed batches are streamed to the client as on-the-fly ZIP archives. To sustain throughput against per-key rate limits, the Gemini integration runs a round-robin pool of API keys.

The orchestration layer is the most sophisticated part: a nearly 2,000-line prompt builder and a Gold Standard art-direction preset system merge analyzed product JSON with mood-aware pose libraries, lighting/background/prop configs and shot-type instructions into deterministic, fidelity-checked prompts. A dedicated PII-sanitization layer strips demographic language before prompts reach the model. Operationally it is production-grade: JWT/Passport auth, class-validator whitelisting, a global exception filter, throttling, PostgreSQL via TypeORM with versioned migrations, AWS S3 (with R2/MinIO support) plus local fallback, Sharp processing, and Dockerized deployment.

Key features

  • Three distinct AI generation pipelines — on-model Product Visuals, brand-playbook Ad Recreation, and studio Packshot Studio — over 107 REST endpoints
  • Multi-provider AI orchestration: Claude for structured vision analysis, Gemini and Vertex Imagen for rendering
  • Redis-backed BullMQ queues with tuned concurrency, backoff retries, stalled-job recovery, lock renewal and per-job timeouts to run generation off the request thread
  • Round-robin Gemini API-key pool for parallel, rate-limit-resilient batch generation
  • A ~2,000-line prompt builder plus a Gold Standard art-direction preset system (background, floor, props, lighting, mood-aware pose libraries) for deterministic, fidelity-checked prompts
  • PII/demographic prompt sanitization plus provider safety settings and model-refusal detection
  • Real-time progress via Socket.IO and polling (percent, elapsed, ETA) with completed batches streamed as on-the-fly ZIP archives
  • AWS S3 storage (with R2/MinIO support) and local fallback, using Sharp for image processing
  • PostgreSQL via TypeORM with versioned migrations and a rich JSONB-backed entity model, behind JWT auth, throttling and a global exception filter

Tech stack

NestJSTypeScriptBullMQRedisPostgreSQLTypeORMAnthropic ClaudeGoogle GeminiVertex AI ImagenOpenAIAWS S3Socket.IOSharpPassport/JWTclass-validatorDocker