/owstats

Self Hosted Overwatch Statistics written in Node.JS using OWAPI as Statistics Source

Primary LanguageCSSGNU General Public License v3.0GPL-3.0

owstats

Codacy Badge

Description

Private Overwatch statistics backend application.

Requirements

What do you need to execute owstats and owapi?

Requirements for owstats

  • We support Windows and Linux
  • MySQL / MariaDB Database
  • Node.JS and NPM Package Manager

Requirements for owapi

  • Python > Version 3.5
  • Linux / Unix based server
  • apt packages apt install redis-server libxslt-dev python3-dev build-essential zlib1g-dev pkg-config

References

  1. OWAPI - Overwatch JSON API
  2. Node.js
  3. mysqljs - A pure node.js JavaScript Client implementing the MySql protocol.

Installation

We recommend a linux / unix environment for use of owapi and owstats.

Linux Installation steps (Optimized for Debian):

  1. Follow the installation steps of OWAPI showed in their Readme

  2. To use owapi as systemd service add the following content into the file /lib/systemd/system/owapi.service and edit the file for your environment.

[Unit]
Description=OWAPI - Overwatch API
Wants=network-online.target
After=syslog.target time-sync.target network.target network-online.target

[Service]
Type=oneshot
ExecStart=/opt/OWAPI/run.sh
User=owapi
Group=owapi

[Install]
WantedBy=multi-user.target
Alias=owapi.service

  1. add the following content into /PATH TO OWAPI/run.sh and edit the file for your system.
#!/usr/bin/env bash

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

cd /opt/OWAPI

python3.5 -m venv ./venv

source ./venv/bin/activate

PYTHONPATH=. asphalt run -l uvloop config.yml

exit 0
  1. start the owapi service and look out for errors. You have to cancel the script after starting using Strg + C

  2. Clone this repository into a folder you like. We recommend /opt/owstats or /usr/local/owstats

  3. Run npm install to setup the required Node.js Packages

  4. execute the setup.sql file in your MySQL or MariaDB database.

  5. Copy the .example-files in config folder to .js files and edit the default values to your values.

  6. Execute node readdata.js and watch for possible errors.

  7. Add the following line to your crontab using the command crontab -e and edit the execute frequency. In our example we read the data every hour.

0 * * * * /usr/bin/node /opt/owstats/readdata.js