gillchristian / rustapi

πŸš€ RESTful Rust API template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

πŸš€ RESTful Rust API template


Languages

Language:Rust 99.2%Language:Shell 0.8%