A local country-outline guessing game. A random sovereign country's silhouette flashes on screen for a configurable duration; then you pick the correct name from a searchable list. After all rounds, review your score and every answer.
npm install
npm run devOpen the URL shown in the terminal (typically http://localhost:5173).
npm run build
npm run previewGeoShapr is a static Vite app. Border GeoJSON is not committed to git; it is generated during
npm install / npm run build from the world-borders package, so Cloudflare’s build step handles
everything automatically.
Cloudflare’s current UI creates a Worker project (not the older standalone Pages flow). There is
no “Build output directory” field in the dashboard — that path is set in wrangler.toml under
[assets] directory.
If you have not already:
git add .
git commit -m "Add Cloudflare deployment config"
gh repo create geoshapr --private --source=. --pushUse --public instead of --private if you prefer a public repo.
- Go to https://dash.cloudflare.com/sign-up.
- Confirm your email and sign in.
-
Dashboard → Workers & Pages → Create → Import from Git (or Workers tab → import repo).
-
Authorize GitHub and select the
geoshaprrepository. -
In Build configuration, set:
Setting Value Production branch mainBuild command npm run buildInstall command npm installRoot directory /You will not see a “Build output directory” field — that comes from
wrangler.toml:[assets] directory = "./dist"
-
Under Variables and secrets (production), add:
Variable Value NODE_VERSION20 -
Save and deploy.
The first deploy takes a few minutes: npm installs dependencies, syncs ~54 MB of border data, builds
the site, then uploads dist/ as static assets.
When the deploy finishes, Cloudflare gives you a URL like:
https://geoshapr.<your-subdomain>.workers.dev
Every push to main triggers a new production deploy.
In the project → Domains, attach a domain you own.
If you prefer the older flow with a dashboard “Build output directory” field, create Pages →
Connect to Git instead of a Worker. Use build command npm run build and output directory
dist. Both approaches work for this project.
- Choose the number of rounds and how long each outline is shown (down to 0.01 seconds).
- Memorize each gray country shape on the black background.
- When the outline disappears, search the country list and submit your guess.
- View the summary screen with thumbnails, your guesses, correct answers, and final score.
- Vite + React + TypeScript
- Country boundaries from geoBoundaries via world-borders
- Country metadata from world-countries
- Map rendering with d3-geo