How aliqutib/mill-game works
The Mill is a Nine Men Morris app supporting local pass-and-play and online room matches, with accounts, profiles, history, search and social features. The main online path runs from the frontend lobby into room APIs, through room management and match-result recording; live moves and match events use Socket.IO on the backend. Account, profile, discovery and friend workflows form additional branches. Backend relationships are grounded in sampled calls and imports; frontend and unsampled feature links are limited to README capabilities and indexed references.
Main entry points: server.js HTTP API · routes App routes · User.js User records · Profile.js Profile records
Components 26
Frontend experience
- App routes
frontend/src/routes - Room lobby
frontend/src/app/features/lobby/index.tsx - Pass-and-play
frontend/src/app/features/game/index.tsx - Online match UI
frontend/src/app/features/online-game/index.tsx - Friends and search
frontend/src/app/features/social - Stats and history
frontend/src/app/features/history
Identity and profiles
- Auth routes
backend/src/routes/api/auth.js - Account controller
backend/src/controllers/authController.js - Auth service
backend/src/services/authService.js - Token guard
backend/src/middleware/auth.js - Registration
backend/src/controllers/userController.js - User service
backend/src/services/userService.js
Social and discovery
- Profile routes
backend/src/routes/api/profile.js - Profile and friends
backend/src/controllers/profileController.js - Search controller
backend/src/controllers/searchController.js - Search service
backend/src/services/searchService.js
Match services
- HTTP API
backend/src/server.js - Room routes
backend/src/routes/api/room.js - Room and results
backend/src/controllers/roomController.js - Room service
backend/src/services/roomService.js - Socket events
backend/src/server.js
Data layer
- User records
backend/src/models/User.js - Profile records
backend/src/models/Profile.js - Room records
backend/src/models/Room.js
Other components
- Player
- MongoDB
Connections 36
- Player → App routes: uses
- App routes → Room lobby: routes to
- App routes → Pass-and-play: routes to
- App routes → Online match UI: routes to
- App routes → Friends and search: routes to
- App routes → Stats and history: routes to
- Room lobby → HTTP API: requests rooms
- Online match UI → Socket events: exchanges moves
- Online match UI → HTTP API: submits results
- Friends and search → HTTP API: requests social data
- Stats and history → HTTP API: requests records
- HTTP API → Auth routes: mounts
backend/src/server.js - HTTP API → Profile routes: mounts
backend/src/server.js - HTTP API → Room routes: mounts
backend/src/server.js - Auth routes → Account controller: dispatches
backend/src/routes/api/auth.js - Account controller → Auth service: calls
backend/src/controllers/authController.js - Auth service → User records: queries
backend/src/services/authService.js - Registration → User service: calls
backend/src/controllers/userController.js - User service → User records: queries
backend/src/services/userService.js - Profile routes → Token guard: guards
backend/src/routes/api/profile.js - Profile routes → Profile and friends: dispatches
backend/src/routes/api/profile.js - Profile and friends → User records: reads and updates
backend/src/controllers/profileController.js - Profile and friends → Profile records: reads and updates
backend/src/controllers/profileController.js - Search controller → Search service: calls
backend/src/controllers/searchController.js - Search service → User records: searches
backend/src/services/searchService.js - Search service → Profile records: finds profiles
backend/src/services/searchService.js - Room routes → Token guard: guards
backend/src/routes/api/room.js - Room routes → Room and results: dispatches
backend/src/routes/api/room.js - Room and results → Room service: calls
backend/src/controllers/roomController.js - Room service → Room records: manages rooms
backend/src/services/roomService.js - Room service → Profile records: records results
backend/src/services/roomService.js - HTTP API → MongoDB: connects
backend/src/server.js - HTTP API → Socket events: registers events
backend/src/server.js - User records → MongoDB: persists
- Profile records → MongoDB: persists
- Room records → MongoDB: persists