Live location tracking and playback for the game "manhunt"
1# Man Hunt
2
3[](https://garnix.io/repo/Bwc9876/manhunt-app)
4
5An iOS and Android app that lets you play [man hunt](<https://en.wikipedia.org/wiki/Manhunt_(urban_game)>) with friends.
6
7The game is played over WebRTC Data Channels and is entirely P2P (except for the
8signaling process needed for WebRTC.)
9
10## Features
11
12- Play games with friends by starting a lobby, your friends can join with the
13 room code on the lobby screen.
14- Pings can be configured to happen at certain intervals. They reveal hider
15 locations so hiders have to move.
16- Powerups are random items you can grab in certain locations that can deceive
17 seekers or mess up other hiders.
18- Watch a replay of your game after it ends, it shows everyone's location
19 throughout the game.
20- Your location data is safe, it's only ever sent to the other players in the game.
21
22<!-- TODO: Download & Install instructions for when we get to publishing -->
23
24## Development
25
26### Pre-requisites
27
28If you have [nix](https://nixos.org) installed, all of these are handled for you.
29
30- [Rust](https://rustup.rs)
31- [Just](https://just.systems) (`cargo install just`)
32 - **On Windows**: Some implementation of `sh` (Git for Windows works well)
33- Cargo Nextest (only needed for running `just check-rust`, `cargo install cargo-nextest`)
34- [Tauri's Pre-reqs](https://tauri.app/start/prerequisites/)
35 - [(Also pre-reqs for mobile dev if you are working on the app part)](https://tauri.app/start/prerequisites/#configure-for-mobile-targets)
36- Tauri's CLI (`cargo install tauri-cli`)
37- [NodeJS](https://nodejs.org)
38- [Prettier](https://prettier.io/) (`npm add -g prettier`)
39
40#### With Nix
41
42Run `nix develop` to get a development shell with all needed dependencies set up.
43You can then call the `just` recipes mentioned below within the shell.
44
45### Setup
46
47- Rust is ready to go
48- For the frontend, run `just setup-frontend` to install the dependencies via `npm`
49
50### Run App
51
52- `just dev`: Run the app locally on your computer, this will open a
53 WebView with the frontend for testing.
54 - Note: all geolocation data returned from `tauri-plugin-geolocation` will be hard
55 coded to `(0.0, 0.0)` in this mode.
56- `just dev-android`: Run the app on an Android device or VM via ADB
57- `just signaling`: Will run the signaling server on port `3536`
58 (this is needed for clients to connect).
59 If you need a different port run `cargo run --bin manhunt-signaling 0.0.0.0:PORT`.
60
61### Project Layout
62
63- [manhunt-logic/](https://github.com/Bwc9876/manhunt-app/tree/main/manhunt-logic):
64 Game and lobby logic for the app
65- [manhunt-transport/](https://github.com/Bwc9876/manhunt-app/tree/main/manhunt-transport):
66 Transport (networking) implementation for communication between apps
67- [manhunt-app/](https://github.com/Bwc9876/manhunt-app/tree/main/manhunt-app): App
68 backend, Rust side of the Tauri application
69- [frontend/](https://github.com/Bwc9876/manhunt-app/tree/main/frontend): App
70 frontend, Web side of the Tauri application
71- [nix/](https://github.com/Bwc9876/manhunt-app/tree/main/nix): Nix files for
72 the flake
73- [manhunt-signaling/](https://github.com/Bwc9876/manhunt-app/tree/main/manhunt-signaling):
74 Matchbox signaling server implementation in Rust
75
76### Housekeeping
77
78As you go, please run these `just` commands every-so-often and before you commit:
79
80- `just fmt`: Formats all files in the repo
81- `just check-rust`: Check (and fix) potential issues with Rust code
82 (only need to run if you edited rust code)
83- `just check-frontend`: Check for potential issues on the frontend
84 (only need to run if you edited the frontend)
85
86**Important**: When changing any type in a rust file that derives `specta::Type`,
87you need to run `just export-types` to sync these type bindings to the frontend.
88Otherwise the TypeScript definitions will not match the ones that the backend expects.
89
90All changes will be put through CI to check that all of these commands have
91been done.
92
93### Other Just Recipes
94
95Run `just` without any args to get a list.