Nav apraksta

Kirk Trombley 34eb2cd10b Big swath of reorganizing now that the deployment path is clear 5 gadi atpakaļ
docker 34eb2cd10b Big swath of reorganizing now that the deployment path is clear 5 gadi atpakaļ
server 34eb2cd10b Big swath of reorganizing now that the deployment path is clear 5 gadi atpakaļ
ui 34eb2cd10b Big swath of reorganizing now that the deployment path is clear 5 gadi atpakaļ
.dockerignore 34eb2cd10b Big swath of reorganizing now that the deployment path is clear 5 gadi atpakaļ
.gitignore 34eb2cd10b Big swath of reorganizing now that the deployment path is clear 5 gadi atpakaļ
README.md 34eb2cd10b Big swath of reorganizing now that the deployment path is clear 5 gadi atpakaļ

README.md

Geoguessr Self-Hosted Reimplementation

Build Docker Image Tarball

./docker/build.sh

Back End

In the future, names should be tracked via actual tokens

API Endpoints
GET /
    Returns {
        "version": string,
        "status": string
    }
GET /googleApiKey
    Returns {
        "googleApiKey": string
    }
PUT /game
    Header Authorization: Name string
    Accepts {
        "timer": number
    }
    Returns {
        "gameId": string
    }
GET /game/{ID}
    Returns {
        "gameId": string,
        "creator": 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}/guesses
    Header Authorization: Name string
    Returns {
        "currentRound": string || null,
        "guesses": {
            "1": {
                "lat": number,
                "lng": number,
                "score": 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
    }

Front End

- Render streetview pano
- Render map for guessing
    - On click, place and track marker for guess
- Render control pane
    - Submit button
    - Timer
    - Round counter
    - Current scores
- Fetch /game/{ID}, extract coords and timer length
- Main Loop
    - Fetch /game/{ID}/guesses/{name}, update scores and round
        - if round comes back null, redirect to /summary/{ID}
    - Extract current coord
    - Clear map markers
    - Zoom out map
    - Change pano to coord
    - Reset timer
    - On timeout or submit -> POST to /game/{ID}/guesses/{name}/{round}