Getting Started
Prerequisites
- Bun >= 1.0
- FFmpeg (system-installed)
- CMake + build tools (for native ONNX deps)
- A local LLM endpoint (e.g. Ollama + LiteLLM) if using the
messagesvideo format
Installation
bash
git clone https://github.com/tadeasf/themaincharacterfiles.git
cd themaincharacterfiles
bun installConfiguration
bash
cp .env.example .envEdit .env with your settings. See the Configuration guide for all options.
At minimum, set:
TARGET_SUBREDDITS— which subreddits to scrapeVIDEO_FORMAT—classic(narrated) ormessages(iMessage style)TIKTOK_EMAIL/TIKTOK_PASSWORD— for publishing
TikTok Login
First-time setup requires interactive browser login to solve the CAPTCHA:
bash
BROWSER_HEADLESS=false bun run scripts/tiktok-login.tsSession state is saved to ./data/browser-state/ and reused on subsequent runs.
Running
Development
bash
bun run devOpens http://localhost:3000/dashboard for the monitoring UI.
Production
bash
bun run build
bun run startTesting a Pipeline Run
Use the e2e scripts to verify your setup:
bash
# Video generation only (no publish)
bun run scripts/e2e-video-test.ts
# Full pipeline including TikTok publish
bun run scripts/e2e-pipeline-test.tsBoth scripts prompt you to choose between classic and messages pipeline formats.
Project Structure
src/
├── app.module.ts # Root NestJS module
├── main.ts # Bootstrap
├── config/ # Zod-validated configuration
├── common/ # Shared types, utils, filters
└── modules/
├── browser/ # Camoufox lifecycle
├── dashboard/ # Monitoring UI + API
├── health/ # Health check endpoints
├── llm/ # LLM conversation rewriting
├── message-renderer/ # iMessage-style video rendering
├── pipeline/ # Orchestrator + scheduler
├── publisher/ # TikTok upload automation
├── reddit/ # Reddit scraping
├── storage/ # SQLite persistence
├── tts/ # Kokoro TTS + Whisper alignment
└── video/ # FFmpeg video composition