WorldGuessr game (frontend + backend)
Find a file
forgejo-bot 76e1c9b8c6
Some checks failed
Build WorldGuessr / build (push) Failing after 1m53s
Merge remote-tracking branch 'upstream/master'
2026-03-24 18:00:56 +00:00
.claude Add GameDistributionBanner component and integrate into game UI and home screens 2026-03-22 18:16:24 +05:30
.forgejo/workflows Fix sync: allow unrelated histories for initial upstream merge 2026-03-23 17:24:38 +01:00
.github/workflows Remove original GitHub workflow gamedistribution-build.yml 2026-03-15 14:15:53 +01:00
api Add logging for user lookup requests to enhance debugging 2026-03-24 12:11:00 -05:00
components Merge remote-tracking branch 'upstream/master' 2026-03-24 18:00:56 +00:00
data Initial commit 2026-03-15 13:37:08 +01:00
docs Initial commit 2026-03-15 13:37:08 +01:00
lib Initial commit 2026-03-15 13:37:08 +01:00
mapgens Initial commit 2026-03-15 13:37:08 +01:00
models Initial commit 2026-03-15 13:37:08 +01:00
pages Refactor ad management: remove video ad components and related logic 2026-03-21 17:17:30 +05:30
public Refactor ad management: remove video ad components and related logic 2026-03-21 17:17:30 +05:30
scripts Initial commit 2026-03-15 13:37:08 +01:00
serverUtils Initial commit 2026-03-15 13:37:08 +01:00
styles Refactor ad management: remove video ad components and related logic 2026-03-21 17:17:30 +05:30
utils Initial commit 2026-03-15 13:37:08 +01:00
ws Fix IP banning logic to ensure error handling is correctly scoped 2026-03-23 01:16:51 +05:30
.eslintrc.json Initial commit 2026-03-15 13:37:08 +01:00
.gitignore Initial commit 2026-03-15 13:37:08 +01:00
.replit Initial commit 2026-03-15 13:37:08 +01:00
clientConfig.js Initial commit 2026-03-15 13:37:08 +01:00
cron.js Initial commit 2026-03-15 13:37:08 +01:00
Dockerfile Initial commit 2026-03-15 13:37:08 +01:00
jsconfig.json Initial commit 2026-03-15 13:37:08 +01:00
LICENSE.md Initial commit 2026-03-15 13:37:08 +01:00
next.config.js Initial commit 2026-03-15 13:37:08 +01:00
package.json Initial commit 2026-03-15 13:37:08 +01:00
pnpm-lock.yaml Initial commit 2026-03-15 13:37:08 +01:00
Procfile Initial commit 2026-03-15 13:37:08 +01:00
README.md Initial commit 2026-03-15 13:37:08 +01:00
removeCloseLocs.cjs Initial commit 2026-03-15 13:37:08 +01:00
replit.nix Initial commit 2026-03-15 13:37:08 +01:00
server.js Initial commit 2026-03-15 13:37:08 +01:00
welcome.js Initial commit 2026-03-15 13:37:08 +01:00

WorldGuessr

A free and open-source version of the popular geography game inspired by GeoGuessr. This React based project aims to provide a fun and educational way to explore the world through Google Street View imagery.

Play now here!

Join the Discord community

Features

  • Random Street Views: Experience a new location anywhere in the world on each game.
  • Multiplayer Mode: Challenge your friends or play against random opponents in real-time.
  • Country Streaks: Test your knowledge and see how many countries you can guess in a row.
  • Free to run: The project is open-source and free to run on your own server. Uses the Google Maps Streetview Embed API, which is completely free compared to the costly SDK used by GeoGuessr.

Acknowledgements

  • Leaflet for the minimap display.
  • Google Maps API for the generous free-tier on street view imagery.
  • Vali by @SlashP for generating balanced locations distributions for all countries.
  • Next.js for the web application.
  • All contributors who helped bring this project to life!

Running Locally

Prerequisites

Before you start, ensure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/codergautam/worldguessr.git
    cd worldguessr
    
  2. Install dependencies:

    pnpm install
    
  3. Run the development server:

    pnpm run dev
    

    Open http://localhost:3000 with your browser to see the result.

Deploying to a VPS / External Server

If you're deploying WorldGuessr on a VPS or any server with an external IP (not localhost), you must configure these environment variables in your .env file:

# Replace YOUR_IP with your server's IP address or domain
NEXT_PUBLIC_API_URL=YOUR_IP:3001
NEXT_PUBLIC_WS_HOST=YOUR_IP:3002

Example with IP:

NEXT_PUBLIC_API_URL=123.45.67.89:3001
NEXT_PUBLIC_WS_HOST=123.45.67.89:3002

Example with domain (after setting up nginx):

NEXT_PUBLIC_API_URL=api.yourdomain.com
NEXT_PUBLIC_WS_HOST=ws.yourdomain.com

Quick Setup Checklist

  1. MongoDB - Create a cluster on MongoDB Atlas (free tier available) and add the connection string:

    MONGODB=mongodb+srv://username:password@cluster.mongodb.net/worldguessr
    
  2. Google OAuth - Create credentials at Google Cloud Console:

    NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_client_id.apps.googleusercontent.com
    GOOGLE_CLIENT_SECRET=your_client_secret
    
  3. API/WS URLs - Point to your external IP or domain (see above)

For detailed environment variable documentation, see docs/environment-variables.md.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. You are free to use, modify, and distribute this project for personal or commercial use. See LICENSE.md for more information.

Community

Join the Discord community here to discuss new features, report bugs, talk to the developers and connect with other players.

You can email me privately at gautam@worldguessr.com