Ce projet a été réalisé dans le cadre de mon apprentissage pour le parcours d'OpenClassrooms (Développeur d'application PHP/Symfony).
BileMo is a company specializing in the sale of high-end mobile phones. It offers access to its catalog via an API, for other platforms, thus adopting a B2B (business to business) sales model.
Access to the API will be reserved for referenced clients, who must authenticate via a JWT Token. The data is exposed in JSON format, respecting levels 1, 2 and 3 of the Richardson model. Responses are cached to improve query performance.
To install and run this project, follow the steps below :
- PHP (version 8.0 ou supérieure)
- Symfony (version 7 ou supérieure)
- Composer
- Une base de données
1 - Git clone the project
https://github.com/TolMen/OCBileMo
2 - Install libraries
- symfony console composer install
3 - Create database
-
Update DATABASE_URL .env file with your database configuration :
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
-
Create database :
symfony console doctrine:database:create
-
Create database structure :
php bin/console doctrine:schema:update --force
-
Insert fictive data (optional) :
symfony console doctrine:fixtures:load
4 - Configure JWT
-
Install the JWT package by running the following command :
composer require lexik/jwt-authentication-bundle
-
Generate a secret key for JWT :
php bin/console lexik:jwt:generate-keypair
-
Make sure the paths to the private and public key files are set correctly in your .env file :
JWT_PASSPHRASE=VotrePhraseSecrète
This project is licensed under MIT - View file license for more details.
Feel free to contact me with any questions or contributions. Have a nice visit on our blog !