A geography guessing game with a global leaderboard.
This repository contains two independent applications that run on separate Unikraft instances:
pangea/
├── game/ # SvelteKit frontend application
└── leaderboard-api/ # Bun backend API for leaderboard
The main SvelteKit application that hosts the geography guessing game. Players try to identify countries and compete for high scores.
- Tech Stack: SvelteKit, Svelte 5, TailwindCSS, DaisyUI
- Port: 5173 (dev), configurable in production
A lightweight Bun server that handles leaderboard CRUD operations with SQLite storage.
- Tech Stack: Bun, SQLite
- Port: 3001 (default)
- Endpoints:
GET /api/leaderboard?limit=100- Fetch leaderboard entriesPOST /api/scores- Submit a new scoreGET /health- Health check
You'll need to run both services simultaneously in separate terminals:
Terminal 1 - Leaderboard API:
cd leaderboard-api
bun install
bun run devTerminal 2 - Game:
cd game
bun install
bun run devThe game will be available at http://localhost:5173 and will connect to the leaderboard API at http://localhost:3001.
Game (/game):
VITE_LEADERBOARD_API_URL- URL of the leaderboard API (defaults tohttp://localhost:3001)
Leaderboard API (/leaderboard-api):
PORT- Server port (defaults to 3001)DATABASE_PATH- Path to SQLite database (defaults toleaderboard.db)CORS_ORIGIN- Comma-separated list of allowed origins
Each application is deployed independently to separate Unikraft instances:
- Game: Deploy the SvelteKit app to your Unikraft instance
- Leaderboard API: Deploy the Bun server to a separate Unikraft instance
- Configure the game's
VITE_LEADERBOARD_API_URLto point to the deployed leaderboard API
See individual README files in each directory for deployment-specific instructions.
The two applications are completely independent:
- The game makes HTTP requests to the leaderboard API
- No shared code or database between them
- They can be scaled and deployed separately
- CORS is configured on the API to allow requests from the game's origin