Contributing to aoe2stats

The past half a year I was off the grid and there was no-one to fix bugs in stats for the site, or update the home page for captains mode ( I don’t want these projects to fade, when I don’t have the extra time to work on them. Last couple of weeks I’ve been working towards making contributing to my aoe2* websites easier. In order to help out, earlier, you would have to had known about web servers (nginx), databases (postgre, mysql), different programming languages (php, javascript, html), tooling (npm, gulp, bower, git, …), even before getting started. It would also require knowledge, how to set them up on a local computer. Even getting the whole stack working might have been a bit of issue. Most people don’t use linux, where it’s a tiny bit easier. There are still some things you would need to know, but hopefully I managed to reduce the number of required things to a minimum. (The next part is going to be a bit techy, I’ve tried to add explanation to techy terms 🙂 ) . If you don’t want to get into coding, just jump to the I’m not a programmer section.

LEMP stack (illustration)
LEMP stack (illustration)

To get an idea how I did things previously for the stats: I had a virtual machine set up (vagrant), where I configured manually the web server (nginx, php) and tooling (nodejs). I would connect through secure shell into the virtual machine to run the build scripts (gulp) from time to time, or run a watcher that automatically would build the changed files. Let’s just say it wasn’t very scalable.


Enter docker. Docker is a tool, that could basically automate (as in without human input) the setup and deployment of services. It doesn’t matter at the moment how it really works internally. The point is, docker could replace the whole setup procedure (nginx, php, nodejs, database, tooling) and would require literally 2 commands in a powershell (windows command line) to get someone started with aoe2* projects. Those two are ‘build’ and ‘up’. Easy, right? I’ve been meaning to try this technology for a while. I haven’t gotten around to it yet, until I reinstalled all my computers and had no desire to set up manually the whole stacks again for multiple computers. I needed an easier approach. Docker delivered the simplicity, though I still haven’t figured out all the details about deploying (getting it to the server), yet. But that shouldn’t matter for others.

OK. Enough with the technicalities. How would anyone go about contributing to the stats and captains mode? I haven’t published the code for captains mode yet, so lets consider only the stats page for now.

I’m not a programmer

I realize, there is still a lot to learn, or know, before someone could contribute and find their way around git, php, html, javascript, etc. Even if you don’t know any of those, there is still a lot of ways you could help out.

Post issues you find with the functionality or content. This also means enhancements. (For aoe2stats: link ). This will help me get organized with a list of things I should look at, instead of going through mail, aoczone PM’s, chat messages.

For aoe2stats things are a bit easier, if you just only care about the website content. All the stats are actually stored in json files, for now at least – link . It’s easy to just edit them. Keep on reading the next section, if you would like to help out this way.

I know git and stuff

First of all… don’t judge me 😀 . These are my experimental projects and most of the things were added ad-hoc. The  most easy way to get your changes in the beginning onto the website is the “github” way. Fork the project on github -> make your changes -> submit a pull request. I would recommend this approach. In time, after we did a few of these, and I see you mean business, I will give you access to the main repository. That way your changes wouldn’t have to go through me.

That’s basically it. I think this is a good place to express my gratitude towards all the donators. You guys rock!

If you have any questions, just ask in the comments below, or just file an issue! 😉
With the upcoming patch 4.8 and the balance changes I would be grateful for every extra eye checking those stats!