Skip to content

API Overview

The DPG API lives in apps/api. It is a Fastify service that uses the network schema as runtime contract for item validation, inter-instance reads, action creation, action events, and schema discovery.

  • validates requests with Zod through fastify-type-provider-zod
  • exposes OpenAPI and Scalar docs at /api/reference
  • stores items, actions, and events in PostgreSQL
  • uses Redis for short-lived fetch caches
  • loads network configs from local files, remote URLs, or schema registry URLs
  • validates item_state, action requirements, and event payloads with JSON Schema
  • supports one backend serving one or many network/domain bindings
  • supports cross-instance item fetch and action/event mirroring
PageUse it for
Running And DockerLocal commands, Docker image, and runtime env
AuthAuth middleware behavior and Better Auth mount points
ItemsCreate, fetch, update, validation, ownership, and partitions
Network FetchInter-instance item fetch, count/fetch local endpoints, and caching
Actions And EventsAction creation, target-side storage, status updates, event mirroring
Schemas And CacheNetwork schemas, custom schemas, cache refresh, and schema routes
Route ReferenceCompact list of mounted API endpoints
GET /
/api/auth/*
/api/v1/item/*
/api/v1/action/*
/api/v1/event/*
/api/v1/network/*

The root endpoint returns service health plus the served domain bindings and network config source.

  • protected routes require auth unless local development disables auth middleware
  • production always enables auth middleware
  • SERVED_DOMAINS decides which network/domain pairs an instance may serve
  • network-wide fetch relies on instances[] in the network config
  • action validation relies on actions[<name>].interactions
  • the current UI focuses on connect, but the API can accept any configured action type