Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tolmen/ocp7_bilemo

Projet API_Symfony - OpenClassrooms (Développeur d'application PHP/Symfony)
https://github.com/tolmen/ocp7_bilemo

api-rest openclassrooms php symfony

Last synced: 10 days ago
JSON representation

Projet API_Symfony - OpenClassrooms (Développeur d'application PHP/Symfony)

Awesome Lists containing this project

README

        

# API Bile Mo

> **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.

## Installation

To install and run this project, follow the steps below :

### Prerequisites
- **PHP** (version 8.0 ou supérieure)
- **Symfony** (version 7 ou supérieure)
- **Composer**
- **Une base de données**

### Installation steps

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:[email protected]: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

## Author

[TolMen](https://github.com/TolMen) - [LinkedIn](https://www.linkedin.com/in/jessyfrachisse/)

## License

This project is licensed under MIT - View file [license](LICENSE) for more details.

Feel free to contact me with any questions or contributions. Have a nice visit on our blog !