- Goal of this project
- What the app is about
- Technologies used
- Backend
- Frontend
- Screenshots
- How to run the app
This project is a small project to test out web technologies in Rust. I wanted to try out some backend frameworks and some WASM-based frontend frameworks, to create a web app all in Rust!
The goal of this project was to make a small-scale web application to try out Rust frameworks. This allowed me to understand better the state of Rust frameworks, to better my skills in Rust, and to have previous experience with these technologies if I want to work on another, fuller web application project in Rust.
The goal of this project was not to make a polished, useful application. For instance, the UI has a theme toggle, but the styling is very rough, the intention was merely to make a functional toggle.
The actual application I chose to make (which is more of a pretext than anything else), is a discography database. It allows users to add artists, albums and songs, and browse these objects. As the project is small-scale, many features that would be essential if the project's goal was to be useful are not present, such as a search engine.
View all the songs in the database.
View all the albums in the database.
View all the artists in the database.
Page to edit the attributes of an artist currently in the database.
Page that shows all the details related to an artist, including its attributes and its discography.
The app can be run locally or in Docker containers with Docker Compose.
You will need to have the following installed:
- Rust toolchain (cargo)
- Trunk
- PostgreSQL
- Clone this repository:
git clone https://github.com/SpacewaIker/rust-webapp-demo.git
- Create an empty database and put its URL in the
.env
file (should bepostgres://{username}:{password}@localhost:5432/{database_name}
) - Run the backend server with
rust-webapp-demo/backend$ cargo run --release
- Run the frontend server with
rust-webapp-demo/frontend$ trunk serve --release --open
- (Optional) Populate the database by running the
populate_db.sql
script (warning: this will first clear the database):
psql -U {username} -f populate_db.sql {database_name}
Disclaimer: This method wasn't thoroughly tested and might not work.
Docker needs to be installed and the daemon running.
- Clone this repository:
git clone https://github.com/SpacewaIker/rust-webapp-demo.git
- Run the containers with:
rust-webapp-demo$ docker compose up
Note: Downloading the Rust and PostgreSQL images used in the containers and building the code might take a while.