This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
rust-web/README.md
2024-06-13 12:52:48 -07:00

1.9 KiB

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

See backend/README.md

Using the frontend crate

See frontend/README.md

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

dev

From Top left, counterclockwise

  1. Terminal in ./frontend running trunk serve
  2. Terminal in ./backend running cargo run
  3. postgres:latest docker container with an exec terminal. In the terminal, I run psql -U postgres to connect to postgres, then \dt to confirm the tables exist. From there, any query can be written or tested.
  4. Postman, to test the APIs for which there is not a frontend compoment.
  5. Browsers connected to http://127.0.0.1:8080 to use the web app.