axum + yew + shuttle codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged fullstack application built with axum + yew + shuttle including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the axum + yew + shuttle community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
The backend is written with axum, the frontend is written with Yew, and deployment is done by shuttle. The database is PostgreSQL and is manipulated by SQLx. Queries are checked for correctness at compile time. The front end is built as a SPA using Yew and compiled as a wasm. Data is fetched using gloo_net. JWT tokens are generated by jsonwebtoken and passwords are hashed in argon2 by password_hash with salt.
First, install trunk
$ cargo install --locked trunk
And then, compile using trunk.
$ cd frontend
$ trunk build --release
Copy dist
directory to backend directory.
$ cp -r dist ../backend
First, install cargo-shuttle
$ cargo install cargo-shuttle
To run locally:
$ cd backend
$ cargo shuttle run
To deploy to shuttle server:
$ cd backend
$ cargo shuttle project new --name {name-of-app}
$ cargo shuttle deploy