How Paprika is put together
Paprika is one image, run as several services, with PostgreSQL beside it. Each service is the same program started with a different command:
| Service | Command | What it does |
|---|---|---|
api |
api |
The generation API under /v1 (port 4179): templates, renders, jobs, batches, brand kits, keys and the admin API. Renders synchronous requests in its own threads. |
worker |
worker |
Runs queued jobs and batches and sends webhooks. Answers only its probes (port 4180). Run as many as you need. |
editor |
editor |
Serves the editor to browsers (port 4178) and forwards their /v1 requests to the API with its own key, so the browser holds none and stays on one address. |
migrate |
migrate |
Brings the database’s schema up to date, then exits. The API isn’t ready until it has. |
editor-key |
editor-key |
Gives the editor an API key, keeping the one it has while it works, then exits. |
db |
PostgreSQL | Every record: tenants, keys, templates and versions, jobs, usage, the audit log. |
The editor and the API render with the same engine: what a designer sees in the editor is what the API produces.
What is kept where
Section titled “What is kept where”- PostgreSQL holds the records. Every row names its tenant, and a tenant’s requests can read only its own rows (security).
- The data volume (
/data, shared byapiand everyworker) holds the bytes: uploaded fonts, images and colour profiles, template packages, records files and finished outputs, each under its tenant’s folder. - The keys volume (
/keys) holds the editor’s API key.
Nothing is sent anywhere else: Paprika fetches no images or fonts from the internet and reports usage to no one.
How a request flows
Section titled “How a request flows”- A designer publishes a template from the editor; the editor forwards it to the API, which keeps it as a new version.
- A system calls the API with its key: a synchronous render answers the file at once; a job or batch is queued.
- A worker claims the queued work in fair shares between tenants (scheduler), renders it, stores the output and sends the webhook.
- The output is downloaded with the key, or by a signed link that works without one until it expires.
The explanation pages say more about how rendering works and why the editor and the output agree.