AI-native social publishing infrastructure for creating, scheduling, predicting, and distributing content across 18 platforms from one API.
ContentFlow combines a FastAPI backend, Celery workers, Redis queues, OAuth account linking, and SDKs for Python and JavaScript. The project now includes:
Posts: publish or schedule content to multiple platforms from one request.Videos: trigger AI video generation throughyt-factoryand optionally auto-publish the result.Content Bombs: transform one topic into platform-specific variants with AI-assisted copy generation.Comments: collect comments and run AI-assisted reply workflows for supported platforms.Predict: score hooks, titles, and captions with viral heuristics plus A/B variant suggestions.Schedules: create timezone-aware recurring publish schedules with recommended posting windows.Accounts: connect OAuth providers and store tokens with AES-256 encryption.Analytics: fetch account-level and post-level performance summaries.Usage: expose billing-plan quotas and usage history for dashboarding.SDKs: first-party Python and JavaScript clients.Landing: production landing page and API docs site inlanding/, deployed on Vercel.
YouTube, TikTok, Instagram, X, LinkedIn, Facebook, Threads, Pinterest, Reddit, Bluesky, Snapchat, Telegram, WordPress, Google Business Profile, Naver Blog, Tistory, Kakao, and note.com.
- Create a local env file.
copy .env.example .env- Install backend dependencies.
pip install -e ".[dev]"- Start the full local stack.
docker compose up --build -d- Open the API docs.
http://localhost:8000/docs
- Run the quality checks.
ruff check .
pytest -qdocker compose up --build -d starts:
api: FastAPI application onhttp://localhost:8000worker: Celery worker for post, video, bomb, comment, and schedule jobsbeat: Celery Beat for periodic comment collection and schedule dispatchredis: broker and result backend
Useful commands:
docker compose ps
docker compose logs api --tail=100
docker compose downRun the API without Docker:
uvicorn app.main:app --reload --port 8000Run workers manually:
celery -A app.workers.celery_app.celery_app worker --loglevel=INFO
celery -A app.workers.celery_app.celery_app beat --loglevel=INFOLanding site:
cd landing
npm install
npm run devPython SDK:
pip install -e ./sdk/pythonJavaScript / TypeScript SDK:
npm install contentflow-sdkCreate a post:
curl -X POST http://localhost:8000/api/v1/posts \
-H "Content-Type: application/json" \
-H "X-API-Key: cf_live_replace_me" \
-d '{
"text": "Launching our new campaign across every short-form channel.",
"platforms": ["youtube", "tiktok", "instagram"],
"media_urls": ["https://cdn.example.com/video.mp4"],
"media_type": "video"
}'Generate a video with auto-publish:
curl -X POST http://localhost:8000/api/v1/videos/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: cf_live_replace_me" \
-d '{
"topic": "AI marketing workflow",
"mode": "marketing",
"language": "en",
"format": "shorts",
"style": "cinematic",
"auto_publish": {
"enabled": true,
"platforms": ["youtube", "tiktok"]
}
}'Score a hook:
curl -X POST http://localhost:8000/api/v1/predict/viral-score \
-H "Content-Type: application/json" \
-H "X-API-Key: cf_live_replace_me" \
-d '{
"platform": "youtube",
"title": "I tested 18 platforms with one topic",
"description": "Here is what scaled, what failed, and what changed the workflow."
}'Create a schedule:
curl -X POST http://localhost:8000/api/v1/schedules \
-H "Content-Type: application/json" \
-H "X-API-Key: cf_live_replace_me" \
-d '{
"name": "weekday shorts",
"platforms": ["youtube", "tiktok"],
"timezone": "KST",
"recurrence": "daily",
"time_of_day": "18:30"
}'APP_ENV: runtime environment such asdevelopmentorproductionAPP_NAME: FastAPI application nameAPP_HOST: bind host for local serverAPP_PORT: bind port for local serverLOG_LEVEL: application log verbosity
SUPABASE_URL: Supabase project URLSUPABASE_ANON_KEY: optional public client keySUPABASE_SERVICE_ROLE_KEY: backend service-role keySUPABASE_DB_URL: direct Postgres connection string for migrations or bootstrap tasks
REDIS_URL: default Redis URLCELERY_BROKER_URL: Celery broker URL, defaults toREDIS_URLCELERY_RESULT_BACKEND: Celery result backend URL, defaults to broker URL
API_KEY_PREFIX: generated API key prefix, usuallycf_liveAPI_KEY_BYTES: random-byte length used for key generation
TOKEN_ENCRYPTION_KEY: base64-encoded 32-byte AES-256 keyOAUTH_STATE_SECRET: CSRF/state secret for OAuth redirectsOAUTH_REDIRECT_BASE_URL: public base URL used to build OAuth callback URLsTOKEN_REFRESH_LEEWAY_SECONDS: refresh window before provider token expiry
YT_FACTORY_BASE_URL: upstream video generation service base URLYT_FACTORY_API_KEY: API key foryt-factoryYT_FACTORY_TIMEOUT_SECONDS: end-to-end generation timeoutYT_FACTORY_POLL_INTERVAL_SECONDS: polling interval for generation status
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETMETA_CLIENT_IDMETA_CLIENT_SECRETTIKTOK_CLIENT_KEYTIKTOK_CLIENT_SECRETX_CLIENT_IDX_CLIENT_SECRET
ANTHROPIC_API_KEY: Claude API key for Content Bomb, Comments, and Predict flowsANTHROPIC_MODEL: default Claude model nameANTHROPIC_API_BASE_URL: Anthropic API base URL overrideCOMMENT_POLL_INTERVAL_SECONDS: background polling interval for comment collection
RAILWAY_ENVIRONMENT: deployment environment label used by Railway-oriented config
Main route groups:
/api/v1/posts/api/v1/videos/api/v1/bombs/api/v1/comments/api/v1/predict/api/v1/schedules/api/v1/usage/api/v1/accounts/api/v1/analytics
Interactive docs:
http://localhost:8000/docshttp://localhost:8000/redoc
- Landing site root:
landing/ - Production site:
https://contentflow-lovat.vercel.app - API docs page in landing app:
https://contentflow-lovat.vercel.app/docs
ruff check .
pytest -q