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.
| Component | Technology | Status |
|---|---|---|
| Backend API | Axum 0.8, SQLx 0.8, Rust 1.85+ | Stable |
| Frontend | Leptos 0.7, WASM | Active Dev |
| Database | PostgreSQL 16, PostGIS 3.4 | Stable |
| Mobile | Tauri (planned) | Planned |
| Infrastructure | Docker, Kubernetes, Terraform | Staging |
Key Metrics
| Metric | Value |
|---|---|
| Workspace Crates | 25 (22 library + 3 app) |
| Unit Tests | 3,447+ |
| Line Coverage | ~71% |
| Clippy Warnings | 0 (pedantic + nursery) |
| Production unwrap() | 0 |
| RUSTSEC Vulnerabilities | 0 |
Quick Start
Prerequisites
- Rust 1.85+ (stable toolchain)
- PostgreSQL 16 with PostGIS 3.4
- Docker and Docker Compose
- Trunk (for WASM frontend builds)
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-bidsExpansion Products
Site Assembly, Rooftop Assembly, Nutrient Credits, SANOS, Section 106, BESS, Edge DC, Industrial Storage, Telecom Leases.
bloc-assembliesbloc-yield-typesbloc-gridbloc-developersInfrastructure
Monitoring, health checks, metrics, alerting, error tracking, caching, and performance profiling.
bloc-monitoringbloc-integrationsbloc-enterpriseAPI 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:
| Product | Description |
|---|---|
| Site Assembly | Contiguous land assembly for development |
| Rooftop Assembly | Multi-roof solar installation coordination |
| Nutrient Credits | Trading of Biodiversity Net Gain credits |
| SANOS | Standalone or Networked Energy Storage |
| Section 106 | Planning obligation agreement management |
| BESS | Battery Energy Storage Systems |
| Edge Data Centre | Edge computing facility placement |
| Industrial Outdoor Storage | Logistics and warehousing space |
| Telecom Leases | Telecommunications 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
| Severity | Response Time | Examples |
|---|---|---|
| P1 Critical | 15 minutes | Service down, data breach |
| P2 High | 1 hour | Elevated error rate, DB connection pool exhaustion |
| P3 Medium | 4 hours | Disk usage >80%, slow queries |
| P4 Low | 24 hours | Non-critical warnings, minor degradation |
Standards Compliance
The platform enforces compliance with applicable standards across security, privacy, and data protection:
| Standard | Scope |
|---|---|
| OWASP Top 10 | Web application security |
| NIST SP 800-53 | Security and privacy controls |
| GDPR | Data protection and privacy |
| ISO 27001 | Information security management |
| IEC 62443 | Industrial 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.