# Geoguessr Self-Hosted Reimplementation ## Build Docker Image Tarball ```bash ./docker/build.sh ``` ## API ``` API Endpoints GET / Returns { "version": string, "status": string } PUT /game Accepts { "timer": number } Returns { "gameId": string } GET /game/{ID} Returns { "gameId": string, "timer": number, "coords": { "1": { "lat": number, "lng": number, }, ... }, "players": [ { "name": string, "currentRound": string || null, "totalScore": number, "guesses": { "1": { "lat": number, "lng": number, "score": number }, ... } }, ... ] } POST /game/{ID}/join Header Authorization: Name string Returns 201 vs 401 GET /game/{ID}/current Header Authorization: Name string Returns { "currentRound": string || null, "coord": { "lat": number, "lng": number, } || null, "timer": number } POST /game/{ID}/guesses/{round} Header Authorization: Name string Accepts { "lat": number, "lng": number } OR { "timeout": boolean } Returns 400 vs 201 and { "score": number, "totalScore": number, "distance": number || null, } ``` ## Next Steps - Improve scoring math - Improve MapCrunch logic to distribute countries - Asynchronously generate locations, allowing game creation to appear faster - Update UI to create game without providing a name - Genericize number of rounds in API - Change UI to allow round number setting - Change join API to take player name as body argument and return ID - Use player ID "auth" in API instead of name - Error handling in UI - Re-join a game you did not finish - Optimize docker file or set up compose structure - Override google controls in streetview, make custom divs