lofim / rust-axum-service-sample

A simple scaffold for a todo service in rust using axum

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Axum Service Sample

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.

Features

  • 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

Tooling

  • 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

Tool stack

About

A simple scaffold for a todo service in rust using axum


Languages

Language:Rust 100.0%