How accesswarrior/distance_learner works
Werewolf is a classroom companion for username/PIN access, room setup, private role assignment, and limited in-app voting and elimination; the moderator runs the remaining rounds in person. The main path is sign in, create or join a room, ready in the lobby, assign roles, then follow the live game state. Firestore backs room, player, and vote state, while Firebase Authentication handles credentials. Night/day gameplay beyond the documented controls remains manual. The graph reflects the sampled runtime source and README capabilities; unsampled details are not inferred.
Main entry points: main.js App routing · lobby.js Ready lobby · ui.js Live game view · auth.js Sign in
Components 12
Access
- Sign in
js/core/auth.js
Rooms
- App routing
js/main.js - Room lifecycle
js/core/engine.js - Ready lobby
js/core/lobby.js
Game
- Role rules
js/games/werewolf/rules.js - Live game view
js/games/werewolf/ui.js - Voting and outcomes
js/games/werewolf/voting.js
Firebase
- Firebase setup
js/core/firebaseConfig.js - Firebase Auth
- Firestore
Other components
- Player
- Moderator
Connections 26
- Player → Sign in: signs in
- Moderator → Sign in: signs in
- Sign in → Firebase Auth: authenticates
- Sign in → Firestore: stores profiles
- Firebase setup → Firebase Auth: initializes
- Firebase setup → Firestore: initializes
- Firebase Auth → App routing: auth state
- App routing → Firestore: reads session
- App routing → Room lifecycle: creates or joins
- App routing → Ready lobby: opens lobby
- App routing → Live game view: opens game
- Player → App routing: chooses room
- Moderator → App routing: creates room
- Room lifecycle → Firestore: writes room state
- Ready lobby → Firestore: reads and updates roster
- Ready lobby → Room lifecycle: removes player
- Ready lobby → Role rules: assigns roles
- Ready lobby → Live game view: opens after start
- Moderator → Ready lobby: starts game
- Player → Ready lobby: marks ready
- Live game view → Firestore: listens to game state
- Live game view → Voting and outcomes: dispatches vote actions
- Player → Live game view: views role and votes
- Moderator → Live game view: views roles and controls
- Voting and outcomes → Firestore: reads and writes votes
- Voting and outcomes → Role rules: checks win condition