2025-04-29 09:21:52 -04:00
2024-09-28 13:13:38 -04:00
2025-04-27 12:03:34 -04:00
2025-04-25 19:50:49 -04:00
2025-04-25 19:50:49 -04:00
2024-05-14 13:07:07 +02:00
2024-10-16 20:36:55 -04:00
2024-10-16 20:36:55 -04:00
2024-04-29 17:26:46 -04:00
2025-04-29 09:21:52 -04:00
2024-10-23 09:23:24 -04:00

rogueserver

Backend Golang server & API for PokéRogue.

Building

There are 2 main methods to host a local instance of the server: via Docker and as a local install.

Docker

Requirements:

Use the sample docker-compose file to set up a docker container to run the server. On initialization, this will create an empty mariadb database with the default username/password combo of pokerogue:pokerogue.

Self Hosting outside of Docker:

Required Tools:

  • Golang 1.22 or higher (downloadable here)
  • Node: 18.3.0 or higher
  • npm: how to install
  • Both this repository and the main repo cloned on your device

Building

Running the server requires only the rogueserver executable (compiled from this repo). Run the following code from the repository root to create and run it1:

go build .
./rogueserver --debug --dbuser yourusername --dbpass yourpassword

(If on windows, replace rogueserver with rogueserver.exe.)

Now, go to the main repo root and run npm run start to boot it up. With some luck, the frontend should connect to the local backend and run smoothly!

Hosting for other computers

Now, if you want to access your local server from other machines using localhost, you will need to configure your device's firewalls to allow inbound connections for the ports running the API and server (8000 & 8001). An example to allow incoming connections using UFW on Linux:

sudo ufw allow 8000,8001/tcp

This should allow you to reach the game from other computers on the same network.

Tying to a Domain

If you want to tie the local instance to a domain and make it publicly accessible, there are a few extra steps to be done.

This is FULLY OPTIONAL. The first 2 steps should be enough for most users merely wanting to test stuff out.

Caddy is recommended for use as a reverse proxy. After installing it, set up a config file like so:

pokerogue.exampledomain.com {
	reverse_proxy localhost:8000
}
pokeapi.exampledomain.com {
	reverse_proxy localhost:8001
}

(Replace the URLs with whatever domain name you want to tie the server to.) Then, set up caddy as a service as shown here.

Once this is good to go, take your API url (https://pokeapi.exampledomain.com) and paste it into .env.development inside the main repo, replacing the prior 0.0.0.0:8001 address.

Make sure that ports 8000 and 8001 are both portforwarded on your router.

Enjoy!


  1. After doing this, you shouldn't have to re-build it again unless making changes to backend code. ↩︎

Description
Game server backend and API for PokéRogue
Readme AGPL-3.0 1.3 MiB
Languages
Go 99.2%
Dockerfile 0.4%
Shell 0.4%