Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/smoke-trees/rust-backend-template

A rust backend template initialized with clean architecture.
https://github.com/smoke-trees/rust-backend-template

backend clean-archi diesel rest-api rocket rust slog

Last synced: 1 day ago
JSON representation

A rust backend template initialized with clean architecture.

Awesome Lists containing this project

README

        

rust-backend-template

Frameworks used:

- Rocket - For managing the REST API
- Diesel - ORM that supports psql, mysql etc.
- slog - For logging


Steps to use:


- First install diesel_cli by using: `cargo install diesel`
- Initialize your new rust project with the template by using:

`git clone https://github.com/smoke-trees/rust-backend-template`

- Create a `.env` file in the root directory of your project and set the `DATABASE_URL` variable

- Run `diesel setup` to create the database.

- Run `diesel migration run` to create all the necessary tables. Note that the table schemas
are written under migrations.

- If you want to create a new migration/table schema, run
`diesel migration create YOUR_MIGRATION_NAME`



Notes:


- Running migrations manually is only needed during development. The migrations are embedded in the binary and are executed at runtime during production.

Related links:

- Rocket: https://rocket.rs/
- Diesel: http://diesel.rs/