← All work02 / 03

Digital Frame AI

Turns customer images into short promotional videos through a multi-stage, human-in-the-loop pipeline.

Type
Image-to-video production pipeline
Role
Co-developer in a two-person team, building the pipeline phase by phase.
Status
In development · phases 0–12 complete
Stack
NestJS · BullMQ · Redis · PostgreSQL · MinIO · Next.js · FFmpeg
01

Problem

Turning a set of business, property or product photos into a usable promotional video means checking the images, planning scenes, generating clips, rejecting bad ones and rendering a final cut. Each step can fail, and paid generation must not run twice.

02

Architecture

A TypeScript monorepo with three apps (an HTTP API, background workers and a web client) and shared packages for contracts, domain logic, database, storage, media, AI providers and observability. Workers process jobs from BullMQ on Redis; state lives in PostgreSQL and files in MinIO object storage. Video assembly renders with FFmpeg.

shared packages: contracts · domain · db · storage · media · ai · observabilityWebNext.jsAPINestJSQueueBullMQ on RedisWorkersthe pipelinePostgreSQLstateMinIOfilesFFmpegrender
Simplified architecture, drawn from the code.

14 of 17 phases complete · select a phase

Phase 13 · Next

Full video review

Internal and customer review, timestamped comments, approval.

03

Key decisions

  1. 01

    Shared contracts

    Request and job shapes are defined once with zod and used by the API, the workers and the web client.

  2. 02

    Provider boundaries

    Vision, generation and visual QC sit behind ports, so a vendor can be swapped or faked in tests.

  3. 03

    Paid for exactly once

    The generation orchestrator submits, polls, ingests and reconciles durably, so a retry never pays for the same clip twice.

  4. 04

    Retries as rules

    A failure taxonomy, attempt caps and budget limits decide when a clip is retried or replaced.

04

Stack

Interface
Next.js · React · TypeScript
Services
NestJS API · zod contracts · JWT auth
Async
BullMQ workers · Redis
Media
FFmpeg · MinIO object storage
Data
PostgreSQL
Quality
Vitest · ESLint (incl. security rules) · CI
05

Tradeoffs

  • Building against provider ports first meant writing adapters and fakes before any vendor was wired in, in exchange for a pipeline that runs end to end in tests and can change generation vendors without touching its core.
  • Quality control records exactly what checked a clip, and says so when no model did, rather than implying a review that never happened.
06

Outcome

Phases 0–12 are complete, including real FFmpeg rendering. Full video review, export and delivery are next.