How essem/game-logger works
Main Components
A. Frontend Layer (React Application)
• Main React application container
• Component groups:
• User Management (Login, Users, NewUser)
• Game Management (Games, NewGame)
• Event Management (Events, NewEvent)
• Player Management (Players, NewPlayer)
• Statistics (Stats, Summary)
• Redux store structure (based on the reducers folder)
B. Backend Layer (Node.js Server)
• Main server application
• Authentication service (auth.js)
• Core business logic modules:
• Events management
• Users management
• Statistics calculation
• WebSocket handling
• Model layer showing relationships between:
• Events
• Games
• Players
• Users
• Winners/Losers
C. Database Layer (PostgreSQL)
• Database container
• Main tables based on the models and migrations
[Client Tier]
• ↕
[Application Tier]
• ↕
[Data Tier]
Component Relationships to Highlight
A. Frontend-Backend Communication:
• HTTP requests (shown in http.js)
• WebSocket connections (websocket.js)
• API endpoints
B. Data Flow:
• User authentication flow
• Game logging process
• Statistics calculation pipeline
• Event management workflow
Specific Implementation Details
A. Frontend Section:
[React Application]
• Components Layer
• User Management
• Game Management
• Event Management
• Statistics
• Redux Store
• App State
• User State
• Event State
• Events State
B. Backend Section:
[Node.js Server]
• API Routes
• Authentication
• Business Logic
• Events Handler
• Users Handler
• Stats Calculator
• WebSocket Handler
• Model Layer
C. Database Section:
[PostgreSQL]
• Users Table
• Events Table
• Games Table
• Players Table
• Winners Table
• Losers Table
Additional Elements
• Configuration management (config folder)
• Development tools (Docker containers)
• Migration system
• Environment-specific settings
Important Notes
• Docker container boundaries
• Development port (5001)
• WebSocket connections separately from HTTP routes
• Authentication flow across all layers
• How the statistics calculation pipeline works