- Requires PHP 7 and Mongo 3.2+
- Vagrant - https://github.com/bendbennett/vagrant-php7-mysql5-mongo3
- you'll need to update
parameters.yml.dist
and changemongodb_server: mongodb://mongo:27017
tomongodb_server: mongodb://localhost:27017
if you're the vagrant box.
- you'll need to update
- Docker - https://github.com/bendbennett/docker-compose-php7-mongo3
- Vagrant - https://github.com/bendbennett/vagrant-php7-mysql5-mongo3
- Clone this repo.
- Run
composer install
.- if you're using the Vagrant env (linked above) then composer install will run during the ansible provisioning
- if you're using the Docker env (linked above) then composer install will run during docker-compose up
- you can tail the logs using
docker logs -f {name_of_docker_container_running_composer}
- you can tail the logs using
-
The Swagger docs for the API are secured with Basic Http Authentication (
swagger - swagger
) and should be visible athttp://{your_local_host}/app_dev.php/api#
. -
To generate the docs for "production" (i.e.,
http://{your_local_host}/api#
) runphp app/console assetic:dump --env=prod --no-debug
. -
To change the password for the docs run the following and then add the
Encoded password
toparameters.yml.dist
and runcomposer install
:php app/console security:encode-password {your_swagger_password}
-
JWT set-up uses the approach described in this post - http://kolabdigital.com/lab-time/symfony-json-web-tokens-authentication-guard.
-
You'll need to generate the keys as described in the link.
mkdir -p app/var/jwt openssl genrsa -out app/var/jwt/private.pem -aes256 4096 openssl rsa -pubout -in app/var/jwt/private.pem -out app/var/jwt/public.pem
-
Omit -aes256 to generate keys without using a passphrase.
openssl genrsa -out app/var/jwt/private.pem 4096 openssl rsa -pubout -in app/var/jwt/private.pem -out app/var/jwt/public.pem
-
You can set up an admin user by running the following:
php app/console doctrine:mongodb:fixtures:load
-
You can then login by calling
POST /login
with the following request body:{ "email": "[email protected]", "password": "admin" }
To run the test suite execute bin/phpunit -c app/
.