Flow

Local development

Start Postgres and RabbitMQ, migrate, seed principals, and run Go services natively.

Stateful dependencies run in Docker Compose. Go services run on the host with go run or Make targets.

Prerequisites

  • Docker (Compose)
  • Go 1.26+ (see .mise.toml)
  • Node 22.13+ and pnpm 11 (for this portal only)

Start the stack

make dev-up

This starts Postgres and RabbitMQ and waits for healthchecks.

Databases

ServiceDatabaseRole
accountingaccountingaccounting / accounting
templatetemplatetemplate / template
Adminanypostgres / postgres

Adding a service means extending scripts/init-databases.sh. Because that script runs only on an empty Postgres volume, recreate the volume when adding a database:

docker compose down -v && make dev-up && make migrate

Run services

make migrate
make dev-seed        # principals for Cedar authz in dev
make dev             # accounting on :8080
make dev-template    # template on :8081, Swagger at /api-docs

make dev and make dev-template are separate targets because a foreground go run cannot become two processes.

Try accounting

curl -s -X POST localhost:8080/v1/accounts \
  -H 'X-Dev-Actor: fid_dev_controller' \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{"chart_code":"us","code":"10000","name":"ASSETS","classification":"asset","is_postable":false}' | jq

Try template

curl -s -X POST localhost:8081/v1/domain1 \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{"data":{"value":"hello"}}' | jq

Authorization is not wired in the template service yet.

See docs/local-dev.md for the full reference including RabbitMQ management UI and database clients.

On this page