Architecture¶
Climate-Lama is a backend-first climate risk assessment platform built around two deployable units and a clean dependency hierarchy.
Deployable units¶
Core Service (FastAPI)
: HTTP API, data ingest, catalog, and business logic. Exposes all /v1/ endpoints.
Compute Worker (Celery)
: Async job execution via the climate-lama-engine adapter. Reads jobs from Redis, writes
results to MinIO.
Storage¶
| Component | Role |
|---|---|
| PostgreSQL + PostGIS | Metadata, user data, job records |
| MinIO (S3-compatible) | Hazard/exposure files, job results |
| Redis | Job queue and result cache |
Module structure¶
src/climate_lama/
api/ # HTTP layer only — no business logic
core/ # Business logic — no HTTP, no DB queries
models/ # Pydantic + SQLAlchemy models
db/ # Session management and repositories
storage/ # MinIO/S3 abstraction
worker/ # Celery tasks and engine adapter
Dependency rules¶
api/callscore/, neverdb/directlycore/callsdb/repositories/for data accessworker/is independent — communicates via Redis queue and shared DB- No circular imports — dependency flows downward
- CLIMADA is never imported in the backbone (see ADR-024)
Further reading¶
- Technical Reference — complete data models, endpoint inventory, security
- Decisions (ADRs) — all architectural decisions with context and rationale