Internal tools used to develop Ellas War

Posted by

This article is the second of the series about Ellas War’s development. We will see the different tools that I use and how they help me to improve the game.

Code improvement

ESLint

EsLint is a static code analyzer for JavaScript. It can be easily integrated in most of the IDE (Integrated Development Environment) and is highly customizable.

$ npx eslint . --ext ts
[...]
✖ 4 problems (3 errors, 1 warnings)

I’m working on it, it’s not always possible to fix all the errors. My main problem is with a library that is not using TypeScript yet (for redis).

Jasmine

Jasmine is a Framework that is used for testing JavaScript code. After compiling and running the tests, a report is generated. This report can be imported in SonarQube.

SonarQube

SonarQube is a platform for code quality and bug detection. It also provides dashboards and help to fix the problems.

The hardest rule to follow is to keep the complexity of each function at a maximum of 15. Each condition is adding points depending its complexity and its place in the code.

Deployment on the server

Ansible

Ansible is a configuration management, it uses YAML to write rules and conditions. I appreciate it because it’s easy to write and to deploy, the side effect is that it can be slow to run.

Docker

Who doesn’t know the Docker containers?
Thanks to it, I can run the NodeJS version that I need, run multiple times the game on the same server and add a bit of security to the game. I prefer to use directly Docker (with compose) instead of Kubernetes because of the overhead. I might switch to Swarm in the future to get the benefits of an orchestractor.

Monitoring

Grafana

Grafana is a very powerful visualization, I have dashboards to monitor the server:

  • Ellas War, an API is called on a regular base to display the game’s metrics
  • Redis, information about the Redis instance used by the game

Dozzle

Dozzle is a log viewer for Docker containers. Light, available via a web interface and easy to use.

Conclusion

I’m trying to use basic tools and to save as much as possible the resources of my server for the game. Unfortunately, I can’t run all theses services locally or on my servers, it would take to much resources and be too much work. In my next article I will talk about the external tools that I’m using.

Leave a Reply

Your email address will not be published. Required fields are marked *