Bilemo is a REST API built during my web development learning path with OpenClassrooms. This API provides a catalog of Phones and Tablets accessible by the Retailers and their Clients.
- Symfony 4.4.9 LTS
- Doctrine
- JWTAuthentication
- PSR-1, PSR-4, PSR-12
- Symfony Best Practices (mostly)
- Clone or download the repository
git@github.com:RSHKDL/p7-rest-api.git
into your environment. - Change the files .env.dist and with your own data.
- Install the database and inject the fixtures:
$ bin/console doctrine:database:create $ bin/console doctrine:schema:create $ bin/console doctrine:fixtures:load
- Generate the JWTAuthentication SSH keys:
$ mkdir -p config/jwt $ openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096 $ openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout
- Make sure you have load the fixtures.
- Create your (or yours) Retailers by running this command:
$ bin/console app:retailer:create
- Once you have a Retailer, go to this URI:
/api/login_check
, submit this payload:{ "username": "your-retailer-email", "password": "your-retailer-password" }
- Grab your token and use it as Bearer for your other request to the API.
- To test caching in an environment other than production, you need to edit
public/index.php
and replace prod by dev.
This simple API project is as documented as possible:
You can find a full documentation of API methods by adding /api/doc
at the end of your API URI.