Skip to main content
Version: 1.0

Building & Testing

Complete guide to building ODE components from source and running tests.

Building from Source

Formulus

Build the React Native mobile application:

cd formulus
npm install
npm run android  # For Android
npm run ios      # For iOS (macOS only)

Formplayer

Build the React web form renderer:

cd formulus-formplayer
npm install
npm run build

Build for React Native:

npm run build:rn

This builds and copies the output to the Formulus app.

Synkronus

Build the Go server:

cd synkronus
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

Synkronus CLI

Build the CLI:

cd synkronus-cli
go build -o bin/synk ./cmd/synkronus

Testing

Frontend Testing

Formulus

cd formulus
npm test

Runs Jest tests with React Native Testing Library.

Formplayer

cd formulus-formplayer
npm test

Runs Jest tests for React components.

Backend Testing

Synkronus

cd synkronus
go test ./...

Run all tests:

# With coverage
go test -cover ./...

# Verbose output
go test -v ./...

# Specific package
go test ./internal/handlers

Integration Tests

# Run integration tests (requires database)
go test -tags=integration ./...

End-to-End Testing

End-to-end testing infrastructure is under development. Current testing focuses on:

  • Unit tests for individual components
  • Integration tests for API endpoints
  • Component tests for React components

E2E testing will be added as the testing infrastructure evolves.

Code Quality Checks

Linting

Frontend:

# Formulus
cd formulus
npm run lint
npm run lint:fix

# Formplayer
cd formulus-formplayer
npm run lint
npm run lint:fix

Backend:

# Synkronus
cd synkronus
golangci-lint run  # If configured

Formatting

Frontend:

# Format code
npm run format

# Check formatting
npm run format:check

Backend:

# Format Go code
go fmt ./...

# Check with goimports
goimports -w .

CI/CD Pipeline

The project uses GitHub Actions for continuous integration:

Workflows

Synkronus Docker Build:

  • Triggers on push to main or PRs affecting synkronus/
  • Builds Docker image
  • Publishes to GitHub Container Registry
  • Tags: latest, v{version}, {branch-name}

Frontend Quality Checks:

  • Runs on all PRs
  • Checks linting and formatting
  • Runs tests
  • Builds components

Local CI Simulation

Run CI checks locally:

# Frontend
cd formulus && npm run lint && npm run format:check && npm test
cd formulus-formplayer && npm run lint && npm run format:check && npm test

# Backend
cd synkronus && go test ./... && go fmt ./...

Docker Builds

Synkronus Docker Image

Build locally:

cd synkronus
docker build -t synkronus:local .

Multi-platform build:

docker buildx create --name multiplatform --use
docker buildx build --platform linux/amd64,linux/arm64 -t synkronus:local .

Release Process

Versioning

ODE follows semantic versioning (MAJOR.MINOR.PATCH):

  • MAJOR: Breaking changes
  • MINOR: New features (backward compatible)
  • PATCH: Bug fixes (backward compatible)

Creating a Release

  1. Update version numbers in:

    • package.json (frontend projects)
    • versioninfo.json (Go projects)
    • Documentation
  2. Create release branch:

git checkout -b release/v1.0.0
  1. Update changelog

  2. Create tag:

git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0
  1. CI/CD will automatically:
    • Build Docker images
    • Publish to container registry
    • Create GitHub release

Troubleshooting Build Issues

Node Modules Issues

# Clear and reinstall
rm -rf node_modules package-lock.json
npm install

Go Module Issues

# Clean module cache
go clean -modcache
go mod download
go mod tidy

Android Build Issues

# Clean Android build
cd android
./gradlew clean
cd ..
npm run android

iOS Build Issues

# Clean pods
cd ios
rm -rf Pods Podfile.lock
bundle exec pod install
cd ..
npm run ios