A simple Actix-web boilerplate using SQLx
cargo run --bin api
The project uses tracing for logs.
To format them, the project actix-web-logs-reader which is inspired by Luca Palmieri's Bunyan project.
To install it, just run:
cargo install --git https://github.com/fabienbellanger/actix-web-logs-reader --branch main
Actix-web logs can be formatted like this:
cargo run | actix-web-logs-reader
cargo-watch repository: Github Usage:
cargo watch -x 'run --bin api'
Use Drill
drill --benchmark drill.yml --stats --quiet
sqlx repository: Github
TODO: Upgrade to sqlx 0.5 when actix-web upgraded in 4.0
sqlx-cli repository: Github
To create a migration:
sqlx migrate add -r <name>
sqlx migrate add -r create_users_table
Run migrations:
sqlx migrate run
Revet migrations:
sqlx migrate revert
Run:
cargo doc --open --no-deps
Run with private items:
cargo doc --open --no-deps --document-private-items
- Implement JWT authentication
- Add
/register
route - Mieux gérer la route /login quand le user est supprimé
- Implement FromRequest trait to retrieve the request ID in an handler
- Add SQLx auto-migrate. Done, but does not work with sqlx 0.4:
Error: 0: while executing migrations: error returned from database: 1062 (23000): Duplicate entry '20210316155055' for key 'PRIMARY' 1: error returned from database: 1062 (23000): Duplicate entry '20210316155055' for key 'PRIMARY'
- Improve validator response error
- Add streaming with a large sqlx request
- Add unit tests
- Improve WebSocket routes
- Watch actix_sqlx_mysql_user_crud
- Watch actixweb-sqlx-jwt