Skip to content
AI startersAI starter

FastAPI + Postgres + Redis worker

A Python API that hands slow jobs to a background worker.

A FastAPI service and a worker sharing one PostgreSQL database, with a Redis list as the job queue: the API enqueues, the worker processes and records results. Both deploy from the same workspace; the AI builder continues from it.

Smallest plan
Starter
Storage
2 GiB
Apps
2
Databases
2
What it deploys

One project, ready for the AI to build on.

What the FastAPI + Postgres + Redis worker template deploys
On the internet
  • AddressHTTPS addressYour own domain when you add one
Runs
  • Web serviceFastAPI web serviceBuilt from the project's code · Nano · 128 MiB
  • WorkerQueue workerBuilt from the project's code · Nano · 128 MiB
Keeps data in
  • DatabasePostgreSQL databasePostgreSQL 16 · Nano · 128 MiB · 1 GiB disk
  • CacheRedis job queueRedis 7 · Nano · 128 MiB · 1 GiB disk
The plan it fits
Starter$15 a month

Needs 2 vCPU · 512 MiB memory · 2 GiB storage.

  • Daily backups, kept 7 days
  • 1 custom domain
  • Alerts by email
Backups

This starter keeps its data in the project's database, which is backed up daily like any other on plans with backups.

Security
  • Database passwords and any secret the app needs are generated for this project and stored encrypted; none is a default you have to change.
  • Passwords stay hidden on the stack page until you reveal them, and every reveal is audited.
  • It runs in your account's own Kubernetes namespace, behind a network policy that keeps other tenants out; its databases are reachable only from inside unless you open them.
  • Containers run without privilege escalation and with the default seccomp profile, and the app is served over HTTPS.

When the project is ready

  • APIlink
  • Interactive API docslink

What you get

Two apps from one workspace and the two databases they share: a FastAPI web service that accepts jobs, and a worker that takes them off a Redis list, runs them and writes results to PostgreSQL. It is the shape most real backends grow into — anything slow or flaky moves out of the request — set up and deployed before the AI writes your first job.

The API answers POST /jobs with a queued job and serves interactive API docs at /docs; the worker runs a sample job kind you replace with yours. Ask the AI for the real work ("fetch each submitted URL and store its title"), and it adds a handler, redeploys both apps and checks a job end to end.

How it runs

  • Web service: Uvicorn serving FastAPI on the platform's port, with a health check that does not touch the database.
  • Worker: the same image started with another command. It has no port and no public address, and it restarts on its own if it crashes.
  • PostgreSQL for jobs and their results; Redis as the queue. The project's environment holds both URLs and the queue's name, so both apps read the same settings.

Growing it

Add job kinds as plain Python functions. Run more worker replicas when the queue grows; Redis hands each job to one of them. Add a cron job to the project when something must run on a schedule — a nightly clean-up, a daily report.

Or say it in a sentence.

The AI deploys the same template, asks for anything it needs, and can set up a domain or alerts while it is at it.

Enter to start · Shift + Enter for a new line
FAQ

Questions, answered.

Why a worker instead of FastAPI background tasks?

Background tasks die with the web process and compete with requests for its memory. A separate worker keeps the API responsive, survives redeploys of the API, and scales on its own.

Can I use Celery or RQ instead?

Yes. The starter uses a plain Redis list to stay small, but you can ask the AI to switch to the queue library you prefer; the Redis database works with any of them.

Where do I see what the worker does?

On the worker's page: its live logs, CPU and memory, and Kubernetes events such as restarts. The AI reads the same logs when you ask why a job failed.

Is my data backed up?

PostgreSQL holds the jobs and their results and is backed up daily on plans that keep backups. The Redis queue is working state; jobs still in it are lost if Redis is lost, so record anything important in PostgreSQL.

Do I own the code?

Yes. Browse and download the workspace at any time; it is ordinary FastAPI and Python.

Start building on a starter that works.

Every template creates its apps, databases, storage, secrets and backups together, sized to fit your plan.