Rustapi
๐ RESTful Rust API Template / Boilerplate
RESTful API template built with Rust lang. It uses [MongoDB](https://docs.mongodb.com/) database and [Axum](https://github.com/tokio-rs/axum) HTTP framework. The project is written primarily in Rust, first published in 2019. Key topics include: api, axum, boilerplate, mongodb, restful.
rustapi
RESTful API template built with Rust lang. It uses MongoDB
database and Axum HTTP framework.
Requirements
How to use this template
To use this template as your project starting point, click "Use this template" at the top of this page, or click here.
Feature highlights
- Authentication. Based on jsonwebtoken
- Layered configuration. Based on config-rs
- Logs. Based on tracing
- Error handling
- Pagination
- E2E Tests
- OpenAPI Specification
- CI based on Github actions
- Dependabot configuration
Project structure
bashโโโ 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
Test
To run tests make sure MongoDB is up and running.
make test
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.
Contributors
Showing top 9 contributors by commit count.
