Man Hunt#
An iOS and Android app that lets you play man hunt with friends.
The game is played over WebRTC Data Channels and is entirely P2P (except for the signaling process needed for WebRTC.)
Development#
Pre-requisites#
If you have nix installed, all of these are handled for you.
- Rust
- Just (
cargo install just) - Tauri's Pre-reqs
- Tauri's CLI (
cargo install tauri-cli) - NodeJS
With Nix#
Run nix develop to get a development shell with all needed dependencies set up.
You can then call the just recipes mentioned below.
Setup#
- Rust is ready to go
- For the frontend, run
just setup-frontendto install the dependencies vianpm
Run App#
just dev: Will run the app locally on your computer, this will open a WebView with the frontend- Note: all geolocation returned from tauri-plugin-geolocation will be hard
coded to
(0.0, 0.0)in this mode.
- Note: all geolocation returned from tauri-plugin-geolocation will be hard
coded to
just dev-android: Will run the app on a connect Android device or VM via ADBjust signaling: Will run the signaling server on port3536(this is needed for clients to connect)
Project Layout#
- backend/: App backend, Rust side of the Tauri application
- frontend/: App frontend, Web side of the Tauri application
- nix/: Nix files for the flake
- manhunt-signaling/: Matchbox signaling server implementation in Rust
Housekeeping#
As you go, please run these just commands every-so-often and before you commit:
just fmt: Formats all files in the repojust check-backend: Check (and fix) potential issues on the backend (only need to run if you edited the backend)just check-frontend: Check for potential issues on the frontend (only need to run if you edited the frontend)just check-signaling: Same thing as backend but for the singaling server
Important: When changing any type in backend that derives specta::Type,
you need to run just export-types to sync these type bindings to the frontend,
otherwise the TypeScript definitions will not match that ones the backend expects.
All changes made will be put through CI to check that all of these commands have been done.
Other Just Recipes#
Run just without any args to get a list.