Game Engine:
βββ express, socket.io, uuid, cors, helmet, morgan, dotenv
βββ β NO database/redis dependencies
User Service:
βββ express, bcryptjs, jsonwebtoken, pg, cors, helmet
βββ express-rate-limit, joi, uuid
βββ β
PostgreSQL client (pg)
Matchmaking Service:
βββ express, socket.io, redis, axios, cors, helmet
βββ joi, uuid
βββ β
Redis client (redis v4.6.7)
βββ β
HTTP client for service calls (axios)
Notification Service:
βββ express, socket.io, redis, nodemailer, cors, helmet
βββ joi, uuid
βββ β
Redis client (redis v4.6.7)
βββ β
Email client (nodemailer)
// 1. Matchmaking β User Service (Token Validation)
await axios.get(`${this.userServiceUrl}/api/users/profile`, {
headers: { Authorization: `Bearer ${playerData.token}` }
});
// 2. Matchmaking β Game Engine (Game Creation)
await axios.post(`${this.gameEngineUrl}/api/games`, {
gameId,
gameMode,
players: players.map(p => ({
userId: p.userId,
// ... player data
}))
});
// Environment Variables:
// GAME_ENGINE_URL = 'http://game-engine-service:3001'
// USER_SERVICE_URL = 'http://user-service:3002'// Health endpoint checks game engine status
const gameEngineUrl = process.env.GAME_ENGINE_URL || 'http://game-engine-service:3001';
const response = await axios.get(`${gameEngineUrl}/health`, { timeout: 5000 });// β NONE - Game Engine makes NO outbound service calls
// It only receives calls and uses in-memory storage// β NONE - User Service is self-contained
// Only connects to PostgreSQL database// β NO direct service calls
// Only uses Redis for message storage and SMTP for emails// Connection Configuration:
const pool = new Pool({
host: process.env.DB_HOST, // From secret: db-credentials.host
port: process.env.DB_PORT, // From secret: db-credentials.port
database: process.env.DB_NAME, // "monopoly_game"
user: process.env.DB_USER, // From secret: db-credentials.username
password: process.env.DB_PASSWORD, // From secret: db-credentials.password
ssl: { rejectUnauthorized: false } // β
SSL enabled for RDS
});
// Actual Tables Used:
// - User authentication (login/register)
// - User profiles (GET/PUT /api/users/profile)
// - User statistics (GET /api/users/stats)// Connection Configuration:
const redisClient = redis.createClient({
socket: {
host: process.env.REDIS_HOST, // monopoly-dev-redis.f2xiko...
port: process.env.REDIS_PORT // 6379
}
});
// Actual Redis Usage:
// - Player queues: queue:${gameMode}:${skillLevel}
// - Player mapping: player:${socketId}
// - Queue management: lPush, rPop, lLen operations// Same Redis connection as Matchmaking
// Actual Redis Usage:
// - Socket mapping: socket:${socketId} β userId
// - User sockets: user_sockets:${userId} β Set of socketIds
// - Notification storage for offline users// β NO persistent storage connections
// Uses in-memory Maps:
const games = new Map(); // All game state lost on restart
const players = new Map(); // All player data lost on restart# From existing infrastructure
paths:
- path: /api/auth/*
backend: user-service:3002
- path: /api/users/*
backend: user-service:3002
- path: /api/game/*
backend: game-engine-service:3001
- path: /api/match/*
backend: matchmaking-service:3003
- path: /api/notify/*
backend: notification-service:3004βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ACTUAL SYSTEM FLOW β
β β
β Frontend βββββββββββββββββββΊ ALB βββββββββββββββββββΊ Services β
β β β
β ββ /api/auth/* βββββΊ User Service β
β β β β
β β βΌ β
β β PostgreSQL RDS β
β β (β
Connected) β
β β β
β ββ /api/match/* ββββΊ Matchmaking Service β
β β β β β
β β βΌ βΌ β
β β Redis Cache HTTP Calls β
β β (β
Connected) β β
β β β β
β β βββΊ User Service β
β β βββΊ Game Engine β
β β β
β ββ /api/game/* βββββΊ Game Engine β
β β β β
β β βΌ β
β β In-Memory Only β
β β (β No Persistence) β
β β β
β ββ /api/notify/* βββΊ Notification Service β
β β β
β βΌ β
β Redis + SMTP β
β (β
Connected) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
User Service:
DB_HOST: monopoly-dev-postgres.cvyiwy84o2kj.us-west-2.rds.amazonaws.com
DB_PORT: 5432
DB_NAME: monopoly_game
DB_USER: monopoly_admin (from secret)
DB_PASSWORD: β’β’β’β’β’β’β’β’β’ (from secret)
SSL: enabled
Matchmaking Service:
REDIS_HOST: monopoly-dev-redis.f2xiko.ng.0001.usw2.cache.amazonaws.com
REDIS_PORT: 6379
GAME_ENGINE_URL: http://game-engine-service:3001
USER_SERVICE_URL: http://user-service:3002
Notification Service:
REDIS_HOST: monopoly-dev-redis.f2xiko.ng.0001.usw2.cache.amazonaws.com
REDIS_PORT: 6379
SMTP_HOST: smtp.gmail.com (configurable)
FROM_EMAIL: noreply@monopolygame.comGame Engine:
# Should have but doesn't:
DB_HOST: β Not connected to PostgreSQL
REDIS_HOST: β Not connected to Redis
# Currently only has:
PORT: 3001
NODE_ENV: developmentClient β ALB β User Service β PostgreSQL
β
JWT Token Generated
β
Client β ALB β User Service
Client β ALB β Matchmaking Service
β
Validate Token β User Service
β
Add to Queue β Redis
β
Create Game β Game Engine (HTTP)
β
Client β ALB β Matchmaking Service
Client β ALB β Game Engine
β
In-Memory Processing
β
WebSocket Events
β
Client β WebSocket β Game Engine
Service Event β Notification Service
β
Store in Redis
β
WebSocket + Email
β
Client β WebSocket/Email β Notification Service
- β No database persistence (games lost on restart)
- β No Redis integration (no real-time state sharing)
- β No authentication integration (no user validation)
- β No notification integration (no game event notifications)
- β Game Engine doesn't validate users with User Service
- β Game Engine doesn't notify Notification Service of events
- β No game state persistence across service restarts
- β No integration with S3 for game assets/logs
- β User data persisted in PostgreSQL
- β Matchmaking queues in Redis
- β Notifications in Redis
- β Game state only in memory (critical gap)
Working Integrations:
- User Service β PostgreSQL (authentication, profiles)
- Matchmaking β Redis (player queues)
- Matchmaking β User Service (token validation)
- Matchmaking β Game Engine (game creation)
- Notification β Redis (message storage)
- All services β ALB (routing)
Missing Integrations:
- Game Engine β PostgreSQL (game persistence)
- Game Engine β Redis (real-time state)
- Game Engine β Notification Service (game events)
- Any service β S3 (asset/log storage)
The system is partially connected but the Game Engine (core component) operates in isolation, making it unsuitable for production use.