Skip to content

A rust backend template initialized with clean architecture.

License

Notifications You must be signed in to change notification settings

smoke-trees/rust-backend-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

Releases

No releases published

Packages

No packages published