vote on user submitted Spotify playlists
Refer to the Makefile for setup details
Install Zig for the built-in C cross-compiler to Linux (or any C compiler for the 'make build' target)
make tools && make hotreload-mock
Server side rendered Go templates with html/template
tailwindcss styling
@hotwired/turbo and @hotwired/stimulus for frontend JS, both vendored
go-sqlite3 as database driver (requires zig cc to compile x86 from ARM)
sqlc for generating Go code from SQL queries
prominentcolor for extracting prominent colors from playlist images
newrelic/go-agent for application monitoring
is for assertions
fsnotify for watching Go template changes in dev mode without recompiling
rod for browser tests
This application is deployed on a VPS
- Ensure
config/private.pemexists (cloudflare origin certificate private key) - Ensure
config/.prodexists (app config) - Set
VPS_IPenvironment variable - Set
CLOUDFLARE_EMAILenvironment variable - Set
CLOUDFLARE_KEYenvironment variable - Run
make vps-new
- Set SSL
Full (strict) - Add an A record in the DNS settings pointing to VPS IP
- Create Origin Certificate and place in
config/public.pem&config/private.pem - Enable Rate Limiting
(http.request.uri.path contains "/")50 requests per 10s
- Enable Bot Fight Mode
- Enable Page Rules Caching to respect
Cache-Controlheaders returned- playlistvote.com/* Cache Level: Cache Everything
- Always Use HTTPS, Enable Brotli
- Set firewall to allow only Cloudflare IPs on port 443
- Set firewall to allow only personal IP on port 22
Mat Ryer - How I write HTTP services after eight years talk
Mat Ryer - Deep dive of real application
Mat Ryer - Twitter thread
