Build & Integrate
Blueprints & Schema Migrations
Declarative schema definitions for automated, non-destructive application provisioning on boot or deploy.
What are Blueprints?
A Blueprint is a JSON document declaring your application’s required collections, fields, and user authentication profile schema. When submitted to Pottr, the engine provisions missing collections and adds new fields automatically.
Additive, Non-Destructive Provisioning
Pottr provisioning is strictly additive:
- Existing collections and entries are never dropped or deleted.
- Existing fields retain their data.
- Any field defined in the blueprint that does not yet exist is safely added to the schema.
- The required primary
titletext field is automatically prepended if omitted.
Public vs Secret Provisioning Endpoints
| Endpoint | Required Credential | Typical Usage |
|---|---|---|
POST /auth/bootstrap | Public Key (pk_live_...) | Client-side web or mobile applications on initial boot. Rejects secret keys. |
POST /blueprint | Secret Key (sk_live_...) | CI/CD deployment pipelines, build scripts, backend provisioning. |
GET /blueprint/{app} | Public or Secret Key | Inspect live provisioned schema and version status. |
Blueprint JSON Specification
blueprint.json
{
"app": "task-manager",
"version": "1.0.0",
"auth": {
"slug": "users",
"name": "App Users",
"fields": [
{ "key": "full_name", "type": "text", "required": true },
{ "key": "avatar_url", "type": "text" }
]
},
"collections": [
{
"slug": "project",
"name": "Projects",
"fields": [
{ "key": "title", "type": "text", "required": true },
{ "key": "user_id", "type": "relation" }
]
},
{
"slug": "task",
"name": "Tasks",
"fields": [
{ "key": "title", "type": "text", "required": true },
{ "key": "project_id", "type": "relation", "target_collection": "project" },
{ "key": "completed", "type": "boolean" }
]
}
]
}Rules and Limits
- Collection slugs match
^[a-z][a-z0-9_-]*$; field keys match^[a-z][a-z0-9_]*$. - Auth fields can use the collection field types plus
select,email,urlandpassword. They describe the per-app user profile. - Provisioning is additive, so it is safe to run on every deploy or app boot.
- If your plan’s collection limit is reached part-way, provisioning succeeds partially. Check each item in the response.
Provisioning Response
Response
{
"app": "task-manager",
"version": "1.0.0",
"version_status": "new",
"auth": { "slug": "users", "status": "created" },
"results": [
{ "slug": "project", "status": "created" },
{ "slug": "task", "status": "existing" },
{ "slug": "report", "status": "failed", "code": "plan_limit_exceeded" }
]
}Each result is created, existing or failed. version_status tells you whether this app version is new, unchanged or older than the one Pottr already recorded.
GET /blueprint/{app} returns the recorded version, the auth snapshot, timestamps and the live schema of the collections that app manages.