Social Farm — automated short-video studio
Plans, researches, writes, voices, edits and posts short videos to 10 channels, three times a day, unattended.
- Python
- FastAPI
- OpenRouter
- Gemini TTS
- HyperFrames
- SQLite
- PostPeer API
- Railway
What it makes
Real videos produced by the system.
- 30 / dayposts across 10 Instagram, TikTok and YouTube channels
- 159 / 242commits are mine, in a team of two
- $0.03writing-cost cap per video
A studio that films, voices and posts every day
Tap a block to see what it does.
- Input
- Logic
- AI
- Infrastructure
- Output
- People
The heart of the system
Social Farm
The whole studio runs on Railway with every PC switched off: each day it plans, researches, writes, voices, edits and posts three videos per page.
Input
Weekly plan
Mine. 28 topics per page each week from a curated bank ranked by Wikipedia reads; for astrology a sky calendar computed with Skyfield picks the sign.
- Python
- Wikipedia
- Skyfield
Hands to Cited research
Logic
Cited research
Co-developer's. A polite crawler reads the sources and keeps only facts backed by an exact quote, from Wikipedia, GDELT, OpenAlex and feeds.
- Wikipedia
- GDELT
- OpenAlex
Gets from Weekly planHands to Direction & script
AI
Direction & script
My rotating formats, hooks and endings steer cheap OpenRouter models that write and review within $0.03; a memory rejects scripts over 12% similar to the last 30.
- OpenRouter
Gets from Cited researchHands to Voice, Licensed visuals
AI
Voice
Co-developer's. Gemini TTS (Kokoro when local) with one fixed voice per page; faster-whisper times every word for captions and cuts.
- Gemini TTS
- Kokoro
- faster-whisper
Gets from Direction & scriptHands to Edit & gate
Logic
Licensed visuals
Co-developer's. Only openly licensed clips and photos (Pexels, Pixabay, Wikimedia, NASA, museums); a vision model checks each clip fits its line.
- Pexels
- Pixabay
- Wikimedia Commons
Gets from Direction & scriptHands to Edit & gate
Logic
Edit & gate
Co-developer's HyperFrames render (HTML to MP4) with my infographics, music and SFX; a technical gate (1080×1920, audio, length) fails bad renders.
- HyperFrames
- FFmpeg
- Headless Chrome
Gets from Voice, Licensed visualsHands to Scheduler & ledger
Infrastructure
Scheduler & ledger
Mine. Starts each video 4 h before its slot and posts at 08:30, 13:00, 20:30; a SQLite ledger blocks double posts. Runs on Railway with the PC off.
- SQLite
- PostPeer API
- Railway
Gets from Edit & gateHands to 10 channels, Studio & alerts
Output
10 channels
Four themed pages on Instagram, TikTok and YouTube. Each post gets a cover not used before and a caption adapted to the platform.
- TikTok
- YouTube
Gets from Scheduler & ledger
People
Studio & alerts
Every stage writes to an event log. A private dashboard (first version mine) and a Telegram bot (co-developer's) show slots, failures and credits.
- FastAPI
- Chart.js
- Telegram Bot API
Gets from Scheduler & ledger
The problem
The owner of four themed social pages (astrology, curiosities, motivation, psychology) wanted three new videos a day on each page, posted to 10 Instagram, TikTok and YouTube channels. By hand that means research, script, voice, edit, cover and upload every single day; generic AI generators make repetitive videos with invented facts and unlicensed footage.
What I built
- Built the publishing engine: one interface for every platform, captions adapted per platform, a dry-run mode and a scheduler for the 08:30, 13:00 and 20:30 slots.
- Wrote the editorial direction layer (the "regia"): a weekly plan of 28 topics per page, rotating formats, hooks and endings, and a memory that rejects scripts too close to the last 30.
- Moved production to Railway with a persistent volume, so videos go out with every PC switched off; the farm now runs there as three services (farm, dashboard, Telegram bot).
- Added the infographics module, covers that never repeat, an event log and the first version of the private dashboard that shows every slot, failure and credit.
- Packaged the farm as a white-label kit for a new owner: a guided setup run by Claude Code that generates the internal secrets and hands them to Railway without ever printing them.
The hard part
Hitting three fixed slots on 10 channels when one render takes minutes inside a memory-limited container. When two pages missed the 08:30 slot because preparation started only 45 minutes ahead, I moved it to 4 hours before and kept each slot open until the next one: a late video goes out late, never as a burst of backlog posts.
Result
In production on Railway, publishing on its own. The day the tenth channel was connected, all 10 went out at the 20:30 slot; the repo has 661 test functions in 69 files and two tagged releases.
My role
Team of two developers, each directing Claude Code, which wrote most of the code. By commit history (159 of 242) my parts were the publishing engine and scheduler, the Railway deploy, the editorial direction, infographics, covers, event tracking, the first dashboard and the white-label kit; my co-developer built the original research-to-edit pipeline, the self-healing sentinel and the Telegram bot, and hardened the publishing ledger.