AutopilotReels
Configure a series once, and a durable job system takes each episode from story research to a checked, published short video, with a hard cap on what any episode may cost.
- Status
- Running privately on a small server. Publishes through the official YouTube and Instagram APIs.
- My role
- Solo, with an AI-assisted engineering workflow
- Timeline
- 2026, in use
- Stack
- Next.js 15, React 19, TypeScript, Prisma, PostgreSQL, pg-boss, FFmpeg, Zod, Vitest

Overview
AutopilotReels is a single-operator web app and a long-running worker. The operator sets up a series once: its topic, visual style, voice, captions, publishing accounts and schedule. From then on the system creates one video per slot, checks it, and publishes it when the slot comes round.
Problem
Making short-form video by hand is a long chain of repetitive steps: find a story, check it, write it, draw it, voice it, caption it, cut it, check it, upload it twice. Every step can fail, and AI services cost money every time they are called.
Goals
- Every step resumable after a crash or restart
- Never spend money by accident
- Nothing published that failed a quality check
- Never publish the same video twice
Solution
A state machine moves each video through discovery, research, script, storyboard, images, voice, captions, render, quality check and packaging. Each step is one job on a PostgreSQL-backed queue; it is retried a bounded number of times and otherwise blocked with a stored reason. Publishing then runs per platform, so one platform can succeed while the other is retried.
Core journeys

Configure a series
Content rules, art style, voice and captions, publishing accounts and the posting schedule, in one settings screen.

Watch the pipeline
The control centre shows what needs attention, progress per video and the next publishing slot. Every step of every attempt is recorded.

Review the package
Each finished video has a 9:16 preview, its frozen configuration and an editor for title, description and tags.
Screens
Control center: what runs, what publishes next
Ten-stage pipeline with a full production history
Rendered 9:16 short with animated captions
Series art-style picker drives every video's visuals
Publishing calendar by slot and platform
Technology
Next.js 15, React 19, TypeScript, Prisma, PostgreSQL, pg-boss, FFmpeg, Zod, Vitest
Architecture
- 1. Web (Next.js)
- Control centre, series, videos, calendar
- OAuth connections for YouTube and Instagram
- 2. Worker
- Scheduler tick every minute
- One pipeline step per job, bounded retries
- Spend gate and per-video budget
- 3. Media
- FFmpeg render, captions, audio mix
- Quality checks and targeted repair
- 4. Data and services
- PostgreSQL (Prisma) and pg-boss queue
- LLM, image, voice and video providers
- Platform publishing APIs
Engineering decisions
A queue in the database, not a separate broker
pg-boss on PostgreSQL gives durable jobs, retries with backoff and cron scheduling without adding Redis. Each job advances one step and re-enqueues, so a restart never loses progress.
Spending is opt-in and capped
Real AI calls refuse to run unless paid generation is explicitly enabled, and a per-video budget refuses any call that would cross the cap before it is sent. The test setup forces the gate off and strips every real credential.
Idempotency in the schema
Unique constraints on series and slot, and on video and platform, make duplicate scheduling and double publishing impossible even when two processes race.
Check, then repair what failed
Quality checks fail by category and trigger targeted repairs, and the failure reasons are fed back into the next attempt instead of blindly regenerating.
Challenges and solutions
Scheduled uploads failing in production
Uploads began failing with authorisation errors because access tokens were never refreshed before use. I traced the root cause, made every publish attempt refresh the token first, added a regression test and ran exactly one recovery upload per channel.
Images with unreadable text
Generated images sometimes contained garbled lettering. A local OCR check with Tesseract now rejects images that contain readable text; titles are composed separately with FFmpeg on text-free art.
Technical highlights
- 1080×1920 H.264 render with Ken Burns motion and crossfades
- Burned-in captions fitted to word timings from the voice track
- Music ducked under the voice and loudness normalised in two passes to −14 LUFS
- Timezone- and daylight-saving-aware scheduling with automatic retry rounds
- Email alerts when a slot can’t be filled or a publication is blocked
Security, accessibility, testing and deployment
Security
OAuth tokens are encrypted at rest, the operator signs in with a single account, and media is served only through authenticated routes.
Testing
About 1,100 Vitest tests across more than a hundred test files, some running against a real database. The project’s own log records 1,122 of 1,123 passing on the latest branch, with the single failure documented as pre-existing. I have not re-run the suite for this portfolio.
Deployment
Runs as two systemd services on a small private server, with PostgreSQL in a container and daily backups. The web interface is not public.
My contribution
Solo automation project developed through an AI-assisted engineering workflow. My contribution covers product requirements, architecture decisions, workflow orchestration, implementation review, testing, operational safeguards and system operation.
Links
The repository is private. I’m happy to walk through the code in an interview.
Next project
Wedding MemoriesA custom-built private photo and video sharing application developed for a wedding.