Skip to content

gfarb/its-five-oclock-somewhere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍹 It's 5 O'Clock Somewhere!

its-5-oclock-somewhere.vercel.app

A fun little web app that tells you which countries in the world have hit happy hour (5pm or later) right now. Inspired by the Jimmy Buffett classic — because it's always 5 o'clock somewhere.

Why?

I'm a huge parrothead (Jimmy Buffett fan) and wanted an excuse to practice my Go. I wrote an algorithm that efficiently identifies countries where, based on the current UTC time, it's 5pm or later using a sorted map of UTC offsets and binary search. It was a fun way to play with Go's slices, maps, and sort packages.

I used GitHub Copilot to build out the frontend — an animated Caribbean-themed page with an SVG cocktail, swimming sea life, and a scrolling country ticker.

I decided to host it on Vercel because I wanted to play with serverless functions. The Go API runs as a Vercel serverless function, and the static frontend is served from the public/ directory. Zero infrastructure to manage.

How it works

The Go function maintains a map of UTC offsets to country names. On each request, it calculates which offsets correspond to 5pm+ at the current time and returns the matching countries as JSON. The frontend fetches this list and displays it in a shuffled scrolling ticker.

Project structure

api/
  five_o_clock_somewhere.go   # Vercel serverless Go function
  go.mod
public/
  index.html                  # Page markup + SVG cocktail
  style.css                   # Caribbean-themed styles
  script.js                   # Ticker, sea life animations
vercel.json                   # Vercel config

Running locally

npm i -g vercel
vercel dev

Future plans

  • Terminal app/script that displays happy hour countries right from the command line