Sample Q & A RESTful application written with DDD approach. It's my first take on DDD, so the app is definitely not ideal for reference.
- PHP >= 7.1
- Composer
- MySQL (or any Doctrine DBAL compatible DB - requires config adjustment)
Clone the project, change directory and run:
$ composer install --dev
During installation you will be asked for database connection details. Make sure that the database that you use is already created. If not you can run:
$ php bin/console doctrine:database:create
Creating DB schema:
$ php bin/console doctrine:schema:create
All the dependencies will be downloaded and the application is ready to run.
$ php bin/console server:run 8000
The application is now ready to serve requests on localhost:8000.
Once the application is running you can access the API documentation at:
localhost:8000/doc
The documentation can also serve as a sandbox to try endpoints.
To run the unit test suite run:
$ ./vendor/bin/phpunit -c phpunit.xml.dist
To run the API test suite run:
$ ./vendor/bin/codecept run