# Geoguessr Self-Hosted Reimplementation ## Build Docker Image Tarball ```bash ./docker/build.sh ``` ## API ``` API Endpoints GET / Returns 200 and { "version": string, "status": string } POST /score Accepts { "point1": { "lat": number, "lng": number }, "point2": { "lat": number, "lng": number } } Returns 400 or 200 and { "score": number, "distance": number } PUT /game Accepts { "timer": number, "rounds": number } Returns 200 and { "gameId": string } GET /game/{ID} Returns 404 vs 200 and { "gameId": string, "timer": number, "rounds": number, "coords": { "1": { "lat": number, "lng": number, }, ... }, "players": [ { "name": string, "currentRound": string || null, "totalScore": number, "guesses": { "1": { "lat": number, "lng": number, "score": number || null, }, ... } }, ... ], "linkedGame": string || null } POST /game/{ID}/linked Accepts { "linkedGame": string } Returns (401, 404) vs 201 POST /game/{ID}/join Accepts { "playerName": string } Returns (401, 404, 409) vs 201 and { "playerId": string } GET /game/{ID}/current Header Authorization: Player string Returns (400, 404) vs 200 and { "currentRound": string || null, "coord": { "lat": number, "lng": number, } || null, "timer": number } POST /game/{ID}/guesses/{round} Header Authorization: Player string Accepts { "lat": number, "lng": number } OR { "timeout": boolean } Returns (400, 401, 404, 409) vs 201 and { "score": number, "totalScore": number, "distance": number || null } ``` ## Next Steps - Improve MapCrunch logic to distribute countries - Asynchronously generate locations, allowing game creation to appear faster - Improve 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 - Modify scoring to linear interp in the middle