How arp242/goatcounter works
Main Components
a. Core Components:
• Web Server (HTTP/HTTPS endpoints)
• Database Layer (supports both SQLite and PostgreSQL)
• Analytics Processing Engine
• Data Collection Endpoints
• User Interface/Dashboard
• Background Jobs/Cron System
b. External Integrations:
• ACME/Let's Encrypt for SSL
• Client-side JavaScript Counter
• Log File Import System
• API Services
Key Relationships to Highlight
• Data Flow: Client → Collection Endpoints → Processing → Storage
• Background Processing: Cron → Stats Generation → Storage
• User Interface: Dashboard → API → Storage
• Authentication Flow: User → Auth → Permissions → Resources
Implementation Details
• Language: Go 1.21+
• Database Options: SQLite/PostgreSQL
• Web Server: Native Go HTTP
• Template Engine: Go templates
• Static Files: Embedded resources
• Internationalization: i18n support
• Authentication: Built-in user system