This repository contains Rust code for practicing the concepts taught in the book "Zero To Production In Rust". The application is currently deployed on Fly.io, and you can access it at https://marvinhsu-zero-to-production.fly.dev/. Additionally, Swagger-UI is available.
The following table shows the differences between the book and this repository:
Item | Book | Repository |
---|---|---|
Framework | Actix-web | Axum |
Platform | DigitalOcean | Fly.io |
DB tool | sqlx | seaORM |
Integration test | rust build-in | pytest |
CI Accelerate | Cargo-chief | Github-action cache |
Auth | Session | JWT |
Frontend | html | Svelte |
Website fronted is under preparing. https://marvinhsu-zero-to-production-website.fly.dev/
- Install sea-orm cli if haven't done
cargo install sea-orm-cli
- Set up database connection string in
.env
file - Use
up
command to apply all pending migrationssea-orm-cli migrate up
- Use
generate
command to generate model and entity filessea-orm-cli migrate generate NAME_OF_MIGRATION
- Generate entities from database
sea-orm-cli generate entity -o src/entity