Backend Boilerplate in Rust

LICENSE: MIT

A clean, modular, and scalable backend boilerplate written in Rust, featuring authentication, database caching, API routes, and observability — ideal for building secure and performant web services.

RustBackendAxumAuthenticationSeaORMWeb APICI/CDOAuthDDDBoilerplate

FEATURES

  • Clean domain-driven structure
  • Automatic Testing (Unit and Integration)
  • CI/CD Template for Automatic Deployment using GitHub Actions
  • On-code documentation using `cargo doc`
  • User registration, login, and JWT-based authentication
  • Google OAuth integration
  • Password reset and email verification flows
  • Account locking on repeated failed login attempts
  • Role-based user management (user/admin)
  • Database connection caching with SeaORM
  • HTTP routes with Axum
  • CORS and middleware support
  • Logging and error handling
  • Prometheus metrics integration

REQUIREMENTS

  • Rust 1.70+
  • PostgreSQL
  • Cargo installed
  • Environment variables set (or .env file)

ENVIRONMENT VARIABLES

  • DATABASE_URL
  • JWT_SECRET
  • ENCRYPTION_KEY
  • ALLOWED_ORIGINS
GITHUB