From e90bf5ef6a4aa196e05bfcd9b0f201eaea4c1498 Mon Sep 17 00:00:00 2001 From: Charles Taylor Date: Wed, 8 May 2024 22:00:20 -0400 Subject: [PATCH] supabase-js-rs --- Cargo.lock | 34 +++++++++++++++++++++++++ Cargo.toml | 1 + README.md | 73 ++++++++++++++++++++++-------------------------------- TODO.md | 2 +- 4 files changed, 65 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0af3050..f846632 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -337,6 +337,7 @@ dependencies = [ "serde", "serde_json", "serde_with", + "supabase-js-rs", "time", "tokio", "tokio-stream", @@ -1350,6 +1351,17 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "supabase-js-rs" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d22264cae1352a6f11ba52f9550c35fa96417434c5b8055588e5428192dc25" +dependencies = [ + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "syn" version = "2.0.48" @@ -1739,6 +1751,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.90" @@ -1768,6 +1792,16 @@ version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index e23e802..6a7d064 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ mime = "0.3.17" serde_with = "3.5.0" tracing-subscriber = { version ="0.3.18", features = ["fmt"], default-features = false } tracing = "0.1.40" +supabase-js-rs = "0.1.3" [features] dev = [] diff --git a/README.md b/README.md index 511234a..e831641 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,6 @@ ## Citadels This is a web app for playing the card game [Citadels](https://boardgamegeek.com/boardgame/478/citadels). -## Goals -- Support all characters and roles -- Learn htmx, practice web dev - - -## Feature set - - All 30 unique districts - - All 27 game characters. - - Game config for picking roles and districts. - - -## Dev commands -For most commands: use mprocs. - -## Logging -The logger offers five levels: - - error - - warn - - info - - debug - - trace - -This is excessive, and I will try to stick to 3: - - error - - debug - - info - -## Tech Stack -Tech Stack: -- Frontend: - - htmx - - hyperscript (as needed) - - interactjs for drag 'n drop -- Backend - - Rust, stable compiler. No nightly features - - axum - - Askama for templating. (Jinja clone for Rust) - -Evaluating: - - sqlite for two use cases: - - game backups via action logs - - saving preferred game configuration - ## Releases & monitoring Github handles publishing a docker image on every push to `main`. Deployments are done manually with the `deploy.sh` script. @@ -66,8 +23,36 @@ To release: gh run watch && ./deploy.sh ``` -## Secret management +## Tech Stack +Tech Stack: +- Frontend: + - htmx + - hyperscript (as needed) + - interactjs for drag 'n drop +- Backend + - Rust, stable compiler. No nightly features + - axum + - Askama for templating. (Jinja clone for Rust) +Evaluating: + - sqlite for two use cases: + - game backups via action logs + - saving preferred game configuration + +## Logging +The Rust logger offers five levels: + - error + - warn + - info + - debug + - trace + +This is excessive, and I will try to stick to 3: + - error + - debug + - info + +## Secret management Script to generate a new signing key: ```bash node -e "console.log(require('crypto').randomBytes(64).toString('hex'))" diff --git a/TODO.md b/TODO.md index 6c28003..a71ebbe 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,5 @@ ## Work -- [ ] Auth via Supabase +- [ ] signin via Supabase - [ ] Game host with elevated permissions - [ ] Prevent tracing subscriber from overwriting the env_logger - [ ] Multi room support