<commit_before>[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/eugene-matvejev/battleship-game-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/eugene-matvejev/battleship-game-api/?branch=master)
[![Build Status](https://travis-ci.org/eugene-matvejev/battleship-game-api.svg?branch=master)](https://travis-ci.org/eugene-matvejev/battleship-game-api)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f92d83b6-fd11-4b1b-ae86-b3ba1fb152dc/mini.png)](https://insight.sensiolabs.com/projects/f92d83b6-fd11-4b1b-ae86-b3ba1fb152dc)


# Battleship Game API
### Spare time project, Work in Progress! Highly experimental!!!
#### Project aim
 * deliver some preview about my technical knowledge before job interview
  * try 'cutting edge' technologies and approaches.

### game cheat-code:
 * CPU have only one-cell ship which is hardcoded at __B2__ cell
  * if you will hit it __B2__ cell - it will be instant win
   * it is done to easier tests manual testing, as the project is far from 'finished' stage, as I keep trying polish it.

### plans for future:
 * deliver back-end as OpenAPI using SF3, PHP7, Doctrine2, Various databases
  * try to create it later as well on Silex.
 * separate front-ent side using single-page-application model AngularJS 2 / Backbone / React
  * front-end already behave as single-page-application (SPA)
 * make simple and flexible database support e.g. MariaDB, MySQL, MongoDB
 * implement phpunit, behat tests, consider kahlan and phpspec as well

# Software requirements
 * database: MySQL => 5.5 or MariaDB >= 9.*
  * MongoDB support WIP 
 * http server: apache/nginx with php >= 7.0.1
 * composer

### Key Technologies
 * PHP 7.0.1 (because 7.0.0 had bugged primitive types)
 * Symfony Framework 3 (SF3)
 * Doctrine 2
 * PHPUnit 5
 * Composer
 * Twig
 * Twitter Bootstrap 3
 * Monolog
 * EMCAScript6 (JavaScript ES6)

# How to install
 * copy *app/config/parameters.yml.dist* to *app/config/parameters.yml* and amend database settings
 * *composer install* (will create databases as well as run migrations)
 * *php bin/console battleship:database:seed --env=prod* (to seed database with necessary data e.g. cell states, player types)
 * *php bin/console assets:install* (as need dump assets once)
 * apache virtual host config:
 ```
<VirtualHost 127.0.0.1:80 ::1:80>
    DocumentRoot "%PROJECT_ROOT_DIRECTORY%/web"
    ErrorLog "%PROJECT_ROOT_DIRECTORY%/var/logs/apache_log"

    ServerName api.game.local
    ServerAlias api.game.local
    <Directory %PROJECT_ROOT_DIRECTORY%/web>
        AllowOverride All<commit_msg>update read-me<commit_after>[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/eugene-matvejev/battleship-game-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/eugene-matvejev/battleship-game-api/?branch=master)
[![Build Status](https://travis-ci.org/eugene-matvejev/battleship-game-api.svg?branch=master)](https://travis-ci.org/eugene-matvejev/battleship-game-api)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f92d83b6-fd11-4b1b-ae86-b3ba1fb152dc/mini.png)](https://insight.sensiolabs.com/projects/f92d83b6-fd11-4b1b-ae86-b3ba1fb152dc)


# Battleship Game API
### Spare time project, Work in Progress! Highly experimental!!!
#### Project aim
 * deliver some preview about my technical knowledge before job interview
  * try 'cutting edge' technologies and approaches.

### game cheat-code:
 * CPU have only one-cell ship which is hardcoded at __B2__ cell
  * if you will hit it __B2__ cell - it will be instant win
   * it is done to easier tests manual testing, as the project is far from 'finished' stage, as I keep trying polish it.

### plans for future:
 * deliver back-end as OpenAPI using SF3, PHP7, Doctrine2, Various databases
  * try to create it later as well on Silex.
 * separate front-ent side using single-page-application model AngularJS 2 / Backbone / React
  * front-end already behave as single-page-application (SPA)
 * make simple and flexible database support e.g. MariaDB, MySQL, MongoDB
 * implement phpunit, behat tests, consider kahlan and phpspec as well

# Software requirements
 * database: MySQL => 5.5 or MariaDB >= 9.*
  * MongoDB support WIP 
 * http server: apache/nginx with php >= 7.0.1
 * composer

### Key Technologies
 * PHP 7.0.1 (because 7.0.0 had bugged primitive types)
 * Symfony Framework 3 (SF3)
 * Doctrine 2
 * PHPUnit 5
 * Composer
 * Twig
 * Twitter Bootstrap 3
 * Monolog
 * EMCAScript6 (JavaScript ES6)

# How to install
 * copy *app/config/parameters.yml.dist* to *app/config/parameters.yml* and amend database settings
 * *composer install* (will create databases as well as run migrations)
 * *php bin/console doctrine:fixtures:load --env=prod* (to seed database with necessary data e.g. cell states, player types)
 * *php bin/console assets:install* (as need dump assets once)
 * apache virtual host config:
 ```
<VirtualHost 127.0.0.1:80 ::1:80>
    DocumentRoot "%PROJECT_ROOT_DIRECTORY%/web"
    ErrorLog "%PROJECT_ROOT_DIRECTORY%/var/logs/apache_log"

    ServerName api.game.local
    ServerAlias api.game.local
    <Directory %PROJECT_ROOT_DIRECTORY%/web>
        AllowOverride All
{'fraction_non_alphanumeric': 0.1110681862082287, 'fraction_numerical': 0.026270040564033224, 'mean_word_length': 4.354705274043433, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 4}}
{'dir': 'git-commits-cleaned', 'id': '437184', 'n_tokens_mistral': 1794, 'n_tokens_neox': 1681, 'n_words': 496}