Constructive Platform
Server configuration, services/schemas, deployment, cloud functions, environment configuration, and the cnc CLI execution engine.
This is an operator/platform skill. Tenant application UI receives explicit public endpoints from its host; it must not use admin routing headers, derive sibling hosts, or fall through to operator APIs when RLS hides data. Use constructive-blocks for the tenant Console runtime.
When to Apply
Use this skill when:
- Starting the Constructive GraphQL server or GraphiQL explorer
- Configuring services, APIs, domains, and schema grants
- Deploying with Docker Compose or building Docker images
- Writing Knative cloud functions
- Configuring environment variables and config files
- Using the cnc CLI for queries and context management
Services & Schemas
- Create and configure API services, attach database schemas, set up domain/subdomain routing, and manage schema grants
- Entity hierarchy: Database > Schema > Api > ApiSchema, ApiModule, Domain, Site
- Full CRUD via ORM for Api, ApiSchema, ApiModule, Domain, SchemaGrant, and Site entities
See services-schemas.md for details. See services-schemas-entity-fields.md for the full field reference.
Deployment
- Local development with Docker Compose (Postgres, MinIO, application servers)
- Database deployment with pgpm: bootstrap roles, deploy modules, verify, and revert
- Docker image build process: multi-stage build, CLI shims (
constructive,cnc,pgpm) - Makefile targets, environment variables, networking, and troubleshooting
See deployment.md for details.
Server Configuration
- Running the Constructive GraphQL server (
cnc server), GraphiQL explorer (cnc explorer), and code generation (cnc codegen) - Operator API routing modes: public (domain-based) vs private admin (header-based), Services API routing
- The schema-to-GraphQL pipeline: PostgreSQL schemas > PostGraphile introspection > GraphQL API, with codegen available as an optional custom-domain step
See server-config.md for details.
Cloud Functions
- Build and deploy Knative-style TypeScript HTTP cloud functions (email, webhooks, background jobs)
- Function handler pattern:
export default async (params, context) => { ... }with GraphQL client access - Direct database access via
pg-cache, programmatic PGPM usage, Docker builds, and Kubernetes deployment
See cloud-functions.md for details.
Environment Configuration
- Unified, type-safe environment configuration for all Constructive and PGPM projects
- Two packages:
@pgpmjs/env(core) and@constructive-io/graphql-env(extends with GraphQL/API options) - Merge hierarchy: defaults > config file > env vars > runtime overrides
See env-config.md for details.
Sub-references:
- env-defaults.md — Default values for all configuration options
- env-vars.md — Source file locations for env vars and types
- env-config-file.md — Config file reference (
pgpm.json)
CNC CLI Execution Engine
- Execute raw GraphQL queries against Constructive APIs using the
cncCLI - Context management (create, list, switch, delete) similar to kubectl contexts, stored in
~/.cnc/config/ - Authentication: secure token storage, per-context credentials, expiration support
See cnc-cli.md for details.
References
| File | Content |
|---|---|
| server-config.md | Server, explorer, API routing, schema pipeline |
| services-schemas.md | Services, APIs, domains, schema grants |
| services-schemas-entity-fields.md | Full field reference for services entities |
| deployment.md | Docker Compose, pgpm deploy, image build |
| cloud-functions.md | Knative cloud functions |
| env-config.md | Environment configuration overview |
| env-config-file.md | Config file reference |
| env-defaults.md | Default values |
| env-vars.md | Environment variable reference |
| cnc-cli.md | CNC CLI execution engine |
Cross-References
- Blueprints (definition format, presets, construction):
constructive-blueprints - Auth (MFA, sessions, devices, service settings):
constructive-auth - Security (Constructive Authz, RLS, storage policies):
constructive-security - Background jobs:
constructive-jobs - Code generation:
constructive-codegen - Tenant application registry/runtime:
constructive-blocks