Welcome on the Bilemo Api project ! This project was realized under Symfony 3.4.
This project is for my training at Openclassroom on the DA PHP/Symfony path.This is my seventh project, for which I need to create a Api REST phone sales app.
For more help on how Api works, read the documentation
If you want to use the Frontend app, go here
- PHP 7.3
- Mysql
- Apache
- Symfony
- Doctrine
- friendsofsymfony/rest-bundle
- csa/guzzle-bundle
- white-october/pagerfanta-bundle
- willdurand/hateoas-bundle
- jms/serializer-bundle
- doctrine/doctrine-fixtures-bundle
Before you install the project, go to the Facebook Developers site and sign in.Then go to your space here and create a new app.
For create demo users, go to your Facebook app space, click on Roles and then on Test Users.Create two users with the Add button.
git clone https://github.com/Thibok/Bilemo.git
composer install
php bin/console doctrine:database:create
php bin/console doctrine:schema:update --force
Go in src/AppBundle/DataFixtures/UserFixtures.php and set on lines 62 and 63 your Facebook users demo informations in this order : user ID, first name, last name
php bin/console doctrine:fixture:load
For access to Api, you need access token.For obtain it you can use the Frontend App and sign in with your Facebook account or use a Facebook demo user.For get an access token for a demo user, go to your Facebook app space, choose an user then click on Edit and then Obtain an access token for this test user
Now you can start your server with this :
php bin/console server:start
For your requests, remember to use the Authorization header and add your access token to Bearer (RFC 6750)
Bearer yourAccessTokenAnd go on the local address ! Don't forget to read the documentation
If you need run tests :
php bin/console doctrine:database:create --env=test
php bin/console doctrine:schema:update --force --env=test
Go to your Facebook app space and click on Create a test app
Always in your Facebook app space, create two tests users in your test app and obtain access token for them.
Go in app/config/parameters.yml and set fb_test_main_access_token and fb_test_secondary_access_token with access tokens of your test users
Go in src/DataFixtures/UserFixtures.php and set on lines 54 and 55 your Facebook users test informations in this order : user ID, first name, last name
php bin/console doctrine:fixture:load --env="test"
vendor/bin/phpunit
If you want to use production environment, don't forget :
php bin/console cache:clear --env="prod"