diff --git a/frontend/README.md b/frontend/README.md index 41d2b41..e72957c 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,39 +1,21 @@ # MDOJ Frontend -- [Color](https://www.realtimecolors.com/?colors=e8f7f0-040a07-9addbc-2b5280-606fca&fonts=Poppins-Poppins) +This project use bleeding-edge framework call Leptos and tailwind/sass for styling. +- [Color Palette](https://www.realtimecolors.com/?colors=e2e6ed-0d121a-9bb4d9-264e8a-427fdc) +- [Leptos](https://leptos.dev/) -## Running your project +## Pre-requirement -`cargo leptos watch` -By default, you can access your local project at `http://localhost:3000` +This project use nightly Rust and sass, so you need install following dependency -## Installing Additional Tools +- `rustup toolchain install nightly --allow-downgrade` - make sure you have Rust nightly +- `rustup target add wasm32-unknown-unknown` - add the ability to compile Rust to WebAssembly +- `npm install -g sass` - install `dart-sass` -By default, `cargo-leptos` uses `nightly` Rust, `cargo-generate`, and `sass`. If you run into any trouble, you may need to install one or more of these tools. +## Development -1. `rustup toolchain install nightly --allow-downgrade` - make sure you have Rust nightly -2. `rustup target add wasm32-unknown-unknown` - add the ability to compile Rust to WebAssembly -3. `cargo install cargo-generate` - install `cargo-generate` binary (should be installed automatically in future) -4. `npm install -g sass` - install `dart-sass` (should be optional in future) - -## Executing a Server on a Remote Machine Without the Toolchain -After running a `cargo leptos build --release` the minimum files needed are: - -1. The server binary located in `target/server/release` -2. The `site` directory and all files within located in `target/site` - -Copy these files to your remote server. The directory structure should be: -```text -leptos_start -site/ -``` -Set the following environment variables (updating for your project as needed): -```sh -export LEPTOS_OUTPUT_NAME="leptos_start" -export LEPTOS_SITE_ROOT="site" -export LEPTOS_SITE_PKG_DIR="pkg" -export LEPTOS_SITE_ADDR="127.0.0.1:3000" -export LEPTOS_RELOAD_PORT="3001" -``` +Run `just dev` to start frontend +By default, it will running `http://localhost:3000` +Run `just setup-backend` to run backend for development diff --git a/frontend/justfile b/frontend/justfile index ce594d6..1eb54d0 100644 --- a/frontend/justfile +++ b/frontend/justfile @@ -9,6 +9,7 @@ release: update-backend: cd ../docker/dev && sudo docker compose pull + cd ../docker/dev && sudo docker compose --profile migration pull setup-backend: cd ../docker/dev && sudo docker compose --profile migration up