This time I'm redoing all of it with the Dioxus Rust crate. https://github.com/DioxusLabs/dioxus
Go to file
2023-04-06 19:12:04 -05:00
data Added Markdown file conversion. Changed some Cargo params to keep rust-analyzer from freaking out. Updated build.rs to not panic when 'npx' isn't in the path. 2023-04-06 19:12:04 -05:00
public Created workspace for seperate fe/be dev, updated README and Dockerfile. 2023-04-01 15:28:15 -05:00
rust-letter-be Added Markdown file conversion. Changed some Cargo params to keep rust-analyzer from freaking out. Updated build.rs to not panic when 'npx' isn't in the path. 2023-04-06 19:12:04 -05:00
rust-letter-fe Added Markdown file conversion. Changed some Cargo params to keep rust-analyzer from freaking out. Updated build.rs to not panic when 'npx' isn't in the path. 2023-04-06 19:12:04 -05:00
src Added Markdown file conversion. Changed some Cargo params to keep rust-analyzer from freaking out. Updated build.rs to not panic when 'npx' isn't in the path. 2023-04-06 19:12:04 -05:00
templates Fixed typo with custom font file, added minor templating to replace content::RawHtml() call, updated README. 2023-03-29 17:29:57 +00:00
.gitignore Initial commit. Base working state. 2023-03-28 13:21:31 +00:00
Cargo.toml Added Markdown file conversion. Changed some Cargo params to keep rust-analyzer from freaking out. Updated build.rs to not panic when 'npx' isn't in the path. 2023-04-06 19:12:04 -05:00
docker-compose.yml Make a Dockerfile to enable running the app in a container. 2023-03-30 22:08:41 +00:00
Dockerfile Created workspace for seperate fe/be dev, updated README and Dockerfile. 2023-04-01 15:28:15 -05:00
helper.sh Added some minimal documentation and a helper script. 2023-04-02 15:14:57 -05:00
LICENSE Initial commit. Base working state. 2023-03-28 13:21:31 +00:00
README.md Created workspace for seperate fe/be dev, updated README and Dockerfile. 2023-04-01 15:28:15 -05:00
Rocket.toml Created workspace for seperate fe/be dev, updated README and Dockerfile. 2023-04-01 15:28:15 -05:00

Dioxus (& Rocket) - letter.werefox.cafe

A re-implementation of the Valentine's Day site I made, but using Rust's Dioxus crate and Rocket crate.

Usage

This project works by using a Cargo workspace with two projects rust-letter-fe and rust-letter-be

Backend

You can develop the backend by simply running the project from the root directory

cargo run

Generally, any commands you'd use for any other standard Rust project will work for this.

Ex:

cargo build

Frontend

If you want to develop the Dioxus frontend, you'll need to do the following:

cargo install dioxus-cli
rustup target add wasm32-unknown-unknown

Then, you should be able to run the development server after moving into the rust-letter-fe directory.

(Linux example)

cd rust-letter-fe && dioxus serve

If you'd link to know about how to use dioxus-cli, you should run dioxus --help or reference the official documentation.*

* At the time of writing this, the link to the documentation is broken. If you'd like to see what I normally use to run the project, here's an example: dioxus serve --hot-reload --port [port #]

Running

Here are some ways you can run the project

Cargo

You can either do the standard run --release

cargo run --release

Or, referencing the Dockerfile, you can install and then run.

cargo install --path .
rust-letter

Docker

You can run this in a container using the included Dockerfile.

docker build -t rust-letter-werefox-cafe
docker run -p 3469 -d -t rust-letter-werefox-cafe

Or, run through docker compose.

docker compose up --build -d

Project Structure

.dioxus-letter-werefox-cafe
|- data             # text files that will be read to for data in the app
|- public           # save the assets you want include in your project.
|- rust-letter-be
|\
||- src             # source code folder for backend
|- rust-letter-fe
|\
||- src             # source code folder for frontend
||\
|||- utils          # save some public function
|||- components     # save some custom components
|- src              # code for running the workspace
|- templates        # put template files here, right now just using handlebar