This project was created in order to show programming skills of PHP engineers from Jelvix.
- Setup and run composer
cd Symfony-Code-Sample
composer install- Setup connection strings for Mysql and Redis in
.envfile (or.env.localor.env.(dev|prod|staging))
DATABASE_URL=mysql://user:pass@127.0.0.1:3306/test_db
REDIS_URL=redis://localhost:6379- Run doctrine migrations
bin/console doctrine:migrations:migrate- Generate public/private keys pair for JWT authorization tokens signing
openssl genpkey -algorithm RSA -out ./cfg/jwt_private_key.pem -pkeyopt rsa_keygen_bits:2048
#extract public key
openssl rsa -pubout -in ./cfg/jwt_private_key.pem -out ./cfg/jwt_public_key.pem- Optional: load dummy data to DB for test or development purposes using fixtures
bin/console doctrine:fixtures:load- Run dev server
bin/console server:runTo see full list of additional supported commands run:
bin/console# create new entity
bin/console make:entity
# generate new migration
bin/console make:migration
# apply migration
bin/console doctrine:migrations:migrate
Run tests
bin/phpunit- Install all the webpanel dependencies
cd webpanel
npm install- run dev server
npm startor
ng serve- build code
npm buildor
ng buildTo build for production run symfony command
bin/console app:webpanel:build --prod=1Built files will be placed to configuration file config/packages/webpanel.yaml.
After build process is finished, webpanel will be available on default Symfony route http://domain_name/
To see and test all the available API's go to SwaggerUI docs page http://localhost:8000/api/doc
Note: FOR CODE DEMONSTRATION ONLY.