# 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 15 and TypeScript for performance and type safety ## Tech Stack - **Framework**: Next.js 15 with App Router - **Language**: TypeScript with strict type checking - **Styling**: Tailwind CSS with custom design tokens - **Maps**: MapLibre GL JS - **360Β° Images**: MapillaryJS - **Image API**: Mapillary Graph API ## Getting Started ### Prerequisites - Node.js 18+ - npm or yarn ### Installation 1. Clone the repository: ```bash git clone cd vigeoguessr ``` 2. Install dependencies: ```bash npm install ``` 3. Run the development server: ```bash npm run dev ``` 4. Open [http://localhost:3000](http://localhost:3000) in your browser. ### Building for Production ```bash npm run build npm start ``` ## Project Structure ``` β”œβ”€β”€ app/ # Next.js app directory β”‚ β”œβ”€β”€ game/ # Game page β”‚ β”œβ”€β”€ globals.css # Global styles β”‚ β”œβ”€β”€ layout.tsx # Root layout β”‚ └── page.tsx # Home page β”œβ”€β”€ components/ # Reusable React components β”‚ β”œβ”€β”€ DonateModal.tsx β”‚ β”œβ”€β”€ GameMap.tsx β”‚ β”œβ”€β”€ Header.tsx β”‚ β”œβ”€β”€ PanoViewer.tsx β”‚ └── ResultModal.tsx β”œβ”€β”€ lib/ # Utility functions β”‚ └── utils.ts # Utility functions └── public/ # Static assets ``` ## Key Improvements from Original - **Modern Framework**: Migrated from vanilla HTML/JS to Next.js with TypeScript - **Component-Based Architecture**: Modular, reusable React components - **Clean Code**: Well-structured TypeScript with proper type safety and 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 - [viguessr](https://github.com/luuvanduc1999/viguessr) - Original implementation - [geoguessr](https://github.com/bensizelove/geoguessr) - Inspiration