QFind anything/
API Reference

Development Environment

Local setup, environment variables, and running the API.

Prerequisites

  • Node.js 24.x — from the service repo root: nvm use (reads .nvmrc)
  • NODE_AUTH_TOKEN / GitHub Packages — for @sequel-de/* installs. Prefer npm config set //npm.pkg.github.com/:_authToken … locally. Docker/CI inject the token only during npm ci (see service root README).
  • Docker and Docker Compose — PostgreSQL, Redis, LedgerMatch, Keycloak
  • Embeddings — LedgerMatch needs embeddings:
    • Ollama (default in Docker) — no API key; Compose pulls mxbai-embed-large
    • OpenAI — set OPENAI_API_KEY and EMBEDDING_PROVIDER=openai for LedgerMatch

Option A: Full Docker (recommended)

cp .env.example .env
# Set EBICS_KEY_ENCRYPTION_KEY (32+ chars) if you use EBICS
export NODE_AUTH_TOKEN=ghp_…   # required to build the API image

docker compose up --build
  • API: http://localhost:8000
  • Swagger: http://localhost:8000/api/docs

The payment-reconciler container runs migrations, Keycloak realm setup, seed, and npm run start:dev.

Option B: Hybrid (Docker for deps, local API)

docker compose up -d payment-reconciler-db ledger-match-db redis keycloak keycloak-db ollama ledger-match

cp .env.example .env
# DATABASE_URL → localhost:5433, REDIS_URL → localhost:6379
# Ensure GitHub Packages auth is configured (npm config set …/_authToken …)

nvm use
npm install
npm run prisma:generate
npm run prisma:migrate
npm run keycloak:setup-realm   # Optional
npm run prisma:seed            # Optional
npm run start:dev

Environment variables

VariableRequiredDescription
DATABASE_URLYesPostgreSQL (e.g. postgresql://postgres:postgres@localhost:5433/paymentreconciler)
REDIS_URLYesRedis for BullMQ and cache
LEDGER_MATCH_API_URLYesLedgerMatch REST URL (e.g. http://localhost:9000)
JWT_SECRETYesJWT signing secret (dev: any string)
AUTH_MODENokeycloak (typical), both, or other — see .env.example / README
EBICS_KEY_ENCRYPTION_KEYFor EBICS32+ character key wrapping EBICS key material at rest
NODE_AUTH_TOKENInstall/buildGitHub Packages auth for @sequel-de/* (CI/Docker secret; not Nest runtime)
OPENAI_API_KEYWhen using OpenAILedgerMatch embeddings if EMBEDDING_PROVIDER=openai
KEYCLOAK_URLWhen AUTH_MODE=keycloakKeycloak base URL
KEYCLOAK_REALMNoDefault: sequel
KEYCLOAK_CLIENT_IDNoDefault: payment-reconciler-client
PORTNoAPI port (default: 8000)
LOG_LEVELNoinfo, debug, etc.
CACHE_ENABLEDNoEnable Redis cache (default: true)

See .env.example for the full list.

Useful commands

CommandPurpose
npm run prisma:studioOpen Prisma Studio
npm run prisma:migrateRun migrations (dev)
npm run prisma:migrate:deployRun migrations (prod/deploy)
npm run prisma:seedSeed initial data
npm run keycloak:setup-realmConfigure Keycloak realm and client
npm run start:devStart API with watch
npm testUnit tests
npm run test:e2eE2E tests (requires Redis + PostgreSQL)

Swagger and health

  • Swagger UI — http://localhost:8000/api/docs
  • Health — http://localhost:8000/api/health
  • LedgerMatch health — http://localhost:8000/api/health/ledger-match

Next steps