Skip to content

fcdev

fcdev is the local development binary: the whole platform in one process, with its own PostgreSQL, ready to use with no Docker and no setup. It runs the same orchestrator as fc-server (server.Run) with development defaults, so what you test locally is the production code path; the differences are in what surrounds it. It is also the command-line tool for functions, ingestions, the outbox relay, MCP and remote profiles.

Installing and first use are covered in install and run fcdev; every command and flag is in the fcdev CLI reference. This page explains how it is built.

flowchart TB
  subgraph P["fcdev process"]
    PG[("Embedded PostgreSQL 18<br/>:15432")]
    API["Platform API, console, OIDC<br/>:8080"]
    STR["Stream processor"]
    SCH["Dispatch scheduler"]
    SJ["Scheduled-job scheduler"]
    RT["Router"]
    PUSH["Push gateway"]
    FN["Function runner<br/>:8095, public :8096"]
  end
  ING["Ingestor runtime<br/>(Java child process) :8091"]
  SCH -->|"queue_messages"| PG
  RT -->|"polls queue_messages"| PG
  RT -->|"/api/dispatch/process"| API
  ING -->|"runtime API"| API
  FN -->|"control plane"| API
Part Default Flag (variable)
Platform API and console on, :8080 --api-port (FC_API_PORT)
Metrics :9090 --metrics-port (FC_METRICS_PORT)
Embedded PostgreSQL 18 on, :15432 --embedded-db, --embedded-db-port, --embedded-db-path (FC_EMBEDDED_DB*)
Dispatch scheduler on --scheduler (FC_SCHEDULER_ENABLED)
Scheduled-job scheduler on --scheduled-job (FC_SCHEDULED_JOB_ENABLED)
Stream processor on --stream (FC_STREAM_PROCESSOR_ENABLED)
Router on --router (FC_ROUTER_ENABLED)
Push gateway on (PostgreSQL log) --push (FC_PUSH_ENABLED)
Function runner on, :8095, public entry :8096, 256 MB --functions, --functions-port, --functions-public-port, --functions-memory-mb
Ingestion routes on FC_INGESTION_ENABLED
Ingestor runtime (child process) on when ingestion is on, :8091 --ingestor, --ingestor-port (FC_INGESTOR_*)
Outbox relay for the platform’s own database off --outbox (FC_OUTBOX_ENABLED)
MCP over HTTP off --mcp (FC_MCP_ENABLED)

Flags win over environment variables, which win over the defaults. With --database-url (FC_DATABASE_URL) fcdev uses that PostgreSQL instead of starting its own.

The router learns its queues and pools from a configuration document in development exactly as in production. fcdev points FLOWCATALYST_CONFIG_URL at its own /api/dispatch/router-config, and because no FC_DISPATCH_QUEUE_TYPE is set the document names PostgreSQL-backed queues in the embedded database. The dispatch scheduler publishes to the same queue_messages table. The only difference from an SQS deployment is the queue type inside the document; the names, pools and delivery path are identical.

fcdev also re-derives every URL that depends on the API port (the delivery callback, the token issuer, the router’s config URL and the function runner URL), so an instance on another port does not call back into whatever happens to listen on 8080.

  1. Write a PID file (used by fcdev stop) and install signal handlers before PostgreSQL starts, so an interrupt during boot still stops the database cleanly instead of orphaning it.

  2. Start the embedded PostgreSQL (or connect to --database-url) and run the migrations.

  3. Default the bootstrap administrator to admin@flowcatalyst.local / DevPassword123! / Local Admin (existing environment values win). fc-server never does this.

  4. Make sure a JWT signing key and an application key (FLOWCATALYST_APP_KEY) exist, created once and kept beside the embedded database directory, so tokens and encrypted client secrets survive restarts. fc-server requires both to be supplied.

  5. Seed, then bootstrap local credentials, each an OAuth client with exactly the roles it needs, re-secreted and role-reconciled on every start:

    Client Used by Role
    MCP client fcdev mcp and --mcp platform:super-admin; secret written to mcp-credentials.json in the user cache directory
    Router client The in-process router fetching its configuration document platform:router
    Function runner client The in-process runner’s control plane platform:function-runner
    fn CLI client fcdev fn ... against this instance platform:super-admin; written where the CLI finds it
    fcdev-ingestor The ingestor child platform:ingestion-runtime and platform:function-runner; secret only in the child’s environment

    A failed bootstrap is logged and fcdev carries on without that part.

  6. Apply the development overrides and call server.Run.

Setting fcdev fc-server
X-FC-Test-Principal header Accepted (call /api without a token) Refused unless APP_ENV is local or test
Debug endpoints (/router/debug/) On, still authenticated Off
Ingestion On Off
Outbound delivery guard Loopback and private targets allowed (metadata and link-local still blocked) Both refused
Function artifacts file:// under the user data directory FC_FUNCTIONS_ARTIFACT_STORE
Router mediator Production settings unless FLOWCATALYST_DEV_MODE The same

Each override is applied only when the matching variable is unset, so an explicit setting always wins.

When ingestion and the ingestor are both on, fcdev runs the Java ingestor runtime as a child process:

  • Jar. FC_INGESTOR_JAR if set; else the newest locally built ingestor/ingestor-runtime/target/ingestor-runtime-*-all.jar when fcdev runs from a checkout; else a pinned, checksummed release. No runtime release is pinned yet, so outside a checkout without FC_INGESTOR_JAR fcdev logs one line and starts without the ingestor.
  • Java. fcdev never uses the machine’s Java. It downloads its own Eclipse Temurin JRE of the required major version on first use (about 55 MB, checksum verified, installed atomically) into FC_INGESTOR_JRE_DIR.
  • State. The generated config/application.yaml, ingestor.log (truncated on each start) and the PID file live in FC_INGESTOR_STATE_DIR, one directory per API port.
  • Lifecycle. The child is stopped before the database goes away; a port already in use, a missing jar or a failed download only means no ingestor.

The runtime also hosts JVM functions, so fcdev points the jvm runtime’s runner URL at it. See ingestion under fcdev and the ingestor runtime.

What Default location
Embedded database <user data dir>/flowcatalyst/embedded-pg (never /tmp)
JWT signing key, application key Beside the embedded database directory
Function artifacts <user data dir>/flowcatalyst/functions/artifacts
Ingestor state <user data dir>/flowcatalyst/fcdev-ingestor/api-<port>
fcdev’s Java <user cache dir>/flowcatalyst/fcdev-jre
Ingestor extensions ~/.flowcatalyst/ingestor-extensions
MCP credentials <user cache dir>/flowcatalyst-dev/mcp-credentials.json (FC_MCP_CREDENTIALS_PATH)
fn CLI credentials The user cache directory (FC_FN_CLI_CREDENTIALS_PATH)
Profiles <user config dir>/flowcatalyst/profiles.toml (FC_PROFILES_PATH)

The user data directory is $XDG_DATA_HOME, else the OS application-data directory (~/Library/Application Support on macOS, %AppData% on Windows, ~/.config on Linux).

Resetting. fcdev fresh --yes truncates every FlowCatalyst table (the schema and the migration ledger stay) and re-seeds; it leaves tables that belong to your application alone, and starts the embedded database itself if needed. --embedded-db-reset wipes the data directory before starting. fcdev db upgrade re-initialises the embedded database onto the PostgreSQL major version this fcdev embeds.

Two fcdevs can run side by side (an end-to-end test suite beside your own instance) if everything per-instance is separated:

  • a different --api-port, --metrics-port, --embedded-db-port and --embedded-db-path, and --functions-port, --functions-public-port and --ingestor-port;
  • its own FC_INGESTOR_STATE_DIR (and optionally FC_INGESTOR_JRE_DIR);
  • its own FC_MCP_CREDENTIALS_PATH and FC_FN_CLI_CREDENTIALS_PATH, or a separate HOME, because the bootstrap rewrites the credential files in the shared cache directory and would otherwise overwrite your own instance’s.

See run an isolated platform for end-to-end tests.

Command What it is for
fcdev outbox The outbox relay for an application’s own PostgreSQL or MySQL / MariaDB database, posting to a platform (local or remote) with the application’s service-account credentials; fcdev outbox create-table creates outbox_messages. See outbox processor, including running it in production
fcdev fn ... Scaffold, build, run, publish, promote and trace functions; fcdev fn dev serves a function on the real runner with hot reload
fcdev updates ... Over-the-air updates for Expo phone apps the platform serves itself. keygen makes a signing key and the certificate the app embeds; certificate prints the local instance’s development certificate; publish <export-dir> uploads an expo export and publishes it to a branch (app, app key, channel, runtime version; --rollout for a share of phones); list and branches show what is live; rollout <updateId> <percent>, republish <updateId> and rollback (to the previous update, or --to-embedded) steer a branch. binaries publish|inspect|list|has handle the Android APKs people sideload, and links create|replace|remove|list manage the install links they download them from. It connects like fcdev fn, through a profile or the local instance’s credential
fcdev install postgis Adds PostGIS to the embedded PostgreSQL: downloads the add-on this fcdev pins (built for the embedded PostgreSQL major, core extension only), checks its SHA-256 and unpacks it into the embedded server’s tree. Then run CREATE EXTENSION postgis in a database. It may run while fcdev start runs, and does nothing if the add-on is already installed. Add-ons exist for macOS (arm64, amd64) and Linux with glibc (amd64, arm64); --archive installs a local build instead. On other platforms add PostGIS by hand: add PostGIS to the embedded Postgres
fcdev ingest ... List, apply, export and version ingestion definitions
fcdev mcp The MCP server over stdio (or --http); see MCP server
fcdev profile ..., fcdev login Named remote platforms. A profile authenticates either as a person (--login: browser sign-in with PKCE, the session in the OS keychain, at most 7 days) or as a client (a client id with the secret held by reference: keychain, environment variable, file or command), never with a secret in the profile file. fcdev fn refuses a non-loopback platform without a profile
fcdev init Bootstrap a fresh environment: an administrator, a default client and a .env
fcdev stop, fcdev upgrade, fcdev version Stop a running instance gracefully; update to the latest release (FC_DEV_UPGRADE_REPO); print the version
fcdev A production deployment
Processes One, plus the ingestor child Split by tier as you choose; see fc-server
Database Embedded PostgreSQL 18, near-empty Your PostgreSQL, with real data volumes (plain migrations are fine here; production follows the online rules)
Queue PostgreSQL queue_messages SQS FIFO, NATS JetStream or PostgreSQL
High availability None; every subsystem is its own leader FC_STANDBY_ENABLED with Redis
Keys and bootstrap admin Generated and defaulted Supplied by you
Authentication shortcuts Test header accepted Refused