Installation
This page covers system requirements, infrastructure setup, and building every component from source.
System Requirements
| Dependency | Version | Installation |
|---|---|---|
| Docker & Docker Compose | Docker 24+, Compose v2 | docker.com/get-started |
| Go | 1.25 | go.dev/dl |
| Node.js | 20 LTS | nodejs.org |
| npm | 10+ | Ships with Node.js 20 |
| golang-migrate | v4 | github.com/golang-migrate/migrate |
| psql (PostgreSQL client) | 16+ | Included with PostgreSQL or install standalone via your package manager |
| golangci-lint (optional) | 1.59+ | golangci-lint.run |
macOS (Homebrew)
brew install go node@20 golang-migrate postgresql@16 golangci-lint
brew install --cask dockerLinux (Ubuntu/Debian)
# Go
wget https://go.dev/dl/go1.25.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.25.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
# Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# golang-migrate
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz
sudo mv migrate /usr/local/bin/
# PostgreSQL client
sudo apt-get install -y postgresql-client
# Docker
# Follow https://docs.docker.com/engine/install/ubuntu/Infrastructure Setup (Docker Compose)
The Docker Compose file at deployments/docker-compose.yml provides the full infrastructure stack for local development.
Start Infrastructure
cd application
make docker-upThis starts:
| Container | Image | Port | Purpose |
|---|---|---|---|
datafly-postgresql | postgres:16-alpine | 5432 | Primary data store |
datafly-redis | redis:7-alpine | 6379 | Caching, identity store, rate limiting |
datafly-kafka | confluentinc/cp-kafka:7.6.0 | 9092 | Event streaming |
datafly-zookeeper | confluentinc/cp-zookeeper:7.6.0 | 2181 | Kafka coordination |
datafly-kafka-ui | provectuslabs/kafka-ui:latest | 8090 | Kafka browser UI |
Verify Health
docker compose -f deployments/docker-compose.yml psAll services should show healthy status. Kafka typically takes 30-45 seconds to become healthy after starting.
Stop Infrastructure
make docker-downTo stop and remove all data volumes (clean slate):
docker compose -f deployments/docker-compose.yml down -vThe -v flag deletes all persisted data including the PostgreSQL database. You will need to re-run migrations and seed data after a volume reset.
Database Setup
Run Migrations
Apply all pending migrations to create the schema:
make migrate-upThis connects to PostgreSQL at localhost:5432 with the default credentials (datafly/datafly) and applies every SQL migration in database/migrations/.
Roll Back
To roll back the most recent migration:
make migrate-downCreate a New Migration
make migrate-create name=create_my_tableThis generates a pair of files in database/migrations/: NNNNNN_create_my_table.up.sql and NNNNNN_create_my_table.down.sql.
Seed Development Data
make seedThe seed script (database/seeds/dev_seed.sql) inserts a sample organisation, admin user, source, and integrations suitable for local development.
Building from Source
All build commands are run from the application/ directory.
Build All Go Services
make buildThis compiles all six Go services and outputs binaries to the bin/ directory:
bin/
ingestion-gateway
event-processor
delivery-workers
identity-hub
management-apiBuild a Single Service
make build-ingestion-gateway
make build-event-processor
make build-delivery-workers
make build-identity-hub
make build-management-apiGo Module Structure
Each service is a separate Go module with its own go.mod. The shared library at shared/ is referenced via a replace directive:
application/
shared/ # github.com/datafly/shared
ingestion-gateway/ # github.com/datafly/ingestion-gateway
event-processor/ # github.com/datafly/event-processor
delivery-workers/ # github.com/datafly/delivery-workers
identity-hub/ # github.com/datafly/identity-hub
management-api/ # github.com/datafly/management-apiEach service’s go.mod includes:
replace github.com/datafly/shared => ../sharedThis allows local development without publishing the shared module. In CI/CD and production Docker builds, the replace directive is removed and replaced with a versioned dependency.
Build the Management UI
make build-uiThis runs npm run build inside management-ui/, producing a Next.js standalone output suitable for Docker deployment.
For local development with hot reload:
cd management-ui
npm install
npm run devThe UI runs on http://localhost:3000.
Build Datafly.js
make build-datafly-jsThis runs the Rollup build inside datafly-js/, producing:
dist/datafly.umd.js— UMD bundle for script tag usagedist/datafly.esm.js— ES module bundle for npm/bundler usage
The built file is under 8KB gzipped (currently ~4.2KB).
Docker Images
Build Docker images for all services:
make docker-buildImages are tagged with the ghcr.io/datafly/ registry prefix by default. Override with:
make docker-build DOCKER_REGISTRY=your-registry.com/datafly IMAGE_TAG=v1.0.0Running Tests
# All Go services
make test
# Lint all Go services
make lint
# Format all Go services
make fmtEnvironment Variables
All services share a common configuration pattern loaded from environment variables. See the Configuration reference for the full list.
For local development, the defaults connect to the Docker Compose infrastructure with no additional configuration required.
Cleanup
Remove all build artefacts:
make cleanThis deletes the bin/ directory, Next.js build caches, and Datafly.js dist output.