This repository holds a sample service written in Rust & Axum. The main intend to showcase production ready code with clearly defined architecture. This service follows the 12factor methodology.
- Basic architecture, hexagonal - swappable components
- HTTP routing using Axum
- Configurable logging format, JSON for log aggregation/KVP for local development (noone wants to read raw json logs)
- Configuration via environment vars (leverage config-rs)
- Error handling (basic)
- Error handling on Axum extractors
- Database layer - sqlx (SQL)
- Database migrations
- Payload validation Keats/validator
- Unit testing (basic)
- Integration testing (Testcontainers)
- Authentication (middleware JWT, oauth2)
- Service graceful shutdown
- Service health probe
- Service readiness probe
- Kafka client
- Distributed tracing
- Linting (cargo clippy works out of the box)
- Formatting (cargo fmt works out of the box)
- Use "Problem Details" standard for API error responses (https://tools.ietf.org/html/rfc7807)
- [Openapi spec]
- Gzip responses tower_http
- Http client usage [reqwest?]
- [Circuit Breaker]
- Docker-compose + depdendencies for local development