/rust_api

🚀 RESTful Rust API template

Primary LanguageRust

rustapi

Tests

RESTful API template built with Rust lang. It uses MongoDB database and Axum HTTP framework.

Requirements

How to

To use this template as your project starting point, click "Use this template" at the top of this page, or click here.

Features

  • Authentication. Based on jsonwebtoken
  • Layered configuration system. Based on config-rs
  • Logs. Based on tracing
  • Error handling
  • CI Jobs based on Github actions
  • E2E Tests
  • Dependabot configuration

Project structure

├── Cargo.lock
├── Cargo.toml
├── README.md
├── config
│   ├── default.json    # Default configuration
│   ├── production.json # Production configuration (Overwrites the default)
│   └── test.json       # Test configuration (Overwrites the default)
├── rustfmt.toml
├── src
│   ├── database.rs
│   ├── errors.rs
│   ├── lib             # Helpers not related to the business model
│   │   ├── authenticate_request.rs
│   │   ├── date.rs
│   │   ├── mod.rs
│   │   ├── models.rs   # Base Database Model trait
│   │   ├── to_object_id.rs
│   │   └── token.rs
│   ├── logger.rs
│   ├── main.rs
│   ├── models
│   │   ├── cat.rs
│   │   ├── mod.rs
│   │   └── user.rs
│   ├── routes
│   │   ├── cat.rs
│   │   ├── mod.rs
│   │   ├── status.rs
│   │   └── user.rs
│   ├── settings.rs
│   └── tests           # E2E Tests
└── test.sh

Contributing

Contributors are welcome, please fork and send pull requests! If you find a bug or have any ideas on how to improve this project please submit an issue.