BlocMarket Documentation

Technical documentation for the BlocMarket property assembly platform. This site provides API references, architecture guides, operational runbooks, and compliance artifacts.

Overview

BlocMarket is a full-stack property assembly platform built with Rust, Leptos, and PostgreSQL (PostGIS). It manages the end-to-end lifecycle of land assembly for renewable energy and property development projects in the United Kingdom.

ComponentTechnologyStatus
Backend APIAxum 0.8, SQLx 0.8, Rust 1.85+Stable
FrontendLeptos 0.7, WASMActive Dev
DatabasePostgreSQL 16, PostGIS 3.4Stable
MobileTauri (planned)Planned
InfrastructureDocker, Kubernetes, TerraformStaging

Key Metrics

MetricValue
Workspace Crates25 (22 library + 3 app)
Unit Tests3,447+
Line Coverage~71%
Clippy Warnings0 (pedantic + nursery)
Production unwrap()0
RUSTSEC Vulnerabilities0

Quick Start

Prerequisites

Clone and Build

git clone https://forgejo.wyattau.com/BlocMarket/BlocMarket_app.git
cd BlocMarket_app
make hooks          # Install pre-commit quality gates
cp bloc_market/.env.example bloc_market/.env
make db-start       # Start PostgreSQL via Docker Compose
make migrate        # Run database migrations
make test           # Run unit tests
make api            # Start API server on port 3000

Architecture

BlocMarket follows a modular monolith architecture with clear domain boundaries. Each crate encapsulates a business domain with its own types, services, and tests.

Core Platform

Authentication, user management, property listings, bidding, payments, notifications, geospatial services, and document management.

bloc-authbloc-usersbloc-propertiesbloc-bids

Expansion Products

Site Assembly, Rooftop Assembly, Nutrient Credits, SANOS, Section 106, BESS, Edge DC, Industrial Storage, Telecom Leases.

bloc-assembliesbloc-yield-typesbloc-gridbloc-developers

Infrastructure

Monitoring, health checks, metrics, alerting, error tracking, caching, and performance profiling.

bloc-monitoringbloc-integrationsbloc-enterprise

API Reference

The REST API follows OpenAPI 3.0 conventions with JSON:API-style response envelopes. All endpoints are versioned under /api/v1/.

Authentication

POST   /api/v1/auth/register     # User registration
POST   /api/v1/auth/login        # Email/password login
POST   /api/v1/auth/refresh      # JWT token refresh
POST   /api/v1/auth/logout       # Token invalidation

Core Resources

GET    /api/v1/properties        # List properties (paginated, filterable)
POST   /api/v1/properties        # Create property listing
GET    /api/v1/properties/:id    # Get property by ID
PATCH  /api/v1/properties/:id    # Update property
DELETE /api/v1/properties/:id    # Remove property

GET    /api/v1/blocs             # List blocs
POST   /api/v1/blocs             # Create bloc
POST   /api/v1/blocs/:id/formation/start
POST   /api/v1/blocs/:id/vote

GET    /api/v1/bids              # List bids
POST   /api/v1/bids              # Place bid

Health and Monitoring

GET    /api/v1/health            # Liveness probe
GET    /api/v1/health/ready      # Readiness probe
GET    /api/v1/metrics           # Prometheus metrics

Full API reference with request/response schemas is available in api_reference.md.

User Guide

Comprehensive user guide covering property creation, bloc formation, voting, bidding, and document management workflows. See user_guide.md.

Expansion Products

BlocMarket supports nine expansion product types beyond core property assembly:

ProductDescription
Site AssemblyContiguous land assembly for development
Rooftop AssemblyMulti-roof solar installation coordination
Nutrient CreditsTrading of Biodiversity Net Gain credits
SANOSStandalone or Networked Energy Storage
Section 106Planning obligation agreement management
BESSBattery Energy Storage Systems
Edge Data CentreEdge computing facility placement
Industrial Outdoor StorageLogistics and warehousing space
Telecom LeasesTelecommunications infrastructure rights

See expansion_products_guide.md.

Glossary

Domain terminology and abbreviations used throughout the platform. See glossary.md.

FAQ

Frequently asked questions about platform capabilities, data handling, and regulatory compliance. See faq.md.

Runbooks

Operational procedures for deployment, incident response, and system maintenance. See deployment_runbook.md.

Deployment

BlocMarket supports two deployment strategies:

Staging / VPS (Docker Compose)

# Using the production override
docker compose -f docker-compose.yml -f docker-compose.production.yml up -d

# Or the standalone production file
docker compose -f docker-compose.prod.yml up -d

Production / AWS (Kubernetes)

kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/secrets.yaml      # (after filling in values)
kubectl apply -f k8s/network-policies.yaml
kubectl apply -f k8s/services/
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/ingress.yaml

Monitoring

The observability stack includes Prometheus, Grafana, Loki (logs), Tempo (traces), and Alertmanager. Configuration is in the monitoring/ directory.

Alert Severities

SeverityResponse TimeExamples
P1 Critical15 minutesService down, data breach
P2 High1 hourElevated error rate, DB connection pool exhaustion
P3 Medium4 hoursDisk usage >80%, slow queries
P4 Low24 hoursNon-critical warnings, minor degradation

Standards Compliance

The platform enforces compliance with applicable standards across security, privacy, and data protection:

StandardScope
OWASP Top 10Web application security
NIST SP 800-53Security and privacy controls
GDPRData protection and privacy
ISO 27001Information security management
IEC 62443Industrial network security

Traceability

Full bidirectional traceability from requirements through architecture, implementation, and tests is maintained in TRACEABILITY_MATRIX.md. Architecture Decision Records are stored in .adrs/.


BlocMarket Documentation -- Generated from repository sources. Last updated 2026-05-18.