For development rules, see DEVELOPMENT.md
mae
Opinionated async Rust framework for building Mae-Technologies micro-services.
Features
- App scaffolding —
app::build,app::configuration,app::run: opinionated Actix-Web server setup with session middleware, tracing, and Redis - Repository layer —
repo: typed async CRUD helpers over SQLx/Postgres - Middleware —
middleware: session extraction, service-to-service auth, request context injection - Telemetry —
telemetry: structured JSON logging viatracing-bunyan-formatter - Test utilities (
test-utilsfeature) — TestContainer helpers for Postgres, Neo4j, Redis, RabbitMQ;must::*assertion helpers; env helpers
Usage
Add to Cargo.toml:
[]
= "0.1"
For test utilities:
[]
= { = "0.1", = ["test-utils"] }
Postgres test helper modes (test-utils)
Postgres test helpers support two modes:
- Container mode (
MAE_TESTCONTAINERS=1): startsghcr.io/mae-technologies/postgres-maevia testcontainers (existing behavior). - Fallback mode (default when
MAE_TESTCONTAINERSis unset/false): connects to an already-running Postgres.
Fallback mode uses safe defaults and allows env overrides:
MAE_TEST_PG_HOST(default127.0.0.1)MAE_TEST_PG_PORT(default5432)MAE_TEST_PG_DB(defaultmae_test)MAE_TEST_PG_USER(defaultapp)MAE_TEST_PG_PASSWORD(defaultsecret)MAE_TEST_PG_MIGRATOR_USER(defaultdb_migrator)MAE_TEST_PG_MIGRATOR_PASSWORD(defaultmigrator_secret)MAE_TEST_PG_SEARCH_PATH(defaultoptions=-csearch_path%3Dapp)
spawn_scoped_schema() and shared pool setup work in both modes.
For safety, fallback mode refuses database names that do not include _test.
License
MIT