How alik-r/casino-roulette works
Main Components
a) Client Layer:
• HTML/CSS Frontend (HTMX + Alpine.js)
• Static Assets (images, fonts, styles)
• Client-side Scripts
• Nginx Server (serving static content)
b) API Layer:
• Go Backend Server (Chi framework)
• JWT Authentication System
• API Endpoints
• Middleware
c) Data Layer:
• PostgreSQL Database
• Data Models
d) Infrastructure:
• Docker Containers
• Docker Compose Orchestration
[Frontend Container]
• (HTTP/HTTPS)
• v
[Backend Container]
• (SQL)
• v
[Database Container]
Detailed Component Breakdown
Frontend Container (Port 81):
• Nginx Web Server
• Static Files (HTML, CSS, JS)
• Pages:
• Registration
• Roulette Game
• Leaderboard
• Profile
Backend Container (Port 8080):
• API Handlers (/pkg/api)
• Authentication (/pkg/auth)
• Database Interface (/pkg/db)
• Middleware (/pkg/middleware)
• Models (/pkg/models)
• Roulette Logic (/pkg/roulette)
Database Container (Port 5433):
• PostgreSQL Database
• User Data
• Transaction History
• Game States
Flow Indicators
• User authentication flow
• API requests/responses
• Database queries
• WebSocket connections (if implemented)
• JWT token flow
Additional Elements
• Environment variables
• Configuration files
• Docker Compose orchestration
• GitHub Actions deployment
Technical Details
• Port mappings (81, 8080, 5433)
• Technology stack labels
• Database schema references
• API endpoint groupings
• Authentication middleware placement
Optimization Notes
• Caching mechanisms (if any)
• Static file serving through Nginx
• Security middleware positions
• Scalable components
Remember to indicate the containerization boundary with Docker, showing how the three main services (frontend, backend, database) are orchestrated through Docker Compose.