mirror of
https://github.com/tiennm99/vigeoguessr.git
synced 2026-10-14 16:18:12 +00:00
c8f1ebc7af5811facbc4819a0a7f744c0a12f99c
Migrates the interactive map from Leaflet to MapLibre GL JS for native coordinate synchronization with MapillaryJS, improving precision and performance. Updates dependencies, removes Leaflet imports, refactors GameMap to use MapLibre GL JS, and enhances PanoViewer to extract and propagate precise MapillaryJS coordinates. Updates documentation to reflect the new architecture and rationale for the change.
VIGEOGUESSR
A Next.js-based Vietnamese geography guessing game where players guess the location of panoramic street view images from various Vietnamese cities.
Features
- 🗺️ Multiple Vietnamese cities: Hanoi, Ho Chi Minh City, Hai Phong, Nam Dinh, Da Lat, and Duc Hoa
- 📱 Responsive design that works on desktop and mobile
- 🎯 Interactive map for location guessing
- 📊 Distance-based scoring system
- 🖼️ 360° panoramic street view images using Photo Sphere Viewer
- ⚡ Built with Next.js 14 and JavaScript for performance and simplicity
Tech Stack
- Framework: Next.js 14 with App Router
- Language: JavaScript
- Styling: CSS Modules with custom styling
- Maps: Leaflet.js
- 360° Images: Photo Sphere Viewer
- Image API: Mapillary Graph API
Getting Started
Prerequisites
- Node.js 18+
- npm or yarn
Installation
- Clone the repository:
git clone <repository-url>
cd vigeoguessr
- Install dependencies:
npm install
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser.
Building for Production
npm run build
npm start
Project Structure
├── app/ # Next.js app directory
│ ├── game/ # Game page
│ ├── globals.css # Global styles
│ ├── layout.js # Root layout
│ └── page.js # Home page
├── components/ # Reusable React components
│ ├── DonateModal.js
│ ├── GameMap.js
│ ├── Header.js
│ ├── PanoViewer.js
│ └── ResultModal.js
├── lib/ # Utility functions
│ └── gameUtils.js # Game logic and API calls
└── public/ # Static assets
Key Improvements from Original
- Modern Framework: Migrated from vanilla HTML/JS to Next.js with JavaScript
- Component-Based Architecture: Modular, reusable React components
- Clean Code: Well-structured JavaScript with proper organization
- Code Deduplication: Eliminated duplicate code and consolidated utilities
- Performance: Optimized with Next.js built-in optimizations
- Maintainability: Cleaner code structure and separation of concerns
- Responsive Design: Better mobile experience
Credit
Languages
CSS
70.3%
HTML
29.7%