Run artifact

workspace/targets/FxRates/blueprint/ARCHITECTURE.md

ARCHITECTURE: FxRates Application

FieldValue
Version20261026 V1
DescriptionDefines the application modules and ownership boundaries for the FxRates command line and API.

Module Boundaries

ModuleOwnsAllowed dependencies
cliThe fxrates executable, argument handling, command dispatch, and diagnostics.Feature services, configuration
app_serverThe FastAPI application factory and HTTP route registration.Feature services, configuration
servicesECB CSV validation and loading, fetching, store initialization, rate queries, and exact decimal calculations.persistence, configuration, standard library
persistenceThe generated relational layer and shipped database library.Database engine and schema
configResolving the database location from DATABASE_URL, then DATABASE_PATH, then data/app.db.Standard library

HTTP handlers call services. CLI commands call services. Services call the generated persistence operations through the shipped persistence library. Only the persistence boundary reaches the database. No application module opens a database driver directly.

The load workflow validates the complete input file before its first write. The fetch workflow extracts the archive's CSV and passes it through the same validation and loading behavior. Rate calculations use decimal.Decimal; published values remain text in storage and API responses.

Technology Stack

TechnologyUse
Python 3.11 or newerApplication, CLI, services, and tests
FastAPIJSON HTTP API
uvicornServing the API on 127.0.0.1
SQLiteLocal rates store, accessed through the shipped persistence library
pytestOffline automated tests
FastAPI TestClientIn-process API checks

Programmatic Acceptance

=== AC architecture-service-boundary ===
Intent: The application provides an importable services boundary for shared CLI and API behavior.

import importlib.util

services_spec = importlib.util.find_spec("services") assert services_spec is not None === END AC architecture-service-boundary ===

User Acceptance

Guardrails