Skip to content

roscrl/playlistvote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vote on user submitted Spotify playlists

config/readme/showoff.png

Setup

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

Dependencies

Frontend

Server side rendered Go templates with html/template

tailwindcss styling

@hotwired/turbo and @hotwired/stimulus for frontend JS, both vendored

Production

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

Development

is for assertions

fsnotify for watching Go template changes in dev mode without recompiling

rod for browser tests

Deploy

This application is deployed on a VPS

VPS Setup

  • Ensure config/private.pem exists (cloudflare origin certificate private key)
  • Ensure config/.prod exists (app config)
  • Set VPS_IP environment variable
  • Set CLOUDFLARE_EMAIL environment variable
  • Set CLOUDFLARE_KEY environment variable
  • Run make vps-new

Cloudflare

  • 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-Control headers returned
    • playlistvote.com/* Cache Level: Cache Everything
  • Always Use HTTPS, Enable Brotli

Hetzner

  • Set firewall to allow only Cloudflare IPs on port 443
  • Set firewall to allow only personal IP on port 22

Miscellaneous

Structure Inspiration

Mat Ryer - How I write HTTP services after eight years talk
Mat Ryer - Deep dive of real application
Mat Ryer - Twitter thread

About

vote on user submitted Spotify playlists

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages