Quickstart
This runs the whole stack on one machine: Postgres, the API, one render worker and the web app. For production setups, see Self-hosting.
1. Start the stack
Section titled “1. Start the stack”Follow Docker Compose › Start. The examples below assume the app is on http://localhost:8080.
2. Create the admin account
Section titled “2. Create the admin account”Open the app and sign up. The first account becomes an admin.
Anyone who signs up after that has no roles, so they can sign in but do nothing until an admin grants a role under Admin > Users. See Concepts: roles.
3. Render a PDF in the app
Section titled “3. Render a PDF in the app”Open Developers › Render playground. It takes the same request the API does, field by field: HTML, CSS, theme, header and footer, page options and Liquid data. Preview mode renders without logging. Rendering for real logs a generation you can find under Developers › My generations.
4. Create an API key
Section titled “4. Create an API key”Under Developers › API keys, create a key with the render:html scope. Copy the secret (it starts with nd_); it’s shown once. For a system rather than a person, an admin can create a service account under Admin › Service accounts and give the key to it instead. See API keys and errors.
5. Render a PDF with curl
Section titled “5. Render a PDF with curl”export NECODOC_API_KEY=nd_...curl -H "x-api-key: $NECODOC_API_KEY" -H 'Content-Type: application/json' \ -d '{"html":"<h1>Hello {{ name }}</h1>","data":{"name":"world"}}' \ -o hello.pdf -D - \ http://localhost:8080/api/v1/renderThe response headers include X-Generation-Id and X-Page-Count, and the render shows under Developers › My generations with your key’s name. Add "response":"json" to get the generation id and a download link instead of the bytes. See HTML to PDF.
Developers › API reference in the app lists every endpoint and can send requests with your key.
- Templates and Liquid: build a template with fields and a guided form.
- Headers, footers and page tokens.
- Roles and scaling: add workers.