Skip to main content
Version: 1.0

Synkronus Server Development

Complete guide for developing the Synkronus server component.

Prerequisites

  • Go 1.22+
  • PostgreSQL 12+
  • Git

Local Development Setup

Step 1: Clone Repository

git clone https://github.com/OpenDataEnsemble/ode.git
cd ode/synkronus

Step 2: Install Dependencies

go mod download

Step 3: Set Up Database

# Create database
createdb synkronus

# Or using psql
psql -U postgres -c "CREATE DATABASE synkronus;"

Step 4: Configure Environment

Create .env file:

PORT=8080
DB_CONNECTION=postgres://user:password@localhost:5432/synkronus?sslmode=disable
JWT_SECRET=dev-secret-change-in-production
LOG_LEVEL=debug
APP_BUNDLE_PATH=./data/app-bundles
MAX_VERSIONS_KEPT=5
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin

Step 5: Create Directories

mkdir -p data/app-bundles

Step 6: Run Server

go run cmd/synkronus/main.go

Or build and run:

go build -o bin/synkronus cmd/synkronus/main.go
./bin/synkronus

Development Workflow

Hot Reload

Use tools like air for hot reload:

go install github.com/cosmtrek/air@latest
air

Testing

go test ./...

API Documentation

View OpenAPI docs:

# Server must be running
open http://localhost:8080/openapi/swagger-ui.html

Building for Production

Build Binary

go build -o bin/synkronus cmd/synkronus/main.go

Cross-Platform Builds

GOOS=linux GOARCH=amd64 go build -o bin/synkronus-linux cmd/synkronus/main.go

Docker Development

Using Docker Compose

docker compose up -d

Development with Hot Reload

Mount source code for live updates.