Skip to main content
Daily GeoGame is built with modern web technologies optimized for developer experience and performance.

Framework

Next.js 15

The application uses Next.js 15 with the App Router for full-stack React development. Why Next.js?
  • Server and client components in one codebase
  • Built-in API routes for backend logic
  • Automatic code splitting and optimization
  • Zero-config TypeScript support
  • Server-side rendering for better SEO
Key features used:
  • App Router for file-based routing (app/ directory)
  • Server Actions for data mutations
  • React Server Components for initial data fetching
  • API routes for backend endpoints (app/api/)
  • Middleware for request interception
  • Turbopack for faster development builds
Reference: package.json:18
Build scripts use the --turbopack flag for improved performance:
Reference: package.json:6-7

UI framework

React 19

The frontend is built with React 19, using hooks and functional components throughout. Key patterns:
  • Hooks: useState, useEffect, useRouter for state management
  • Suspense: Loading states with <Suspense> boundaries
  • Client components: Marked with "use client" directive
  • Composition: Small, reusable components
Reference: package.json:19-20 Why React 19?
  • Improved Suspense support
  • Better concurrent rendering
  • Server Component integration with Next.js
  • Enhanced TypeScript support

Tailwind CSS

All styling is done with Tailwind CSS utility classes. Configuration:
  • Tailwind CSS v4 with PostCSS plugin
  • Dark theme by default (bg-[#121212])
  • Custom color palette for game UI
  • Responsive design with mobile-first approach
Reference: package.json:27,34 Example usage:
Reference: app/page.tsx:55-57

Framer Motion

Used for animations and transitions throughout the UI. Use cases:
  • Hint reveal animations
  • Modal transitions (stats modal)
  • Guess list animations
  • Map country highlighting
Reference: package.json:15

Lucide React

Icon library for consistent, lightweight icons. Examples:
  • Navigation arrows
  • Stats icons
  • Game UI elements
Reference: package.json:16

Language

TypeScript

The entire codebase is written in TypeScript with strict type checking. Type definitions:
Reference: app/types.ts:3-45 Why TypeScript?
  • Catch errors at compile time
  • Better IDE autocomplete
  • Self-documenting code
  • Safer refactoring
  • Improved maintainability
Reference: package.json:35

Database

MongoDB Atlas

Persistent storage using MongoDB’s cloud database service. Collections:
  • daily_games: One document per date with target country and hints
  • user_progress: Progress tracking per session and date
Driver:
Reference: package.json:17 Connection management: Singleton pattern with connection pooling:
Reference: app/lib/mongodb.ts:1-22 Why MongoDB?
  • Flexible schema for country data
  • Easy to store nested hint packages
  • Fast document queries by date
  • Free tier on Atlas for small projects
  • JSON-like document structure matches JavaScript

External APIs

RestCountries API

Provides comprehensive country data including:
  • Country names and codes
  • Flags (SVG URLs)
  • Geographic coordinates
  • Border countries
  • Population and area
  • Regions and subregions
Endpoint used:
Reference: app/api/daily/route.ts:12-13 Data shape:

CIA World Factbook

JSON version hosted on GitHub provides detailed country information for hints. Base URL:
Reference: app/lib/factbook.ts:19 Data extracted:
  • Climate descriptions
  • Terrain information
  • Natural resources
  • Export commodities
  • Demographics and religions
  • Flag descriptions
  • National symbols
Regional structure:
Reference: app/lib/factbook.ts:5-17 HTTP client:
Reference: package.json:12 Axios is used for Factbook requests due to better error handling:
Reference: app/lib/factbook.ts:33-35

Map visualization

D3-geo

Core library for geographic projections and path generation.
Reference: package.json:14,28 Usage:
  • Mercator projection for world map
  • Path generation from GeoJSON
  • Coordinate transformations

react-svg

Loads and renders SVG map files dynamically.
Reference: package.json:21

react-zoom-pan-pinch

Enables interactive map controls:
Reference: package.json:22 Features:
  • Mouse wheel zoom
  • Click and drag panning
  • Touch gestures on mobile
  • Programmatic zoom/pan controls

Session management

cookies-next

Server and client cookie handling for Next.js:
Reference: package.json:13 Usage:
Reference: app/api/progress/route.ts:4,17-18

uuid

Generates unique session identifiers:
Reference: package.json:23
Reference: app/api/progress/route.ts:3,21

Utilities

Geographic calculations

Custom utilities for distance and bearing calculations:
Reference: app/lib/geoUtils.ts:5-44

Development tools

ESLint

Code linting with Next.js configuration:
Reference: package.json:32-33

pnpm

Package manager for faster installs and better disk efficiency. Why pnpm?
  • Faster than npm/yarn
  • Saves disk space with content-addressable storage
  • Strict dependency resolution
Reference: README.md:32-34

Deployment

Vercel

The app is deployed on Vercel’s platform (Next.js creators). Benefits:
  • Zero-config deployment
  • Automatic HTTPS
  • Edge network CDN
  • Environment variable management
  • Preview deployments for PRs
Live URL: https://daily-geogame.vercel.app Reference: README.md:5

Environment variables

Required configuration:
Reference: README.md:39 Stored in:
  • .env.local for development
  • Vercel dashboard for production

Technology choices summary