- PHP >= 7.4 https://www.php.net
- Docker and docker-compose https://www.docker.com
- Symfony CLI https://symfony.com/download
- Install all packages
composer install
- Run
docker-compose up -d
to start PostgreSQL database - Sync db and migrations with
php bin/console doctrine:migrations:migrate
- Run fixtures
php bin/console doctrine:fixtures:load
- Generate SSL keys
php bin/console lexik:jwt:generate-keypair
- Run the application with
symfony server:start
- You can view the application's API at https://localhost:8000/api/
- Or you can run a basic MVC application at https://localhost:8000
- When you send a news (
POST /api/news
) runphp bin/console messenger:consume
to consume the queue
- You can run tests with
sh run_tests.sh
- Or you can view the coverage with
sh run_coverage.sh
(files are stored in /tests/coverage-report)
Available Users after loading fixtures:
- editor:
- username: editor@blog.com
- password: editor@blog.com
- publisher:
- username: publisher@blog.com
- password: publisher@blog.com
- reviewer:
- username: reviewer@blog.com
- password: reviewer@blog.com
- admin:
- username: admin@blog.com
- password: admin@blog.com
In order to login you need a token before each protected request;
The address is: /api/login_check
and accepted parameters are username
and password
An example with CURL is:
curl -X POST -H "Content-Type: application/json" https://localhost:8000/api/login_check -d '{"username":"editor@blog.com","password":"editor@blog.com"}' -k
Each request need this Authorization Header: Bearer {token}