Skip to content

Developer Setup

Complete guide to setting up the full DRLS development environment.

Prerequisites

Tool Version Purpose
Java JDK 21 Spark JVM modules
Python 3.12+ Core runtime
Rust stable UI backend
Node.js 20+ React frontend
Maven 3.9+ JVM build

macOS (Homebrew)

brew install openjdk@21 python@3.12 rust node@20 maven

Clone and Build

git clone https://github.com/drls-io/drls.git
cd drls

1. JVM Modules

cd core
JAVA_HOME=/opt/homebrew/Cellar/openjdk@21/21.0.10/libexec/openjdk.jdk/Contents/Home \
  mvn clean package -DskipTests
cd ..

2. Python Package

cd python
pip install -e ".[dev]"
cd ..

3. Rust Workspace (Backend + Operators)

cd rust
cargo build --workspace
cd ..

Tip

The ui/backend symlink points to rust/crates/ui-server/, so cd ui/backend && cargo run still works for the dev workflow.

4. React Frontend

cd ui/frontend
npm install --legacy-peer-deps
npm run build
cd ../..

5. gRPC Stubs

drls grpc-codegen

Verify

# Python
python -c "import drls; print(drls.__version__)"

# Rust
cd rust && cargo test --workspace && cd ..

# Frontend
cd ui/frontend && npm run lint && cd ../..

# Unit tests
python -m pytest python/drls/tests/ -v -k "not end_to_end"

Development Workflow

Run the full stack locally with two terminals:

cd ui/backend
RUST_LOG=debug cargo run
Starts on port 3000. Embeds Python via PyO3.

cd ui/frontend
npm run dev
Starts on port 5173. Proxies /api to port 3000.

Open http://localhost:5173 for the management console.

Auth Configuration

By default, authentication is disabled (AUTH_ENABLED=false) and all endpoints are accessible without login. To enable auth:

AUTH_ENABLED=true AUTH_SECRET=your-secret-key cargo run

The first user to register is automatically granted the Admin role. Subsequent users default to Auditor and must be promoted by an admin.

Database

The backend uses SQLite by default (sqlite://drls.db). Migrations run automatically on startup (001–010). To use PostgreSQL instead:

DATABASE_URL=postgres://user:pass@localhost/drls cargo run

Running Tests

Python Unit Tests

python -m pytest python/drls/tests/ -v -k "not end_to_end"

End-to-End Tests

Requires a running Spark + Ray cluster:

JAVA_HOME=/path/to/jdk-21 DRLS_E2E=1 \
  python -m pytest python/drls/tests/test_streaming_e2e.py -v

Rust Tests

cd rust && cargo test --workspace

Frontend Lint + Build

cd ui/frontend
npx eslint .
npx prettier --check "src/**/*.{ts,tsx}"
npm run build

Linting

# Python
ruff check python/
ruff format --check python/

# Java/Scala
cd core && mvn checkstyle:check spotless:check -DskipTests

# Rust
cd rust && cargo clippy --workspace -- -D warnings

# Frontend
cd ui/frontend && npm run lint && npm run format:check

Documentation

pip install mkdocs-material pymdown-extensions
mkdocs serve  # Preview at http://localhost:8000
mkdocs build --strict  # Verify build