No description
Logs mic track settings and input audio levels to browser console to diagnose why audio is arriving as silence. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .gitea/workflows | ||
| cmd/api | ||
| config | ||
| internal | ||
| migrations | ||
| static | ||
| views | ||
| .gitignore | ||
| CLAUDE.md | ||
| DEPLOYMENT.md | ||
| dev-docker.sh | ||
| dev.sh | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.ci | ||
| Dockerfile.whisper | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
Coko Meeting Bet Tracker
A simple web application for tracking betting on how many times certain terms will be mentioned during the HealthJoy Coko Meeting.
Features
- User Authentication: Simple username-based login
- Guess Submission: Each user can submit their guesses once for how many times each term will be mentioned
- Live Counter: Real-time counting with +/- buttons and SSE updates across all connected clients
- Debouncing: Smart debouncing that prevents rapid double-clicks from different users but allows same-user repeated clicks
- Leaderboard: Summary page showing all users' guesses vs actual counts, sorted by total error
Tech Stack
- Backend: Go 1.25 + Fiber v2
- Templating: Templ (type-safe HTML templates)
- Frontend: HTMX + vanilla JavaScript
- Database: SQLite (CGO-free with modernc.org/sqlite)
- Real-time: Server-Sent Events (SSE)
- Deployment: Docker + Traefik
Terms Being Tracked
- Agent
- AI
- Winner
- Synergy
Development
Prerequisites
- Go 1.25+
- Templ CLI:
go install github.com/a-h/templ/cmd/templ@latest
Running Locally
# Start development server with live reload
./dev.sh
# Or manually:
templ generate
go run cmd/api/main.go
Access the app at http://localhost:8080
Building
# Generate templ files
templ generate
# Build binary
go build -o coko cmd/api/main.go
# Run
./coko
Deployment
Docker Build
docker build -t coko:latest .
Docker Compose with Traefik
# No environment setup needed - uses sensible defaults!
docker-compose up -d
The application will be available at https://coko.bobparsons.dev (configured via Traefik).
Configuration
All configuration has sensible defaults built-in. No environment variables required!
Defaults:
- Version:
1.0.0 - Environment:
production - Port:
8080 - Database:
./data/coko.db(or/app/data/coko.dbin Docker) - CORS:
*(allow all) - Debounce window:
5seconds
You can override any setting with environment variables if needed, but it's not necessary for basic deployment.
Debouncing Logic
The debouncing system prevents spam while allowing intentional repeated clicks:
- If User A clicks +1 on "Agent", then User B clicks +1 on "Agent" within 5 seconds → Only counts once (debounced)
- If User A clicks +1 on "Agent" twice within 5 seconds → Counts both (same user bypass)
Project Structure
coko/
├── cmd/api/main.go # Application entry point
├── config/ # Configuration management
├── internal/
│ ├── app/ # DI container
│ ├── controllers/ # Business logic
│ ├── handlers/ # HTTP handlers
│ ├── middleware/ # HTTP middleware
│ ├── models/ # Data models
│ ├── repositories/ # Database access
│ ├── server/ # Fiber server setup
│ └── services/ # Business services
├── views/ # Templ templates
├── static/ # CSS, JavaScript
├── migrations/ # Database schema
└── docker-compose.yml # Docker deployment
License
Temporary code for HealthJoy Coko Meeting (3-day lifetime).