Backend Development
Architecture
Laminar's development environment consists of three repositories:
| Repository | Description |
|---|---|
| laminar | Core stream processing engine (Rust) - API, Controller, Worker |
| laminar-frontend | Web UI (Next.js), documentation, CLI tool |
| laminar-infra | Infrastructure, Docker Compose, Kubernetes configs, monitoring |
Services and ports:
| Service | Port |
|---|---|
| API Server | 8000 |
| Controller | 8001 |
| Node | 8003 |
| Admin | 8004 |
Clone
git clone https://github.com/e6data/laminar.git
cd laminarBuild
cargo build --releaseConfiguration
The repo includes a laminar.toml config file that's automatically loaded when running from the repo root:
# laminar.toml (key sections)
[api]
bind-address = "0.0.0.0"
http-port = 8000
[controller]
bind-address = "0.0.0.0"
rpc-port = 8001
scheduler = "process"
[node]
bind-address = "0.0.0.0"
rpc-port = 8003
[admin]
bind-address = "0.0.0.0"
http-port = 8004
[database.postgres]
database-name = "laminar"
host = "localhost"
port = 5432
user = "laminar"
password = "laminar"Migrate
Run database migrations before starting the app:
cargo run -- migrateRun
# Starts Laminar in all-in-one cluster mode (workers run as processes)
cargo run -- clusterDocker
# Build image
task docker:build
# Build deps base image (slow)
task docker:build-deps
# Push to ECR
task ecr:login
task ecr:push # main image
task ecr:push-deps # deps imageVerification
Once the cluster is running, you can access:
| Endpoint | URL |
|---|---|
| API Server | http://localhost:8000 |
| Admin Status | http://localhost:8004/status |
| Admin Metrics | http://localhost:8004/metrics |
| Admin Config | http://localhost:8004/config |
| Admin Details | http://localhost:8004/details |
Regenerating SQL Code
When you modify SQL queries, regenerate the type-safe Rust code:
# For laminar-api
cargo run --manifest-path tools/sql-generator/Cargo.toml -- api
# For laminar-controller
cargo run --manifest-path tools/sql-generator/Cargo.toml -- controller