This is the backend codebase for the CyberWars game.
For the front end of the game check out CyberFront.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- PHP 7.2+
- Composer https://getcomposer.org/download/
- Some PHP extensions you probably have (composer will tell you if you don't when installing)
- php-curl
- php-mbstring
- php-zip
- php-xml
- php-sqlite3
Use ondrej's PPA:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.2 php-curl php-mbstring php-zip php-xml php-sqlite3
Run the following to initialize the project:
git clone [email protected]:johnvandeweghe/CyberBack.git
cd CyberBack
composer install
Then for development set the config in .env. You can use .env.dist as a starter file.
Then you can setup your database by running the migrations with the following:
./bin/console doctrine:migrations:migrate
To start a test server to hit with API requests run the following:
php -S localhost:8080 -t public/
Simply execute the following to run all unit tests:
./bin/phpunit
Note: Test server does not need to be running to run the tests.
To run the integration tests:
./bin/phpunit --testsuite=integration
Setup is similar to development, but .env should instead be set as environment variables with production values.
See /docs/api_spec_oas3.yml for a OpenAPI Spec 3 doc describing the public API for the backend.
See docs/implementation_guide.md for a guide explaining how to actually use the API to play a game of CyberWars as a player client.
Contributions are welcome, just drop a Pull Request.
We use SemVer for versioning. This project is currently under version 1.0 and is subject to change drastically still (as is allowed in SemVer).
This project is licensed under the MIT License - see the LICENSE.md file for details