A progressive Node.js framework for building efficient and scalable server-side applications.
A NestJS API responsible for handling all GameNode requests.
This diagram provides a simplified overview of our backend architecture.
A fullscreen version is available here.
You can use the docker-compose.yml
file in the root folder to start a local instance of GameNode.
It will automatically set up a Supertokens instance, the NestJS server, a MySQL database and a Redis instance.
If you are looking to self-host GameNode (server), this is the easiest way to do it.
You still need to set up .env
file. Most of the docker-compose parameters come from it.
See Installation for more details.
The default docker-compose files will not run migrations automatically.
Migrations are dangerous and should be run manually, after checking each generated migration file.
You can attach to any running gamenode container and run the migrations manually:
$ docker exec -it gamenode_server_1 bash # Replace gamenode_server_1 with your container name
$ yarn migration:generate
# ...manually check the generated migration file (use vim/nano/cat or docker cp to host)
$ yarn migration:run
# No need to restart the container, changes are made directly to MySQL.
If you are developing locally, you can use this command to spin up your containers and start the server:
$ yarn start:dev:docker # docker compose up -d && yarn start:dev
You can also attach your editor to the Docker container if it supports remote development (like VS Code, IntelliJ IDEA, etc.).
The provided MySQL instance will hold all data for both GameNode Server itself and from Supertokens.
Bugs and issues related to migrations are not covered by support, and should instead be reported to the TypeORM team.
$ yarn
Use the .env.example
file as an example for your own .env
file.
All parameters are required.
Some parameters are omitted because they are not needed for local development.
You will also need to install MySQL, Redis and have a Supertokens instance running. You can use a managed version of all of these services.
Hosting your own instance of Supertokens is not required for local development. You can instead use their public instance url:
SUPERTOKENS_CORE_URI=https://try.supertokens.io
After setting up your database credentials in .env
, run the migrations:
$ yarn typeorm:migration:generate
$ yarn typeorm:migration:run
We use TypeORM to handle everything related to database. You only need to run migrations when changing the models ( .entity.ts) files, or when you first start the app.
ALWAYS check your migrations before running them. Typeorm may sometimes drop important tables and columns.
GameNode's games metadata are powered by IGDB. To use it, you need to set up game-node-sync-igdb. See CONTRIBUTING for a guide.
# development
$ yarn start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
# test coverage
$ yarn test:cov
Keep in mind that it's not possible to test Supertokens' routes (nor should we have to).
Feel free to reach out to us through a Github Issue. We can help you set up your own instance of GameNode, or help you with any other issue you might have.
PS: If you have issues with overral app usage, please fill an issue in the corresponding repository.
For example, if you have issues with the GameNode website, fill an issue in the game-node-web
repository.