JSON Press
JSON Press is a self-hosted, stateless report renderer. Project site: https://jsonpress.dev.
A caller sends a
JSON template and its rows to POST /v1/renders; the server returns a PDF,
DOCX, XLSX or CSV download. Templates are plain JSON, the designer runs in the same
container, and the server needs no database and makes no outbound network
calls.
Quickstart
Build the image from this repository (Node builds the designer, Rust builds the server, and the runtime image contains only the binary and the built SPA):
docker build -t jsonpress:dev .
docker run --rm -e JSONPRESS_API_KEYS=local:dev -p 5000:5000 jsonpress:dev
JSONPRESS_API_KEYS is a comma-separated name:secret list; local:dev means the
key dev is owned by the name local. The server binds 0.0.0.0:5000 by
default.
| URL | What |
|---|---|
| http://localhost:5000/ | the designer |
| http://localhost:5000/healthz | {"status":"ok","version":"0.1.0"} |
| http://localhost:5000/openapi.json | the OpenAPI 3.1 contract |
The designer is served from /; open it, click Settings, and enter the
server URL and an API key. Everything you edit stays in the browser tab until
you download the JSON.
Render with curl
curl -sS http://localhost:5000/v1/renders \
-H 'Authorization: Bearer dev' \
-H 'Content-Type: application/json' \
-d '{
"template": {
"version": 2,
"name": "Hello",
"page": {"width_mm": 210, "height_mm": 297, "bottom_margin_mm": 15},
"title": [
{"kind": "text", "x_mm": 20, "y_mm": 20, "width_mm": 170,
"size_pt": 16, "bold": true, "color": "title", "expr": "\"Hello\""},
{"kind": "text", "x_mm": 20, "y_mm": 40, "width_mm": 170,
"size_pt": 9, "expr": "\"CUSTOMER\""}
],
"detail": {
"row_height_mm": 6, "first_row_y_mm": 50,
"columns": [
{"x_mm": 20, "width_mm": 170, "size_pt": 9, "expr": "CUSTOMER"}
]
},
"summary": []
},
"data": {"rows": [{"CUSTOMER": "Acme Ltd"}, {"CUSTOMER": "Beta Trading"}]},
"output": "pdf"
}' -o hello.pdf
output is pdf (default), docx, xlsx (or excel) or csv. A successful response
carries the document bytes plus Content-Type and
Content-Disposition: attachment; filename="hello.pdf".
The checked-in neutral fixture
crates/jsonpress-core/testdata/invoice.json
is a complete A4 invoice template and is used by the tests and the docs.
Documentation
- API reference — endpoints, auth, limits, errors.
- Template format — the document and band model.
- Expressions — the expression language.
- Integrating — curl, Node and Python examples.
- Node package — native bindings and custom JavaScript functions.
- Deploying — environment variables, proxy and health checks.
The server is self-hosted only; this repository does not include or describe a hosted service.