mirror of
https://github.com/thanipro/Axum-Rust-Rest-Api-Template
synced 2024-11-10 06:04:16 +00:00
No description
migrations | ||
src | ||
.env | ||
.env.example | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
README.md |
Axum-Rust-Api-Boilerplate
This project is an open source boilerplate built with Rust's Axum framework.
Why this project?
I have been learning rust for some time now and I noticed a lack of open source axum boilerplates that define directory structure the way I like and I'm used to. Most other projects have all the code placed in a single main.rs
file.
Features
This project uses Axum framework and SQLx for DB access layer, as well as other wonderful packages. It includes three basic routes: register, login, and profile page.
Getting Started
- Clone the project
- Update
.env
file with your DB credentials - Install
sqlx-cli
or runcargo sqlx database create
to create your DB - Run the migration file using
cargo sqlx migrate run
. This will run the migration file that exists in the migration folder in the root of the project. - Build the project and dependencies using
cargo build
- Run the project using
cargo run -- up
Contributing
Contributions are always welcome!