# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Commands ```bash cargo build # compile cargo run # run the server (reads .env automatically) cargo test # run all tests cargo test # run a single test by name cargo clippy # lint cargo fmt # format ``` ## Architecture Single-binary Actix Web API. Entry point is `src/main.rs`, which: 1. Loads `.env` via `dotenvy` at startup 2. Reads `APP_ENV` (`development` | `production`) and `PORT` from the environment 3. Binds to `127.0.0.1:` in development, `example.com:` in production 4. Registers all routes on the `HttpServer` Routes are registered as Actix handler functions decorated with `#[get(...)]` / `#[post(...)]` etc. and passed to `App::new().service(...)`. As the API grows, handlers should be split into modules under `src/` and re-exported for registration in `main`. ## Environment `.env` is read at runtime (not compile time). Required variables: | Variable | Values | |-----------|-------------------------------| | `APP_ENV` | `development` or `production` | | `PORT` | numeric port, e.g. `8000` | ## Rules 1. Never run or offer to run the program