# quotesdb — Architecture ## Component Overview | Component | Directory | Description | |-----------|-----------|-------------| | API | `api/` | Rust/Axum backend on Cloudflare Workers. Handles all data operations via SQLx and Cloudflare D1. | | UI | `ui/` | Yew (Rust/Wasm) frontend on Cloudflare Pages. Communicates with the API over HTTP. | | Tests | `tests/` | Integration test crate. Spins up the API against in-memory SQLite and makes real HTTP requests. | | Infra | `infra/` | OpenTofu configuration for Cloudflare Worker, D1 database, and Pages project. | ## Component Interactions ``` Browser └──> Cloudflare Pages (quotesdb-ui) └──> Cloudflare Workers (quotesdb-api) └──> Cloudflare D1 (SQLite) ``` The UI is a static Wasm bundle served from Cloudflare Pages. It makes fetch requests to the Worker API, which reads and writes to a D1 database bound to the Worker. Integration tests bypass the UI and talk directly to the API over HTTP, using a local in-memory SQLite database.