This document will introduce you to the code and guide you through making changes.
- Quick Start Guide
- Architecture Documentation
- Open Issues
- Mocha Unit Testing API Reference
- Chai Assertion API Reference
An in-depth explanation of the code can be found in the Architecture Documentation above. It contains some pointers to the specific places in the code used by each service or component.
To help you get acquainted more quickly, here is a list of files and directories commonly used when working on the game:
app/contains code for the frontend / game clientconfig/contains configuration for backend servicesdocker-compose.yamlcontains our Docker container configurationdocscontains documentation, including this guidegulp/andgulpfile.babel.jscontain workflow automation, for tasks like building the codepackage.jsoncontains our Node.js dependenciesservercontains code for the HTTP API server and the WebSocket game serversterraformcontains code for provisioning staging and production environmentstestcontains unit and integration testsworkercontains code for the worker, which processes asynchronous background jobs
For JavaScript code, we use ESLint to enforce code style.
Its configuration can be found in .eslintrc.json.
You can run the linter with yarn lint:js.
You can automatically format JS code to meet these standards by running
yarn format:js.
For CoffeeScript code, we use CoffeeLint to enforce code style.
Its configuration can be found in coffeelint.json.
You can run linters with yarn lint:coffee, yarn lint:coffee:app, or
yarn lint:coffee:backend.
Most of the code is written in CoffeeScript, which compiles into JavaScript. We are considering replacing CoffeeScript with JavaScript (see Issue #4).
We should also consider moving to TypeScript where possible.
There is a fairly strict tsconfig.json in the repo which has been
preconfigured for new code. After writing new TypeScript code, you can run
yarn tsc to build it using this config.
We use mocha and chai to run unit and integration tests in the project. Both
of these are triggered by yarn.
To run unit tests:
yarn test:unit
To run integration tests:
yarn test:integration
Once you have a contribution ready, you can open a pull request to get it reviewed.
First, fork OpenDuelyst on Github, and push your branch to the fork. Then, when signed into Github, you'll be prompted to open a pull request when viewing the OpenDuelyst repo.
If the contribution solves an open issue, you can automatically close that issue when the PR is merged. To do this, include the text "Closes #1234" in the PR description (to automatically close issue #1234).
When you open a pull request, some tasks will automatically start in our Continuous Integration (CI) environment to lint and test the code.
We use Github Actions for CI, so you can see the atatus and results of these tasks right in the pull request itself.
Once the PR has been reviewed and accepted, it will be merged into the main
branch. At this point, you are now an OpenDuelyst developer. Congratulations!
OpenDuelyst uses Semantic Versioning for its releases.
In version 1.96.17, 1 is the MAJOR version, 96 is the MINOR version,
and 17 is the PATCH version.
For OpenDuelyst, the MAJOR version should not exceed 1. Note that the
immediate release after 1.99 is 1.100 and not 2.0.0.
At the moment, you can get help with OpenDuelyst by opening an issue. Since this is a volunteer project, it may take a while for someone to look at your issue.
You can also join the OpenDuelyst Discord server for technical discussion and support.