/lamia-test-task-php

Lamia test task Client with Laravel, Postgres and Apache2

Primary LanguagePHPMIT LicenseMIT

lamia-test-task-php

This client is currently available and running on Heroku (as of 2020.12.05).

Operating instructions

In order to run the project locally use:

composer install
php artisan jwt:secret
php artisan migrate
php artisan serve

Keep in mind, your Postgres DB should also be active for everything to work.

Platform

This project and its dependencies are supported on Ubuntu and Heroku VM.

Stack

  • Laravel
  • Apache2 (on Heroku)
  • Postgres

Environment variables

Name Description
APP_DEBUG true or false
APP_ENV local or production
APP_KEY Base64-prefixed secret key
APP_URL Deployment host root url
DB_CONNECTION pgsql or else, if you do not use Postgres
GET_BOOK_ENDPOINT_URL URL of the REST API enpoint mirroring OMDb API
GET_MOVIE_ENDPOINT_URL URL of the REST API enpoint mirroring OpenLibrary API
JWT_SECRET Secret generated by php artisan jwt:secret

API

Route JWT required Type Description
/ Yes Page Main application page. JWT bearer token required.
/login No Page Login page
/registration No Page Registration page
/search/book Yes Page Book search page
/search/movie Yes Page Movie search page
/api/getBook Yes API Book data API
/api/getMovie Yes API Movie data API
/api/auth/login No API Login API
/api/auth/logout Yes API Logout API
/api/auth/registration No API Registration API

JWT required - identifies paths, which require to add JWT token in Authorization header on the client side in order to proceed, basic form:

Authorization: Bearer <token>

Behaviour Flow

  1. Registration
  2. Login -> JWT Token
  3. Addressing Book API or Movie API (via Postman)