RESTful API made with Symfony 5 and API Plateform.
I made this API to improve my skills in Symfony / API Plateform, in the context of my PHP/Symfony OpenClassRooms formation. Your comments and suggestions are welcome.
BileMo is a fake enterprise which offers mobile phones. This API give possibility to BileMo clients (BtoB) to consult BileMo products and to manage their own clients.
This API :
- Give a doc with Swagger
- Accept and return content in json format
- Give possibility to BileMo clients to get BileMo products
- Give possibility to BileMo clients (named Customer in the project) to create/read/patch/delete their own clients only (named User in the project)
- Implements JWT token system to authenticate customers and a refresh token to keep the authentication active instead of reconnect when token is expired
- Is RESTful, respect level 1, 2 and 3 of Richardson Maturity Model
- Is monitored by Codacy and Code Climate
- 🐘️ PHP 8.0.0
- ⛵ phpMyAdmin 5.0.2
- 🐬 MySQL 5.7.31
- ✒️Apache 2.4.46
- ⛕️Git 2.31.1.windows.1
- 🖊️ Dia for UML
- 🖊️ Draw.io for UML
- 🐬 MySQL Workbench for UML
To get a copy up and running follow these simple steps.
- PHP > 8.0.0
- Host provider or XAMPP/WAMP for local use
- MySQL DMBS like phpMyAdmin : https://docs.phpmyadmin.net/fr/latest/setup.html
- Symfony > 5.3.6
- Libraries will be installed using Composer
- Git clone the repository from this page. See GitHub Documentation
- Open .env.example file, replace SMTP field (line 25) with your own information, and rename it .env
- If you are missing any information, please ask you webhost for Database credentials
- Install Composer if you don't have it yet. See Composer Documentation
- In your CMD, move on your project directory using cd command :
cd your/directory
- Run :
composer install
All dependencies should be installed in a vendor directory.
- Create new Database in your favorite MySQL DMBS running
php bin/console doctrine:database:create
- Import database tables running
php bin/console doctrine:migrations:migrate
- Import fixtures running
php bin/console doctrine:fixtures:load
- Generate your own SSL keys running (if needed see Lexik Documentation)
php bin/console lexik:jwt:generate-keypair
- (local only) To start the server, run
symfony s:start
- Go to "/api" to see the API documentation
Please see an hosted example version here : https://deperne.fr/api_bilemo/public/api
Cédric Deperne - cedric@deperne.fr
Project Link: https://github.com/Drx85/p7_api_bilemo