Every day, guess the country and the capital of a new flag.
Vue 3 + Vite + Tailwind CSS with daisyUI, served by Bun as a single compiled binary
The server reads the flag of each day from a daily.json file. Each key is a date, each value a country code from resources/countries.json:
{
"2022-03-25": "fr",
"2022-03-26": "de",
"2022-03-27": "it"
}To generate 3 years of random flags from today:
bun scripts/daily-generator.mjsYou need Bun 1.4.4, the version in .bun-version.
bun install
mkdir -p dev && cp daily.json dev/daily.json # outside production, the server reads dev/daily.json
bun run dev-server # API on port 7059
bun run dev # Vite, which proxies /api, /countries and /capitals to the APIBefore you push, run bun run typecheck and bun run build.
docker-compose pull && docker-compose up -d --remove-orphansThe image mounts daily.json from the host. The TZ variable in docker-compose.yml decides when a new day, and so a new flag, starts.
