Quick reference for all available make commands.
- Infrastructure Management
- Service Containers
- Build Commands
- CLI Tool
- Client SDK & Disk Cache
- Development Container
- Database & Tools
- Testing
- Cleanup
- Common Workflows
Complete project setup - creates directories and starts all infrastructure.
make devWhat it does:
- Creates project directories
- Starts Docker containers (PostgreSQL, Redis, Kafka, Prometheus, Grafana, etc.)
- Waits for all services to be healthy
- Verifies setup and displays access URLs
Start all infrastructure services in Docker.
make infra-upServices started: PostgreSQL, Redis, Kafka + Zookeeper, Prometheus, Grafana, StatsD Exporter, Kafka UI, pgAdmin
Stop all infrastructure services. Keeps volumes (data persists).
make infra-downRestart all infrastructure services.
make infra-restartFollow logs from all infrastructure services in real-time. Exit with Ctrl+C.
make infra-logsShow status of all running containers.
make infra-psVerify all services are healthy and display connection information.
make verifyBuild Docker images and start all three service containers (API, Distribution, Validation).
make servicesWhat it does:
- Builds each service using its multi-stage Dockerfile
- Starts containers with proper dependencies (waits for healthy postgres, redis, kafka)
- Services are accessible on ports 8081, 8082, 8083
Equivalent to: docker compose up --build -d api-service distribution-service validation-service
Stop all service containers.
make services-downBuild all service binaries locally (no Docker). Output goes to bin/.
make services-localOutput:
bin/api-servicebin/distribution-servicebin/validation-service
Rebuild and restart a single service:
docker compose up --build -d api-service
docker compose up --build -d distribution-service
docker compose up --build -d validation-serviceView logs for a single service:
docker compose logs -f api-service
docker compose logs -f distribution-service
docker compose logs -f validation-serviceThese work on the host machine (macOS/Linux) or inside the dev container.
Build everything locally - proto files, SDK, services, and CLI.
make allEquivalent to: make proto sdk services-local cli
Generate protobuf and gRPC code from .proto files.
make protoInput: proto/*.proto
Output: build/*.pb.{cc,h}, build/*.grpc.pb.{cc,h}
Build the API Service binary locally.
make api-serviceOutput: bin/api-service
Run locally:
./bin/api-service config/api-service-local.ymlBuild the Distribution Service binary locally.
make distribution-serviceOutput: bin/distribution-service
Run locally:
./bin/distribution-service config/distribution-service-local.ymlBuild the Validation Service binary locally.
make validation-serviceOutput: bin/validation-service
Run locally:
./bin/validation-service config/validation-service.ymlBuild the client SDK (shared and static libraries).
make sdkOutput:
lib/libconfigclient.so(shared library)lib/libconfigclient.a(static library)
Build the CLI tool (konfig).
make cliOutput: bin/konfig
Requires: Go toolchain and generated Go proto files
Build the client SDK (shared and static libraries).
Already documented above — see the
make sdkentry.
Build the disk cache test binary.
make cache-testOutput: bin/cache_test
Usage (host machine):
./bin/cache_test localhost:8082 payment-serviceUsage (inside dev container):
./bin/cache_test distribution-service:8082 payment-serviceSee Client SDK & Disk Cache for the full test walkthrough.
Build the example client application.
make exampleOutput: bin/simple_client
Remove all build artifacts (build/, bin/, lib/).
make cleanClean and rebuild everything.
make rebuildFormat all C++ source files using clang-format.
make formatCheck C++ formatting without modifying files.
make format-checkThe konfig CLI communicates with the API Service via gRPC.
./bin/konfig upload --service payment-service --file config.json --format json./bin/konfig get --id payment-service-v1./bin/konfig list --service payment-service./bin/konfig validate --service payment-service --file config.json --format json./bin/konfig delete --id payment-service-v1./bin/konfig status --id payment-service-v1./bin/konfig rollback --service payment-service --version 1| Flag | Description | Default |
|---|---|---|
-s, --server |
API server address | localhost:8081 |
-o, --output |
Output format: table, json, yaml | table |
-v, --verbose |
Verbose output | false |
./bin/konfig versionThe C++ SDK (libconfigclient) provides automatic reconnection and disk-backed config caching for client services.
# On host machine (macOS/Linux)
make clean && make proto && make sdk && make cache-test
# Inside dev container
make dev-sdk && make dev-cache-test# Step 1 — first run, no cache
./bin/cache_test distribution-service:8082 payment-service
# [CacheTest] Cache file exists : NO (first run)
# [Status] Connected to distribution service
# Step 2 — upload a config so the cache gets seeded
./bin/konfig upload --service payment-service --file examples/configs/valid-config.json --format json
# cache_test prints:
# >>> CONFIG UPDATE <<<
# version : 1
# [DiskCache] Saved config v1 for payment-service -> ~/.konfig/cache/payment-service.cache
# Step 3 — restart: cache loads before gRPC stream opens
./bin/cache_test distribution-service:8082 payment-service
# [CacheTest] Cache readable : YES (v1)
# >>> CONFIG UPDATE <<< ← from disk
# [Status] Connected to distribution service ← then live
# Step 4 — offline fallback (stop services first)
make services-down
./bin/cache_test distribution-service:8082 payment-service
# [CacheTest] Cache readable : YES (v1)
# >>> CONFIG UPDATE <<< ← served from disk
# [Status] Disconnected from distribution service
# [ConfigClient] Reconnecting in 5 seconds...
# Step 5 — corrupt cache is discarded
echo "garbage" > ~/.konfig/cache/payment-service.cache
./bin/cache_test distribution-service:8082 payment-service
# [CacheTest] Cache readable : NO (corrupt — will be discarded)
# [DiskCache] Parse failed ... — discarding
# [Status] Connected to distribution service ← falls back to liveHostname note: Use
distribution-service:8082from inside the dev container; uselocalhost:8082when running on the host machine.
ls -lh ~/.konfig/cache/
# payment-service.cacheThe dev container provides a Linux build environment with all C++ dependencies pre-installed.
Start the development container.
make dev-upStop the development container.
make dev-downEnter an interactive shell in the dev container (/workspace).
make dev-shellAvailable tools: g++, cmake, make, protoc, grpc_cpp_plugin, psql, redis-cli
Build the entire project inside the dev container.
make dev-buildBuild individual components inside the dev container.
make dev-proto # Generate proto files
make dev-sdk # Build client SDK libraries
make dev-example # Build bin/simple_client
make dev-cache-test # Build bin/cache_testClean build artifacts inside the dev container.
make dev-cleanBuild and run StatsD metrics test inside the dev container.
make dev-test-statsdOpen PostgreSQL interactive shell.
make db-shellUseful commands:
\dt -- List tables
\d config_metadata -- Describe table
SELECT * FROM config_metadata;
SELECT * FROM audit_log ORDER BY created_at DESC LIMIT 10;
\q -- QuitOpen Redis CLI.
make redis-shellUseful commands:
PING -- Test connection
KEYS * -- List all keys
KEYS validation:* -- List validation cache keys
FLUSHDB -- Clear current database
List all Kafka topics.
make kafka-topicsExpected topics: config.events, config.updates, config.health, config.audit
Open Kafka UI in browser at http://localhost:8080.
make kafka-uiOpen Grafana in browser at http://localhost:3000. Login: admin / admin.
make grafanaOpen pgAdmin in browser at http://localhost:5050. Login: admin@example.com / admin.
make pgadminFirst time: Add server with host postgres, database configservice, user configuser, password configpass.
Run all tests.
make testBuild and run StatsD metrics test (sends metrics for 10 seconds).
make test-statsdCheck results:
curl http://localhost:9102/metrics | grep test_Complete cleanup - stop all services and remove all Docker volumes.
make cleanupWARNING: This removes all data (databases, caches, metrics).
make dev # Start infrastructure
make services # Build and start service containers
make cli # Build CLI
./bin/konfig list --service test # Verifymake infra-up # Start infrastructure
make services # Build and start containers
docker compose logs -f api-service # Watch logs
# After code changes:
make services # Rebuilds and restartsmake infra-up # Start infrastructure
make services-local # Build binaries
./bin/validation-service config/validation-service.yml &
./bin/api-service config/api-service-local.yml &
./bin/konfig upload --service test --file config.json# Upload
./bin/konfig upload --service payment-service --file config.json --format json
# Verify
./bin/konfig list --service payment-service
./bin/konfig get --id payment-service-v1
# Validate only (no upload)
./bin/konfig validate --service payment-service --file config.json --format jsondocker compose logs -f api-service # Service logs
make db-shell # Check database
make redis-shell # Check cache
make kafka-topics # Check messaging
docker compose ps # Container status# Build SDK + test binary inside dev container
make dev-sdk && make dev-cache-test
# Run with services up (inside dev container shell)
make dev-shell
./bin/cache_test distribution-service:8082 payment-serviceSee Client SDK & Disk Cache for the full 5-step test sequence.
make cleanup # Remove everything
make dev # Start fresh| Service | URL | Credentials |
|---|---|---|
| API Service | localhost:8081 (gRPC) |
- |
| Distribution Service | localhost:8082 (gRPC) |
- |
| Validation Service | localhost:8083 (gRPC) |
- |
| Grafana | http://localhost:3000 | admin / admin |
| Prometheus | http://localhost:9090 | - |
| Kafka UI | http://localhost:8080 | - |
| pgAdmin | http://localhost:5050 | admin@example.com / admin |
| StatsD Metrics | http://localhost:9102/metrics | - |
| Service | From Host | From Container |
|---|---|---|
| PostgreSQL | localhost:5432 |
postgres:5432 |
| Redis | localhost:6379 |
redis:6379 |
| Kafka | localhost:9093 |
kafka:9092 |
| StatsD | localhost:9125 |
statsd-exporter:9125 |
Database credentials: configuser / configpass / configservice