info-werefox-cafe/README.md

104 lines
2.6 KiB
Markdown

# [void.werefox.cafe](https://void.werefox.cafe)
> This will be used to replace my *"A Letter To The Void"* collection of poems on [write.as](https://write.as) for hosting my poetry.
## Usage
> This project works by using a Cargo workspace with two projects `void-fe` and `void-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:
- [From the official Dioxus docs](https://dioxuslabs.com/docs/0.3/guide/en/getting_started/web), ensure you have `dioxus-cli` and the `wasm32-unknown-unknown` target installed
```
cargo install dioxus-cli
```
```
rustup target add wasm32-unknown-unknown
```
- Additionally, you *may* need to have the [Tauri prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites/) installed.
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.*](https://github.com/DioxusLabs/cli)
\* 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.
|- void-be
|\
||- src # source code folder for backend
|- void-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
```