.cargo | ||
backend | ||
frontend | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
dev.png | ||
LICENSE.txt | ||
README.md |
David Westgate
Rust Question and Answer Web app
Background
This is a simple Rust Web Axum server, so far serving a handful of REST API endpoints as the basis of a "Q&A" or question and answer application. The APIs supported offer basic CRUD functionality. Specifically, this example mirrors that which is found in the early chapters of the Rust Web Development textbook by Bastian Gruber (except using Axum and not Warp). A frontend web server using Yew is also provided to utilize the APIs
Setup
Rustup
First install Rust. I suggest using the rustup toolchain
Then run
cargo install trunk
rustup target install wasm32-unknown-unknown
Finally, run both the backend and frontend to use the application
Using the backend crate
Using the frontend crate
State of things
This application is a proof of concenpt of the ability to use Rust for full stack web developmnet as well as an exercise in my experience using rust. To assist with running/developing this application, here is a look at my enviornment while I am working
From Top left, counterclockwise
- Terminal in
./frontend
runningtrunk serve
- Terminal in
./backend
runningcargo run
postgres:latest
docker container with anexec
terminal. In the terminal, I runpsql -U postgres
to connect to postgres, then\dt
to confirm the tables exist. From there, any query can be written or tested.- Postman, to test the APIs for which there is not a frontend compoment.
- Browsers connected to
http://127.0.0.1:8080
to use the web app.