⚠️ This is an example repository! Never expose your secrets publicly! ⚠️
- PHP 8+
- Composer
- Symfony Cli - for running local web-server
- Docker - for running local web-server
- Docker-compose - for running local web-server
This will also load data fixtures!
- Get setup script:
wget https://raw.githubusercontent.com/AnonymusBadger/mediaflex_recruitment_task/master/setup.sh
- Make executable:
chmod +x setup.sh
- Run:
./setup.sh
- Cd to project dir:
cd mediaflex_recruitment_task/
- Follow step 6 from Manual Setup
One line: wget https://raw.githubusercontent.com/AnonymusBadger/mediaflex_recruitment_task/master/setup.sh && chmod +x setup.sh && ./setup.sh && cd mediaflex_recruitment_task/
MySQL server has gone away
error follow step 5 from Manual Setup then load data fixtures.
- Clone:
git clone https://github.com/AnonymusBadger/mediaflex_recruitment_task.git && cd mediaflex_recruitment_task/
- Run docker-compose:
docker-compose up -d
- Install dependencies:
symfony composer install
- Generate JWT keys:
php bin/console lexik:jwt:generate-keypair
- Execute database migrations:
symfony console doct:mig:mig --no-interaction
- Start server:
- a) With TLS:
symfony server:start -d
(requiressymfony server:ca:install
to run if no certificate exists) - b) Without TLS:
symfony server:start -d --no-tls
- a) With TLS:
- To browse api documentation go to:
localhost:8000/api/docs
localhost:8000/api/docs
- browse api documentations with the power of SwaggerUI!localhost:8080
- PhpMyAdmin
-
Data fixtures provide 3 predefined users:
[email protected]
[email protected]
[email protected]
- Password for each:
pass
-
And 5 predefined applications:
AppWithAdmin
AppWithModerator
AppWithUser
AppWithMany
(User, Moderator)AppWithoutAny
- Load data fixtures:
symfony console doct:fix:load -n
⚠️ !!! THIS WILL PURGE YOUR DATABASE !!! - Open browser Api Documentation (
localhost:8000/api/docs
) - Get token:
- Execute
/api/login
request with specified user credentials in request body - Copy token value from response
- Authorize (green, top-right button) by inputing
Bearer {token}
in value field
- Execute
- Or use anonymously
- Make sure you have
sqlite
support enabled in your PHP setup - Run all tests with
php bin/phpunit -c phpunit.xml.dist