Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/smoke-trees/rust-backend-template
- Owner: smoke-trees
- License: mit
- Created: 2020-06-28T11:20:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-28T11:46:49.000Z (over 4 years ago)
- Last Synced: 2024-11-22T19:19:57.013Z (2 months ago)
- Topics: backend, clean-archi, diesel, rest-api, rocket, rust, slog
- Language: Rust
- Homepage:
- Size: 29.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/