Skip to content

Latest commit

 

History

History
executable file
·
60 lines (39 loc) · 2.47 KB

README.md

File metadata and controls

executable file
·
60 lines (39 loc) · 2.47 KB

Projet_7

BileMo

Codacy Badge

Project installation

  1. Code recovery

    1. Git

      Connect with SSH key to your server.
      Use the command : git clone https://github.com/MalronWall/OC_Fo-Back_P7.git

    2. FTP

      Download this repository.
      Use a FTP client, for example FileZilla and connect to the server.
      Use the FTP client to transfert the repository on your server.

  2. Configuration

    Update environnements variables in the /app/config/parameters.yml file with your values. At the very least you need to define the SYMFONY_ENV=prod

  3. Vendors installation

    1. Composer

      If you can use Composer in your server, use composer install --no-dev -ao for optimized installation of vendors.
      If you can't use Composer, download Composer.phar and use php composer.phar install --no-dev -ao.

    2. FTP

      If you can't use the both solutions, use your FTP client to download all vendors.
      This solution is to be used only if no solution with Composer works.

  4. Assets install

    Run the command php app/console assets:install --symlink --relative to copy assets in your web/ folder.

  5. Database creation

    Use the command php bin/console d:d:c for database creation.
    Use the command php bin/console d:m:m for creation of the tables.
    Create the first Client manually in the database with this command :
    INSERT INTO 'client' ('id', 'username', 'password', 'roles')
    VALUES ('[A valid UUID]', 'Admin', '[A password encoded in bcrypt]', 'a:1:{i:0;s:10:\"ROLE_ADMIN\";}');

  6. Documentation and API tests

    The documentation is on the uri /api/doc. If the uri is /, user redirected to /api/doc.
    For the connection, use Postman (or other API Development Environment), and connect to the path /api/login, with credentials :

    {'username': 'Admin','password': '[the previously entered password in db]'}

    Copy the returned bearer token and connect by paste the token in the "Authorization" button then choose the Bearer Token security and enter your token.