ProjectZomboidReporter-API

ProjectZomboidReporter-API

Docker app from Natcoso9955's Repository

Overview

This api is used to access your project zomboid data stored in sql to pass to the main reporter. NOTE: if your sql database is not running on the default port, you will need to provide a value for it below

Discord

Zomboid-Server with -Stats-Reporter

a package that grabs information from a running project zomboid server & posts to a database to be displayed on a webpage or with a discord bot.

This package is for people that want to host their own zomboid server with a web front end. The front end is still in progress, but the reporting system that feeds data to it reads project zomboid server files and outputs them to a database every 5 minutes.

Currently output are:

  • Current Date in server
  • Days since the apocalypse began(Days Survived)
  • Player data-username+character name, & last online time for each player.
  • Config data: server name, description, etc.

Frontend

This is a simple stand-in front end to display data that was collected.

Discord

This is a small bot that will report the current date in the server. Currently, you have to create your own bot to use this code. See Setting up a bot. You only need to follow the parts on the discord site to create a bot and get the token, then paste the token into the docker compose file.

Setup Notes

run chmod 777 -R ./z on the server folder created by docker-compose so that it can be written to by services.

Reporter wont complete successfully until someone has been in game and map_t.bin has been created. map_t.bin seems to take some time for the server to create. Might be waiting for the full save time(i think 5 mins). It took about that much time playing the game fresh for it to appear.

Docker Compose

Here is a quick overview of the services in the compose file:

Frontend

The frontend is a small ReactJS page that reads from the database and displays the list of players and some game setting data.

Backend(API)

This is a small nodejs script that reads from the database for the frontend & the discord bot.

Discord Bot (Optional)

This is a discord bot that can sit in your discord server and respond with the In-Game date of your server whenever someone says "!date". You must provide it with your own Bot Token.

NGinX

This proxy combines the Frontend & the Backend into one site, where webaddress.com/api accesses the backend and webaddress.com is the frontend.

Reporter

The reporter is a php script that runs on a timer - roughly every 5 mins - and scrapes data from the Project Zomboid save files to then send to the database. So far the following are read:

SQL

This is the database that the reporter writes to, and the backend reads from.

Adminer (Optional)

This is a web interface for people to read the database. You dont need it, but if you want to see what is actually being reported, you can login to this and view the current database.

Project Zomboid

This is the Zomboid server itself.

Install ProjectZomboidReporter-API on Unraid in a few clicks.

Find ProjectZomboidReporter-API in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for ProjectZomboidReporter-API Review the template variables and paths Click Install

Requirements

MySQL

Categories

Download Statistics

401
Total Downloads

Related apps

Explore more like this

Explore all

Details

Repository
chrisashtear/zomboid-reporter-backend
Last Updated2022-12-11
First Seen2022-03-04

Runtime arguments

Web UI
http://[IP]:[PORT:3001]/
Network
bridge
Shell
sh
Privileged
false
Extra Params
--restart=unless-stopped

Template configuration

SQL_HOSTVariable

Container Variable: SQL_HOST

Value
192.168.1.129
SQL_DATABASEVariable

Container Variable: SQL_DATABASE

Value
Zombo
SQL_USERVariable

Container Variable: SQL_USER

Value
SQL_USER
SQL_PASSVariable

Container Variable: SQL_PASSWORD

Value
SQL_PASS
SQL_PORTVariable

Container Variable: SQL_PORT

Value
3307
API portPorttcp

Container Port: 3001

Target
3001
Default
3001
Value
3001