Rating Guessr is a "Higher or Lower" style web game that uses real-world data from the Google Maps API. Players choose a city and must guess if a specific restaurant has a higher or lower Google rating than the previous one.
The application features a robust anti-duplicate algorithm, user authentication for saving favorite spots, and a responsive design built with Next.js and Tailwind CSS.
- Search and play in any city supported by Google Maps (Tokyo, New York, Calgary, etc.).
- A custom server-side algorithm that "jitters" coordinates to find fresh places when a specific neighborhood runs dry, ensuring infinite gameplay without duplicates.
- Automatically filters out major global chains (McDonald's, Starbucks) to focus on local gems.
- Full Authentication (Google & Email/Password) via Firebase.
- Authenticated users can "Heart" locations to save them to their personal dashboard.
- Fully mobile-optimized interface with smooth animations and transitions.
- Framework: Next.js 16 (App Router)
- Language: JavaScript (ES6+)
- Styling: Tailwind CSS 4
- Icons: React Icons (FontAwesome & Lucide)
- Notifications: React Hot Toast
- Serverless Functions: Next.js API Routes (/api/*)
- Database: Firebase Firestore (NoSQL)
- Auth: Firebase Authentication
- Data Source: Google Places API (New) & Maps JavaScript API
Located in app/api/game/batch/route.js.
Instead of a simple database query, the app actively "hunts" for data.
- It searches a 2km radius around a central point (Anchor).
- It filters results against a Set O(1) of excluded chains and a history of seenIds.
- Polar Jittering: If the current area is exhausted (no new places found), the algorithm calculates a new search center using randomized Polar Coordinates, converted to Cartesian offsets. This ensures the API naturally searches around a city to find new content.
