Skip to content

About

Drapeau du jour / Flag of the day

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation


Drapeau du jour
Drapeau du jour

Every day, guess the country and the capital of a new flag.

Drapeau du jour after a correct answer: the French flag, both answers checked and the result card

Vue 3 + Vite + Tailwind CSS with daisyUI, served by Bun as a single compiled binary

Before you start

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.mjs

Develop

You 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 API

Before you push, run bun run typecheck and bun run build.

Deploy

docker-compose pull && docker-compose up -d --remove-orphans

The 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.

About

Drapeau du jour / Flag of the day

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Packages

Used by

Contributors

Languages