How sawatkins/upfast-tf works
Main Components
A. Frontend Layer:
• Web Interface (Static files and Templates)
• Relationship between templates, static assets, and the Go server
• Main template layouts and partials structure
B. Backend Layer:
• Go Web Server
• Handlers for CLI and Web requests
• Models for data structure
• SQLite Database integration
C. Infrastructure Layer:
• AWS EC2 Instances (TF2 Servers)
• Terraform Configuration
• Server Installation Scripts
• Prometheus Monitoring
[Client Layer]
• ↓↑
[Application Layer]
• ↓↑
[Infrastructure Layer]
Detailed Component Breakdown
Client Layer:
• Static assets (CSS, JS, images)
• Template rendering flow
Application Layer:
• Main Go server component
• Handler routes (/handlers)
• Database interactions
• Models structure
Infrastructure Layer:
• Terraform modules (cli/modules/tf2_server_module)
• AWS EC2 instances
• Server installation process
• Prometheus monitoring system
Key Flows to Highlight
A. Server Provisioning Flow:
• CLI → Terraform → AWS EC2 → Server Install Script → Running TF2 Server
B. Monitoring Flow:
• TF2 Server → Prometheus → Backend → Frontend Dashboard
C. User Interaction Flow:
• Browser → Go Server → Templates → Rendered Page
Important Elements
• Database schema representation (SQLite)
• AWS EC2 instance configurations
• Terraform module structure
• Template rendering pipeline
• Monitoring data flow
• API endpoints and handlers
Technical Details to Note
• Relationship between main.go and handlers
• CLI automation tools
• Monitoring integration points
• Template inheritance structure
Specific Implementation Notes
• Template structure (templates/layouts/main.html relationship with partials)
• Terraform module configuration (cli/modules/tf2_server_module)
• Handler routing system (handlers/cli-handler.go and handlers/handlers.go)
Remember to emphasize the infrastructure automation aspects, as this is a key feature of the platform, while also showing how it integrates with the web interface and monitoring system.