Documentation here
This backend uses two entities: Message and User. It uses:
- SQLite database - in
varfolder (after setting up) - JWT as authentication mechanism using RSA256
- Doctrine for ORM and DB access layer
- Follows Action-Service-Repository-Entity pattern
- PSR1 standard
- Static analysis with PHPStan and PHP_CodeSniffer
For your convinience you can obtain all tokens (signed with development private key) at /testing/get-jwt-tokens
or by running php commands/getTestJwtTokens.php after setup. The tokens will work for 10 minutes, provided
you will not change the default JWT_SECRET in .env
docker-compose up- in case you run it on a mac, you may need to replace
.envwith.env.macfor docker-compose whitespace errors
composer install
sh setup_db.shTo run the application in development
composer startcomposer test
composer test:coverage
composer analyse
composer sniff
composer sniff:fix- you might need to install xdebug. For ubuntu
sudo apt install php-xdebug
- The application does not enforce https, so you can test it locally.
- the listing APIs don't use pagination - for the sake of simplicity. In case there would be long conversations or thousands of users, it would be appropriate to use pagination.
©2020 Karol Skalski