How norri/rust-examples works
axum-postgres System Design
• HTTP Server Layer (Axum Framework)
• Domain Layer
• Data Access Layer
• PostgreSQL Database
b. Internal Structure:
• Server Component:
• Routes (/server/routes.rs)
• Handlers (todos_create, todos_list, todos_update, todos_delete)
• Extractors (auth_basic, request_json)
• OpenAPI Documentation
• Domain Layer:
• Todo Domain Logic
• Error Handling
• Common Types
• Data Sources:
• PostgreSQL Implementation
• Memory Database (for testing)
• Database Models
c. Flow Directions:
• HTTP requests flow from client → server → domain → data layer → database
• Error handling flow back through the layers
axum-prometheus System Design
a. Main Components:
• Axum Web Server
• Prometheus Metrics Collector
• Prometheus Server
• Grafana Dashboard
b. Monitoring Flow:
• Metrics Collection Path
• Data Scraping Flow
• Visualization Pipeline
Key Relationships to Highlight
For axum-postgres:
• Authentication flow through extractors
• CRUD operations flow for todos
• Database abstraction layer with both Postgres and in-memory implementations
• Migration handling
For axum-prometheus:
• Metrics collection points
• Prometheus scraping endpoints
• Grafana dashboard data flow
Technical Details
Annotations showing:
• Technology stack: Rust, Axum, PostgreSQL
• Key dependencies and versions
• Configuration sources
• Docker container boundaries
• Network ports and protocols
Deployment Context
A separate deployment view showing:
• Docker container organization
• Network isolation
• Volume mounts
• Service discovery
Remember to:
• Use consistent styling and naming
• Version information
• Document any assumptions or constraints
This architecture should emphasize the clean separation of concerns in both examples while showing how they implement different aspects of modern web service architecture: one focusing on data persistence and API design, the other on observability and monitoring.