How jayflux/wordduel works
Word Duel is a multiplayer Wordle game whose main flow is account login, ELO-based opponent matching, a live two-player game with chat, and rating/leaderboard updates when a match ends. The frontend drives authentication, matchmaking, profile and leaderboard views, and the Socket.IO game session. Login delegates account data to the user service; matchmaking fetches player ELO over gRPC; the game service reports completed matches to the user service, which coordinates profile and leaderboard updates. The README documents Nginx routing and login failover; unsampled configuration prevents tracing every route in detail.
Main entry points: app.js Game Frontend · user-service/index.js User Service · matchmaking-service/index.js Matchmaking Service · chat-service/index.js Chat And Game
Components 11
Player Client
- Game Frontend
frontend/app.js
Gateway And Auth
- Nginx Gateway
nginx.conf - Login Service
login-service/index.js
Match And Game
- Matchmaking Service
matchmaking-service/index.js - Chat And Game
chat-service/index.js
Profiles And Ratings
- User Service
user-service/index.js - Ranking Service
ranking-service/index.js
Persistent State
- PostgreSQL Master
- PostgreSQL Replica
- Redis Leaderboard
Other components
- Player
Connections 16
- Player → Game Frontend: plays
- Game Frontend → Nginx Gateway: loads and routes
- Nginx Gateway → Login Service: proxies auth
- Login Service → User Service: creates or reads account
- Game Frontend → Matchmaking Service: joins or leaves queue
- Matchmaking Service → User Service: requests ELO
- Matchmaking Service → Game Frontend: returns opponent
- Game Frontend → Chat And Game: sends game events
- Chat And Game → Game Frontend: broadcasts game and chat
- Chat And Game → User Service: submits match result
- User Service → Ranking Service: updates ratings
- Game Frontend → User Service: requests profile
- Game Frontend → Ranking Service: requests leaderboard
- User Service → PostgreSQL Master: writes profiles and ratings
- User Service → PostgreSQL Replica: reads profiles and ELO
- Ranking Service → Redis Leaderboard: reads and writes scores