Pyrite ITMenu Download the alpha
Documentation index

Documentation · Reference

The app.json manifest

Every app folder contains an app.json file. The engine reads it at startup to determine how to run the app. An Owner can edit the manifest in the app’s Configuration tab in the engine console.

01 /Example

This manifest belongs to “Parts price list”, the sample app in the agent standard. It is a PocketBase app with sign-in, two roles and the import tool. As the standard requires, technical identifiers are in English. Users see the name and description.

{
  "id": "parts-pricelist",
  "name": "Parts price list",
  "description": "Prices of the spare parts in the warehouse, updated from the supplier's Excel or CSV file.",
  "kind": "pocketbase",
  "access": "login",
  "port": 8105,
  "version": "0.1.0",
  "owner": "Spare parts warehouse",
  "auth": {
    "collection": "users",
    "roleField": "role",
    "roles": ["manager", "storekeeper"],
    "defaultRole": "storekeeper"
  },
  "tools": ["import"]
}

A static app that serves only pages and is open to everyone has a shorter manifest.

{
  "id": "guida-officina",
  "name": "Workshop guide",
  "kind": "static",
  "access": "public",
  "port": 8106,
  "version": "0.1.0",
  "owner": "Workshop"
}

02 /Fields

FieldValuesMeaning
idLowercase letters, digits and hyphensThe app’s stable identifier. If omitted, the engine uses the folder name. Ideally, the two match.
name requiredTextThe name shown in the portal and console.
descriptionTextA one-line description shown below the name in the portal.
kind requiredstatic, pocketbase, pocketbase-cronThe app type. See Values for kind.
accesspublic, loginpublic allows everyone in. login admits only people with an access grant. The default is login.
port required1024 to 64000The app’s public port. It must differ from the engine port and every other app’s port. The engine uses the public port plus 1000 as the internal port (8101 becomes 9101), so that port must also be available. Changing the port in the console automatically restarts the app. The port is a request: whoever uploads the app can choose another one if this one is busy or closed by the Windows firewall, and the engine writes the chosen port in the installed app.json. After the installation the port belongs to whoever manages Pyrite: an update of the app never changes it.
versionFor example, 0.1.0The version of the app code, for reference. The person delivering the app increments it with each release.
ownerTextThe team or contact person responsible for the app.
colorA hex color, for example #126a61The engine records this app color. To set the color actually used by the portal tile, open “Portal home” in the console. By default, tiles cycle through the available colors.
memoryLimitMBInteger, in MBThe memory limit for a PocketBase app’s process. On Windows this is a soft limit. The process is encouraged to stay within it and may keep running if it exceeds it. Changing the limit in the console restarts the app.
authObjectFor PocketBase apps with sign-in only. Specifies how the engine creates users in the app and where it writes their roles. See The auth section.
toolsList, for example ["import"]Engine tools available to the app’s scripts, such as the Excel and CSV import tool. You can also enable tools in the app’s Configuration tab under “Engine tools”. The full list is on the Tools page in the console and in the agent standard.
toolAccessObjectDefines which tools the app’s pages can use and who may use them (pages, minRole, destructiveRole, collections, maxRows, guests, recipes, snapshots, keyFields and others). Pages have no access to tools by default.
toolJobs{ "heavy": 1 }, from 1 to 4The number of long-running jobs launched by pages that may run concurrently. Defaults to 1.
concurrency"strict" (default), "warn", "off"Protects against conflicting edits when two people update the same record at once. With "warn", edits go through and the engine counts the ones "strict" would stop; "off" turns the protection off.
numbering, history, imagesObjectsRules for the numbering, change history and photo tools, keyed by field (collection.field).
network{ "allow": ["api.example.com"] }Specifies the addresses app scripts may call. allow permits HTTPS, while allowHttp also permits HTTP for internal systems only. Without network, scripts cannot call any address. In the app’s Outbound network tab the administrator can switch it to “Warn” mode: all calls pass and the engine counts the ones it would block.
importobject, for example { "consoleCollections": ["suppliers", "orders"] }The only collections in which the console’s “Import” tab may import and undo; [] = none; without it, all of them. For an app that keeps its data in order with its own routes or hooks (movements, histories, states).

03 /Values for kind

ValueMeaning
staticPages served directly by the engine from release\public. There is no app instance or database.
pocketbaseA dedicated PocketBase instance with its own pages, hooks, migrations and data.
pocketbase-cronLike pocketbase, with scheduled tasks defined in hooks. The engine starts it the same way. Monitor its scheduled jobs on the console’s “Scheduled jobs” page. “New app” in the console creates only the first two types.

04 /The auth section

This section applies to PocketBase apps with login access. When a person enters from the portal, the engine creates or updates a user with the same email address inside the app. On first sign-in the engine assigns the base role. After that, roles are managed in the app or through “Access and roles” in the console. The auth section tells the engine where to write these values.

FieldMeaning
collectionThe app’s user collection. Defaults to users.
roleFieldThe field on the user record that stores the role. The engine writes the base role there on first sign-in. Changes in “Access and roles” update that same field. It has no default. Without it, you cannot assign roles.
rolesThe available roles, from highest to lowest privilege. Groups determine who can enter the app. Roles are managed within the app, independently of group membership.
defaultRoleThe base role assigned on first sign-in. It must be one of the listed roles. If omitted, the least privileged role is used.
extraFixed fields that the engine sets on the user record at each sign-in. Rarely needed. New apps do not require them.

The sample app has two roles, manager and storekeeper, stored in the role field. New users start as storekeepers.

"auth": {
  "collection": "users",
  "roleField": "role",
  "roles": ["manager", "storekeeper"],
  "defaultRole": "storekeeper"
}

An app migration creates the role field with the same values as roles. When a role is added to the manifest later, the engine adds it to the field’s allowed values. If a role is removed from the manifest, the field still accepts it so existing users can continue signing in. The console stops offering it for new assignments.

When you create a PocketBase app with sign-in and roles in the console, the engine writes the auth section and adds the role field to the app’s users.

05 /Code layout

apps\<id>\
├── app.json            the manifest
├── app.json.prima      previous manifest version after a console edit
├── release\            code, replaceable independently of the data
│   ├── public\         static app pages
│   ├── pb_public\      PocketBase app pages
│   ├── pb_hooks\       hooks (PocketBase JavaScript)
│   └── pb_migrations\  schema migrations
├── state\
│   └── pb_data\        data, excluded from the delivery package
└── logs\               process output

A static app needs only app.json and release\public.

06 /Reserved engine paths

The engine handles these paths on every app port. Reserve them for the engine when building your app.

PathPurpose
/__platform/portalRedirects to the portal. Use this link for the “Portal” button inside apps.
/__platform/infoReturns JSON with the app identifier, app name and portal address.
/__platform/sso, /__platform/sso.jsUsed for single sign-on. The engine automatically includes the script in pages served by PocketBase apps with sign-in.
/__platform/logoutRedirects to the portal to sign out.
/_/Redirects to the app’s Data tab in the engine console, where you manage its data.

The engine rejects PocketBase administrator calls on app ports (/api/collections/_superusers/…). Use the engine console for administration.

07 /Engine validation

The engine reads app manifests at startup and when an Owner selects “Rescan folders”. It rejects a manifest if any of the following applies.

New folders also undergo the “New app” checks. The identifier must be 3–32 characters long, unreserved and unused by any other app. If access has a value other than public or login, the app requires sign-in.

An invalid manifest does not stop a registered app. It keeps running with its last valid manifest and the engine reports the issue. The engine disables the app only when its folder disappears. Warnings appear in the “Rescan folders” message and in the engine history. When you create an app in the console, the engine also checks that roles contain only lowercase letters, digits and underscores.

08 /Rules for app developers

The agent standard contains the full rules, code examples and pre-delivery checklist. The main points are listed below.