diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4212f373..f336c82f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,14 +11,67 @@ SPDX-License-Identifier: MPL-2.0 ```bash git clone https://github.com/streamer45/streamkit.git cd streamkit -cd ui && bun install && cd .. -just dev # starts backend + frontend with hot reload +just build-ui # build the embedded web UI (required before compiling the server) +just dev # starts backend + frontend with hot reload ``` -**Prerequisites:** Rust 1.92+, Bun 1.3+, [Just](https://github.com/casey/just) (recommended) +**Prerequisites:** Rust 1.92+, Bun 1.3+, [Just](https://github.com/casey/just) Run `just --list` to see all available commands. +## Prerequisites (detailed) + +### System packages (Ubuntu/Debian) + +```bash +sudo apt install libopus-dev cmake pkg-config libssl-dev +``` + +### Rust toolchain + +The repo pins the toolchain via `rust-toolchain.toml` (currently Rust 1.92). Install Rust if you haven't already: + +```bash +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +### Bun + +```bash +curl -fsSL https://bun.sh/install | bash +``` + +### Just (task runner) + +```bash +cargo install just +``` + +### Linting tools + +Required by `just lint`: + +```bash +cargo install cargo-deny +pip3 install --user reuse # note: the apt version is too old +``` + +### Development mode + +Required by `just dev`: + +```bash +cargo install cargo-watch +``` + +### Native plugin development (optional) + +Building ML plugins (e.g. whisper, sensevoice) requires additional dependencies: + +```bash +sudo apt install clang libclang-dev +``` + ## Making Changes 1. Create a branch: `git checkout -b feat/my-feature` or `fix/my-bug` diff --git a/Cargo.lock b/Cargo.lock index 58516420..d5adc173 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -516,9 +516,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" dependencies = [ "serde", ] @@ -2751,9 +2751,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" [[package]] name = "num-format" @@ -5184,9 +5184,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "itoa", @@ -5199,15 +5199,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" -version = "0.2.25" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ "num-conv", "time-core", diff --git a/docs/src/content/docs/getting-started/installation.md b/docs/src/content/docs/getting-started/installation.md index c4ef4e7c..5da535ab 100644 --- a/docs/src/content/docs/getting-started/installation.md +++ b/docs/src/content/docs/getting-started/installation.md @@ -34,12 +34,16 @@ If you want a native host install without containers, you can run the released ` Required: - Rust toolchain (the repo is pinned via `rust-toolchain.toml`) -- `just` (`cargo install just`) -- Bun (`bun` in `$PATH`) to build the embedded web UI (`ui/dist`) +- [Just](https://github.com/casey/just) task runner (`cargo install just`) +- [Bun](https://bun.sh) (`bun` in `$PATH`) to build the embedded web UI (`ui/dist`) +- System libraries (Ubuntu/Debian): `sudo apt install libopus-dev cmake pkg-config libssl-dev` Optional: - `cargo-watch` (`cargo install cargo-watch`) for `just dev` +- `cargo-deny` (`cargo install cargo-deny`) for license checks in `just lint` +- `reuse` (`pip3 install --user reuse`) for SPDX license header checks in `just lint` (note: the apt package is too old) +- `clang` and `libclang-dev` (`sudo apt install clang libclang-dev`) for building native ML plugins (e.g. whisper, sensevoice) ### Build Steps diff --git a/justfile b/justfile index caa3f706..2926ae75 100644 --- a/justfile +++ b/justfile @@ -62,6 +62,20 @@ gen-plugin-bindings: fetch-wit-deps @gofmt -w sdks/plugin-sdk/go || true # --- skit --- +# Pre-flight: ensure the UI has been built (required by RustEmbed) +check-ui-dist: + @if [ ! -d ui/dist ]; then \ + echo ""; \ + echo "Error: ui/dist/ does not exist."; \ + echo ""; \ + echo "The skit server embeds the web UI at compile time (RustEmbed)."; \ + echo "Build it first with:"; \ + echo ""; \ + echo " just build-ui"; \ + echo ""; \ + exit 1; \ + fi + # Build the skit in release mode build-skit: @echo "Building skit..." @@ -74,7 +88,7 @@ build-skit-profiling: @RUSTFLAGS="-C force-frame-pointers=yes" cargo build --release {{moq_features}} {{profiling_features}} -p streamkit-server --bin skit # Start the skit server -skit *args='': +skit *args='': check-ui-dist @echo "Starting skit..." @cargo run {{moq_features}} -p streamkit-server --bin skit -- {{args}} @@ -165,8 +179,8 @@ test-skit: lint-skit: @echo "Linting skit..." @cargo fmt --all -- --check - @cargo clippy --workspace --all-targets -- -D warnings @cargo clippy -p streamkit-server --all-targets --features "moq" -- -D warnings + @cargo clippy --workspace --exclude streamkit-server --all-targets -- -D warnings @mkdir -p target @HOST=$(rustc -vV | sed -n 's/^host: //p'); \ cargo metadata --locked --format-version 1 --filter-platform "$HOST" > target/cargo-metadata.json @@ -177,8 +191,8 @@ lint-skit: fix-skit: @echo "Auto-fixing skit code..." @cargo fmt --all - @cargo clippy --fix --allow-dirty --allow-staged --workspace --all-targets -- -D warnings @cargo clippy --fix --allow-dirty --allow-staged -p streamkit-server --all-targets --features "moq" -- -D warnings + @cargo clippy --fix --allow-dirty --allow-staged --workspace --exclude streamkit-server --all-targets -- -D warnings # --- Frontend --- # Install UI dependencies using Bun @@ -393,7 +407,7 @@ dev: install-ui @echo "Starting development environment..." @echo "Press Ctrl+C to exit." @trap 'kill 0' EXIT; \ - (cd server && cargo watch -x "run {{moq_features}} --bin skit -- serve") & \ + (cargo watch -x "run {{moq_features}} -p streamkit-server --bin skit -- serve") & \ (cd ui && bun run dev) # --- Plugins ---