This is a gaming store API, which provides basic functionality for product management
-
Clone this repository using:
git clone https://github.com/WictorT/randomly-priced-games.git
-
cd randomly-priced-games
-
Run
docker-compose build --no-cache
to build images. -
Copy
.env.dist
into.env
and configure as you are wiling(better keep default values). -
Run
docker-compose up
to bring up your containers. -
Hope containers are up. If yes then run
docker-compose exec php bash
to enter container. Note: Next commands need to be run inside the container -
(inside php container) Generate the SSH keys for JWT:
mkdir config/jwt openssl genrsa -out config/jwt/private.pem -aes256 4096 openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
In case first
openssl
command forces you to input password use following to get the private key decryptedopenssl rsa -in config/jwt/private.pem -out config/jwt/private2.pem mv config/jwt/private.pem config/jwt/private.pem-back mv config/jwt/private2.pem config/jwt/private.pem rm config/jwt/private.pem-back
-
(inside php container) Run
sh setup.sh
if it is the first time you launched the project
You can now access the application here (by default): http://localhost
- To launch tests tests run:
docker-compose exec php ./bin/phpunit
- To launch tests with code coverage you can use:
docker-compose exec php ./bin/phpunit --coverage-html coverage
this will create some coverage files, to see the report open: coverage/index.xml,
You can view the full API documentation here: here