Live location tracking and playback for the game "manhunt"

Redo formatters

bwc9876.dev 9a68a299 2b894eb3

verified
+49 -38
+1
.gitignore
··· 1 result 2 target 3 *.jks
··· 1 result 2 target 3 *.jks 4 + .prettiercache
+2
.prettierignore
··· 1 frontend/dist 2 frontend/node_modules 3 backend/gen 4 backend/target 5 result
··· 1 frontend/dist 2 frontend/node_modules 3 + frontend/package-lock.json 4 backend/gen 5 backend/target 6 result 7 + .prettiercache
+7 -3
README.md
··· 1 # Man Hunt 2 3 An iOS and Android app that lets you play man hunt with friends. 4 5 The game is played over WebRTC Data Channels and is entirely P2P (except for the ··· 15 16 - [Rust](https://rustup.rs) 17 - [Just](https://just.systems) (`cargo install just`) 18 - [Tauri's Pre-reqs](https://tauri.app/start/prerequisites/) 19 - - [(Also pre-reqs for mobile dev if you are working on the app part)](https://tauri.app/start/prerequisites/#configure-for-mobile-targets) 20 - Tauri's CLI (`cargo install tauri-cli`) 21 - [NodeJS](https://nodejs.org) 22 23 #### With Nix 24 ··· 34 35 - `just dev`: Will run the app locally on your computer, this will open a 36 WebView with the frontend 37 - - Note: all geolocation returned from tauri-plugin-geolocation will be hard 38 - coded to `(0.0, 0.0)` in this mode. 39 - `just dev-android`: Will run the app on a connect Android device or VM via ADB 40 - `just signaling`: Will run the signaling server on port `3536` 41 (this is needed for clients to connect)
··· 1 # Man Hunt 2 3 + [![built with garnix](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2FBwc9876%2Fmanhunt-app%3Fbranch%3Dmain)](https://garnix.io/repo/Bwc9876/manhunt-app) 4 + 5 An iOS and Android app that lets you play man hunt with friends. 6 7 The game is played over WebRTC Data Channels and is entirely P2P (except for the ··· 17 18 - [Rust](https://rustup.rs) 19 - [Just](https://just.systems) (`cargo install just`) 20 + - **On Windows**: Some implementation of `sh` (Git for Windows works well) 21 - [Tauri's Pre-reqs](https://tauri.app/start/prerequisites/) 22 + - [(Also pre-reqs for mobile dev if you are working on the app part)](https://tauri.app/start/prerequisites/#configure-for-mobile-targets) 23 - Tauri's CLI (`cargo install tauri-cli`) 24 - [NodeJS](https://nodejs.org) 25 + - [Prettier](https://prettier.io/) (`npm add -G prettier`) 26 27 #### With Nix 28 ··· 38 39 - `just dev`: Will run the app locally on your computer, this will open a 40 WebView with the frontend 41 + - Note: all geolocation returned from tauri-plugin-geolocation will be hard 42 + coded to `(0.0, 0.0)` in this mode. 43 - `just dev-android`: Will run the app on a connect Android device or VM via ADB 44 - `just signaling`: Will run the signaling server on port `3536` 45 (this is needed for clients to connect)
+11 -13
backend/capabilities/default.json
··· 1 { 2 - "$schema": "../gen/schemas/desktop-schema.json", 3 - "identifier": "default", 4 - "description": "Capability for the main window", 5 - "windows": [ 6 - "main" 7 - ], 8 - "permissions": [ 9 - "core:default", 10 - "opener:default", 11 - "notification:default", 12 - "log:default", 13 - "geolocation:default" 14 - ] 15 }
··· 1 { 2 + "$schema": "../gen/schemas/desktop-schema.json", 3 + "identifier": "default", 4 + "description": "Capability for the main window", 5 + "windows": ["main"], 6 + "permissions": [ 7 + "core:default", 8 + "opener:default", 9 + "notification:default", 10 + "log:default", 11 + "geolocation:default" 12 + ] 13 }
+15 -4
flake.nix
··· 15 }; 16 17 flakelight.builtinFormatters = false; 18 - formatters = pkgs: { 19 - "*.nix" = "${pkgs.alejandra}/bin/alejandra ."; 20 - "*.{js,ts,jsx,tsx,md,json}" = "${pkgs.prettier}/bin/prettier --write . --config frontend/.prettierrc.yaml"; 21 - "*.rs" = "${pkgs.rustfmt}"; 22 }; 23 24 devShell = pkgs: let
··· 15 }; 16 17 flakelight.builtinFormatters = false; 18 + formatters = pkgs: let 19 + prettier = "${pkgs.prettier}/bin/prettier --write ."; 20 + alejandra = "${pkgs.alejandra}/bin/alejandra ."; 21 + rustfmt = "${pkgs.rustfmt}/bin/rustfmt"; 22 + just = "${pkgs.just}/bin/just --fmt --unstable"; 23 + in { 24 + "justfile" = just; 25 + "*.nix" = alejandra; 26 + "*.js" = prettier; 27 + "*.ts" = prettier; 28 + "*.jsx" = prettier; 29 + "*.tsx" = prettier; 30 + "*.md" = prettier; 31 + "*.json" = prettier; 32 + "*.rs" = rustfmt; 33 }; 34 35 devShell = pkgs: let
-4
frontend/.prettierignore
··· 1 - dist 2 - node_modules 3 - package-lock.json 4 -
···
frontend/.prettierrc.yaml .prettierrc.yaml
-1
frontend/package.json
··· 8 "build": "tsc && vite build", 9 "preview": "vite preview", 10 "lint": "prettier --check . && tsc && eslint --cache", 11 - "format": "prettier --write .", 12 "tauri": "tauri" 13 }, 14 "dependencies": {
··· 8 "build": "tsc && vite build", 9 "preview": "vite preview", 10 "lint": "prettier --check . && tsc && eslint --cache", 11 "tauri": "tauri" 12 }, 13 "dependencies": {
+3 -3
garnix.yaml
··· 1 $schema: https://garnix.io/api/garnix-config-schema.json 2 builds: 3 - exclude: [] 4 - include: 5 - - "checks.x86_64-linux.*"
··· 1 $schema: https://garnix.io/api/garnix-config-schema.json 2 builds: 3 + exclude: [] 4 + include: 5 + - "checks.x86_64-linux.*"
+10 -10
justfile
··· 1 _default: 2 - @just --list --unsorted --justfile {{justfile()}} 3 - 4 5 # Perform setup for the frontend using `npm` 6 - [working-directory: 'frontend'] 7 setup-frontend: 8 npm install --no-fund --no-audit 9 ··· 14 # Format everything 15 fmt: 16 cargo fmt 17 - cd frontend && npm run format 18 19 # Connect and run on an Android VM/Physical device 20 dev-android: 21 cargo tauri android dev 22 23 # Run a check on the backend 24 - [working-directory: 'backend'] 25 check-backend: 26 cargo fmt --check 27 cargo check 28 cargo clippy --fix --allow-dirty --allow-staged -- -D warnings 29 30 - [working-directory: 'manhunt-signaling'] 31 check-signaling: 32 cargo fmt --check 33 cargo check 34 cargo clippy --fix --allow-dirty --allow-staged -- -D warnings 35 36 # Run lint on the frontend 37 - [working-directory: 'frontend'] 38 check-frontend: 39 npm run lint 40 41 # Export types from the backend to TypeScript bindings 42 - [working-directory: 'backend'] 43 export-types: 44 cargo run --bin export-types ../frontend/src/bindings.ts 45 - prettier --write ../frontend/src/bindings.ts 46 47 # Start the signaling server on localhost:3536 48 - [working-directory: 'manhunt-signaling'] 49 signaling: 50 cargo run 0.0.0.0:3536
··· 1 _default: 2 + @just --list --unsorted --justfile {{ justfile() }} 3 4 # Perform setup for the frontend using `npm` 5 + [working-directory('frontend')] 6 setup-frontend: 7 npm install --no-fund --no-audit 8 ··· 13 # Format everything 14 fmt: 15 cargo fmt 16 + prettier --write . --cache --cache-location .prettiercache --log-level warn 17 + just --fmt --unstable 18 19 # Connect and run on an Android VM/Physical device 20 dev-android: 21 cargo tauri android dev 22 23 # Run a check on the backend 24 + [working-directory('backend')] 25 check-backend: 26 cargo fmt --check 27 cargo check 28 cargo clippy --fix --allow-dirty --allow-staged -- -D warnings 29 30 + [working-directory('manhunt-signaling')] 31 check-signaling: 32 cargo fmt --check 33 cargo check 34 cargo clippy --fix --allow-dirty --allow-staged -- -D warnings 35 36 # Run lint on the frontend 37 + [working-directory('frontend')] 38 check-frontend: 39 npm run lint 40 41 # Export types from the backend to TypeScript bindings 42 + [working-directory('backend')] 43 export-types: 44 cargo run --bin export-types ../frontend/src/bindings.ts 45 + prettier --write ../frontend/src/bindings.ts --config ../.prettierrc.yaml 46 47 # Start the signaling server on localhost:3536 48 + [working-directory('manhunt-signaling')] 49 signaling: 50 cargo run 0.0.0.0:3536