When to use this approach
Run services individually from source when you need to:- Develop or debug a specific microservice with live reload
- Step through service code with a debugger
- Test changes before building a Docker image
- Run a subset of services while keeping others in Docker
Prerequisites
- Node.js 18.17.0 or later
- pnpm (installed globally)
- NestJS CLI
- Docker (for running PostgreSQL and NATS)
- A clone of the repository
Setup
Configure environment variables
.env and set all required values. At minimum, the following must be configured before any service will connect successfully:DATABASE_URL— PostgreSQL connection stringNATS_URL— e.g.nats://0.0.0.0:4222REDIS_HOSTandREDIS_PORT- All
*_NKEY_SEEDvariables for the services you plan to run PLATFORM_ADMIN_EMAILCRYPTO_PRIVATE_KEYKEYCLOAK_DOMAIN,KEYCLOAK_REALM,KEYCLOAK_MANAGEMENT_CLIENT_ID,KEYCLOAK_MANAGEMENT_CLIENT_SECRET
Start PostgreSQL
Start a local PostgreSQL instance using Docker:Update
DATABASE_URL in .env to match:Start NATS
Pull and run the NATS message broker:NATS listens on:
4222— client connections6222— cluster routing8222— HTTP monitoring
Seed initial data
The seed script populates org roles, agent types, ledger configs, platform config, and the platform admin user. It reads master data from This is equivalent to running the
prisma/data/credebl-master-table.json.seed container in the Docker Compose deployment.Start the API gateway
Open a terminal and start the API gateway. Use The gateway binds to
--watch to enable live reload during development:http://0.0.0.0:5000. The Swagger UI is available at http://localhost:5000/api.Start each microservice
Open a separate terminal window for each service. Start them in the order shown below, as later services depend on earlier ones being available on NATS.The full set of services and their commands:
| Service | Command |
|---|---|
| API gateway | nest start [--watch] |
| User | nest start user [--watch] |
| Organization | nest start organization [--watch] |
| Connection | nest start connection [--watch] |
| Issuance | nest start issuance [--watch] |
| Verification | nest start verification [--watch] |
| Ledger | nest start ledger [--watch] |
| Agent provisioning | nest start agent-provisioning [--watch] |
| Agent service | nest start agent-service [--watch] |
organization and utility are not listed in the README’s start sequence but are part of the platform. Start utility before connection, and organization before verification and agent-provisioning.NATS authentication (NKEY seeds)
Each microservice authenticates to NATS using an NKey seed defined in.env. Set a unique seed for each service:
.env
NATS_AUTH_TYPE in .env. Supported values are nkey, creds, usernamePassword, and none. For local development, nkey is the default.
Accessing endpoints
Once the API gateway and at least theuser service are running, navigate to:
Monitoring logs
Eachnest start process writes structured logs to stdout. For production-like log aggregation, set the following in .env:
.env
.env