Skip to main content

Game Server Developer Guide

Welcome to the Synthergy game server developer guide! This page is designed to help you get started on contributing to the game server component of the project.

Project Repository

The game server for Synthergy is hosted in the synthergy-server repository on GitHub. This repository contains all of the code needed to run the game server and manage game logic.

To access the repository, you will need to join the synthergy-game organization on GitHub. Once you have been added to the organization, you will be able to clone the repository and start contributing.

Project Structure

The game server is built using Node.js, TypeScript, Express, and Socket.io. The project structure is as follows:

synthergy-server/
├── src/
│ ├── constants/ # Constants used throughout the application
│ ├── game/ # Game logic and state management
│ ├── handlers/ # Socket.io event handlers
│ ├── public/ # Data publicly served over HTTPS
│ ├── scripts/ # Utility scripts for managing the server
│ ├── types/ # TypeScript types
│ ├── utils/ # Utility functions
│ ├── server.ts # Entry point for the application
├── test/ # Unit tests for the game server
│ ├── game/ # Game logic tests

Running the Project

To get started with the game server, follow these steps:

  1. Clone the synthergy-server repository.
  2. Install the project dependencies by running yarn in the project directory.
    • If you don't have Yarn installed, run npm install -g yarn first.
  3. Start the server by running yarn start

The server should now be running on http://localhost:8080. You can navigate to this URL directly to see the server status page. To run games on the server, you will need to connect to it using the web client or AI server.

Running Tests and Linting

The game server uses GitHub Actions for continuous integration. This means that every pull request will be automatically run against the project's test suite and linter to ensure that the changes do not introduce any new bugs or issues. To avoid any issues with your pull request, make sure to run the tests and linter locally before pushing your changes:

# Run the unit tests
yarn test
# Run the linter
yarn lint
# Alternatively, run the ci script to run both tests and linting
yarn ci

Contributing

Please refer to the contributing guide for information on how to make contributions on GitHub.

Resources