/tabletop-combat-helper-api

A php / mysql application which can be used to host assets / configurations for Tabletop Combat Helper.

Primary LanguagePHPApache License 2.0Apache-2.0

DEPRECATED

This project is deprecated, as Unity assets are now loaded via asset bundles.

Tabletop Combat Helper API

This project contains the source for a backend API used to store assets and configuration data used in the Tabletop Combat Helper Unity Client and Angular frontend client.

You can find these here:

Unity Client

https://github.com/dcasadevall/tabletop-combat-helper

Web Admin Client (Angular 7)

https://github.com/dcasadevall/tabletop-combat-helper-admin

Setting up DB (Before deploying)

  • Copy src/persistence/MedooConfig.sample.php to src/persistence/MedooConfig.php and change the values to your DB settings.
  • Import src/persistence/schema.sql (This is only needed for non docker deployments) to your DB.

Deploying the server (Locally with docker)

From ./docker:

docker-compose up

This will create a new set of mysql + php + nginx containers running the API. You will now be able to hit the API by pinging localhost:8080.

NOTE: The db will be persisted in /opt/mysql_data on your machine. Change the volume entry at ./docker/docker_compose.yml if you wish to change that.

Deploying the server (Remotely with docker)

Simply use any cloud service to deploy your docker compose setup and access it remotely. This may be quicker and more reliable than going with an FTP dump of the source.

IMPORTANT: Before you deploy remotely, remember to change the mysql parameters in ./docker/docker_compose.yml to some real ones.

environment:
  - MYSQL_DATABASE=mydb
  - MYSQL_USER=myuser
  - MYSQL_PASSWORD=secret
  - MYSQL_ROOT_PASSWORD=docker

Deploying the server (without docker) - Not preferred

Simply dump the code into a hosted supporting PHP 7.0 and MySQL 5.3+. This is the least preferred option, but will get you up and running with one of the few free hosting services that let you have a PHP + MySQL instance. You will need to setup the mysql schema with the data in docker/mysql/schema.sql.