Case study
AI creative platform for image, video, music and podcast generation
Backend developer · 2024 – present · live
One FastAPI service, sliced by feature rather than by layer. Each of the twenty-one packages carries its own routes, services, repositories, schemas and dependency-injection providers, so a feature can be read, tested and changed without touching the rest. Repositories sit behind interfaces and are resolved through an async container, which is what makes the service layer testable without a database.
A request to make a film or a track returns immediately with a pending message. The real work runs on Celery with late acknowledgements, so a worker dying mid-render puts the job back rather than dropping it, and retries back off exponentially up to ten minutes. Progress streams to the client over Socket.IO while FFmpeg normalises audio and converts video at the end.
A multi-shot film pipeline where the model plans the shots, the user approves the plan, and only then does the render start. The tricky part was the message contract. Reasoning, status, approval gates and finished media all arrive as typed content blocks in one stream, so the client renders each as its own bubble without guessing at the payload.
Credits are deducted atomically, and every grant path is idempotent, because Stripe and RevenueCat both retry webhooks and rewarded-ad callbacks can arrive twice. Signatures are verified on every hook. A reconciler walks subscriptions to catch anything the webhooks missed.
One Docker image, built with uv in a multi-stage build, serves both the web process and the Celery worker depending on how it is started. Helm charts deploy it to Kubernetes on AWS with horizontal autoscaling, and Istio handles mutual TLS and retries between services.