Skip to content

Installation

ToolVersionNotes
Rust1.85+Install via rustup
Docker24+For PostgreSQL + PostGIS
Docker Composev2+Included with Docker
Trunklatestcargo install trunk (for Leptos WASM builds)
sqlx-cli0.7+cargo install sqlx-cli (for manual migrations)
Node.js20+Optional, for tooling
ToolPurpose
Nix + direnvReproducible dev shell
cargo-denyDependency auditing
cargo-llvm-covCode coverage
gitleaksSecret scanning
Terminal window
git clone https://forgejo.wyattau.com/BlocMarket/BlocMarket_app.git
cd BlocMarket_app/bloc_market
Terminal window
docker compose up -d db

This starts PostgreSQL 16 with PostGIS. The container’s port 5432 is host-mapped to 5434:

ServiceHost PortContainer Port
PostgreSQL 16 + PostGIS54345432
Redis 763806379
API (Axum)8090 (local dev)3000 (Docker)
Frontend (Trunk)8080

Migrations are applied automatically on API startup. To run them manually:

Terminal window
DATABASE_URL=postgres://postgres:postgres@localhost:5434/bloc_market sqlx migrate run

Or generate offline metadata so builds don’t require a live database:

Terminal window
../scripts/generate-sqlx-offline.sh
export SQLX_OFFLINE=true
Terminal window
cargo build --workspace
Terminal window
cargo run -p bloc-api

The API starts on http://localhost:8090. Watch the logs for:

Running migrations...
Applied N migrations
Listening on 0.0.0.0:8090

Verify with:

Terminal window
curl http://localhost:8090/health
curl http://localhost:8090/health/db
curl http://localhost:8090/health/redis
curl http://localhost:8090/ready

In a separate terminal:

Terminal window
trunk serve --open apps/web

This compiles the Leptos WASM frontend and serves it on http://localhost:8080.

The local environment is configured in bloc_market/.env (git-ignored). Key variables:

VariableRequiredNotes
DATABASE_URLYespostgres://postgres:postgres@localhost:5434/bloc_market for local Docker
REDIS_URLYesDefault redis://127.0.0.1:6380
JWT_SECRETYesMinimum 32 characters — generate with openssl rand -base64 48
JWT_EXPIRATIONNoDefault 24h
CORS_ALLOWED_ORIGINSYesComma-separated. Include http://localhost:8080
SMTP_HOST / SMTP_PORT / SMTP_USERNAME / SMTP_PASSWORDRecommendedRequired for email verification
STRIPE_SECRET_KEYNoLeave unset for stub mode
RUST_LOGNoDefault info

See the Deployment guide for the full reference.