From 0eda3fc645df3dc671800d7d923891cfa9825c02 Mon Sep 17 00:00:00 2001 From: Imbus Date: Wed, 18 Oct 2023 20:53:03 +0200 Subject: [PATCH] Better readme --- CONTRIBUTING.md | 3 +++ README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..22ff01f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing + +1. [IMPORTANTE](https://www.youtube.com/watch?v=aPfC4RUx0jI) \ No newline at end of file diff --git a/README.md b/README.md index bd5a205..29cc876 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,67 @@ -# FrostByte forum +# FrostByte Forum + +A simple forum written in Rust and Typescript. + +--- + +## Structure + +- `server`: Contains the web server code +- `client`: Contains the frontend client + +## Setup + +- Install [Rust](https://www.rust-lang.org/) and [Node.js](https://nodejs.org/) +- Install [Just](https://just.systems/man/en/) and [Podman](https://podman.io/) (optional but recommended) + +## Running the project + +There are two ways to run this project. The simple way and the manual way. + +### 1. The simple way (with aforementioned [Just](https://just.systems/man/en/) and [Podman](https://podman.io/)) + +To spin up a dev environment, run: + +``` bash +just dev +``` + +For a complete list of targets, run: + +``` bash +just -l +``` + +Spin up a dev server with `just dev` or just `just`. +This will start a dev server in a container running in the background. +It will also cd into the **client** directory and run `npm run dev` for you. The server will be available at `localhost:8080` and the client (vite preview) will be available at `localhost:3000`. +**Congrats, you're now ready to hack!** + +For a project cleanup, you can run `just clean`. This will delete nore_modules and target directories etcetera. It will also stop and remove related images/containers. + +For a more complete cleanup, you can run `just nuke`. This deletes everything related to this project AND **all containers and images on your system**. Use with caution. + +### 2. The manual way + +The client is a React application built with vite. `npm run dev` will start a dev server without a backend. ´npm run build´ will build the full application and drop it in the `client/dist` directory. This directory will then be served by the web server. + +--- +The server is a Rust application built with actix-web. `cargo run` will start a dev server with an in-memory database. `cargo build --release` will place a binary in `server/target/release` that can be run on a server. Note that the server binary will try to serve the client from `server/public` by default. This will be changable in the future. ```bash -# Local backend server (Actix-web with sqlx::sqlite) +# Local backend server cd server cargo run # Dev client (vite) +cd client npm run dev ``` + +### Production build + +```bash + +## Contributing + +Contributions are welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.