API-only MVP that turns an Instagram reel script into a Twitter/X thread (via Composio).
It stores jobs and platform post status in a simple SQLite DB.
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .envFill in .env:
GEMINI_API_KEY/GEMINI_MODEL(for content generation)COMPOSIO_API_KEY(for Twitter/X publishing)COMPOSIO_USER_ID(Composio user ID that has the connected Twitter account; defaults to "default")
uvicorn app.main:app --reloadHealth:
GET /api/v1/health
curl -X POST http://127.0.0.1:8000/api/v1/scripts?sync=true ^
-H "Content-Type: application/json" ^
-d "{\"title\":\"Test\",\"content\":\"Here is my reel script...\",\"metadata\":{\"topic\":\"AI\"}}"Response:
{ "job_id": "...", "status": "pending" }curl http://127.0.0.1:8000/api/v1/jobs/<job_id>curl -X POST http://127.0.0.1:8000/api/v1/jobs/<job_id>/preview?sync=truecurl -X POST http://127.0.0.1:8000/api/v1/jobs/<job_id>/publish?sync=true ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: demo-123" ^
-d "{\"publish\":true,\"generate_if_missing\":true,\"regenerate\":false}"python -m unittest discover -s tests -p "test_*.py"- For MVP reliability, jobs run via FastAPI
BackgroundTasks(non-durable). Use?sync=truewhile developing. - SQLite tables are auto-created on startup. Upgrade path is Postgres + migrations.