Skip to content

This a REST API that calls an external API service to get information about books with a simple CRUD (Create, Read, Update, Delete) API with a local database of mysql External API used is Ice And Fire API

Notifications You must be signed in to change notification settings

willypelz/books-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Total Downloads Latest Stable Version License

Book API(Laravel)

Laravel was used to develop the application because it is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Project Setup

In order to setup the application locally on you system.

  1. clone the repository
  2. git clone https://github.com/willypelz/books-api.git
  3. cd into the project directory
  4. cd books-api
  5. install the dependencies for the application
  6. composer install
  7. create a .env file from the .env.example
  8. cp .env.example .env
  9. Generate an application key
  10. php artisan key:generate
  11. create a database called booksapi in your database
  12. update the env files with your mysql connection details that you have on your system
DB_CONNECTION=mysql  
DB_HOST=YOUR_HOST  
DB_PORT=MYSQL_PORT  
DB_DATABASE=booksapi  
DB_USERNAME=MYSQL_USER_NAME  
DB_PASSWORD=MYSQL_PASSWORD
  1. ensure the iceandfire base api is being setup in the .env files
  2. ICE_AND_FIRE_URL='https://www.anapioficeandfire.com/api/' **** IT HAS BEEN TAKEN CAREOF: JUST FOR EASY TESTING
  3. Running migration data into the database
  4. php artisan migrate
  5. serving the project
  6. php artisan serve

Testing the Application

Application Testing is defined as a software testing type, conducted through scripts with the motive of finding errors in software. It deals with tests for the entire application. It helps to enhance the quality of your applications while reducing costs, maximizing ROI, and saving development time.

In order to run the feature test that was written php ./vendor/bin/phpunit when you want to generate a coverage php ./vendor/bin/phpunit --coverage-html ./coverage

This generates html report files in the application in the coverage folder, which can be located in the root directory

Important

Ensure you setup xdebug on your system. Xdebug Setup for local machine (xampp)

Testing the Application (user testing)

  1. Note:: ** when creating an author in the application you have to arrange the name of the authors separated with commas

  2. when testing the external application you can use any of the strings to search for the name of the book

"name" or "name or name" or name

  1. To filter the books you need to search with you desired parameters as shown below

http://localhost:8000/api/v1/books?search=Game of throne
http://localhost:8000/api/v1/books?search="Game of throne"
http://localhost:8000/api/v1/books?search=2020

Note

Please note that the / is for linux and mac terminal which applies to bash terminal also. if you are using window command line with no bash you will have to use the \

Test Coverage(Report) Overview

  1. To view the test coverage
  2. navigate to the coverage folder
  3. click on the index.html open with any browser
  4. To see risk report
  5. In the coverage folder
  6. click in the dashboard.html open with any browser (100% free from risk)

Test Coverage(Report) Overview

Updates

  1. There are still advance optimization and refactoring that can still be done in this project
  2. More validation checks. The validation checks can be increased to take care of users mistake and other case senarios

Developer(Softwaredef)

  1. Name: Asefon Michael Pelumi
  2. Nickname: Softwaredef
  3. Mail: pelumiasefon@gmail.com

Thanks. If you have any problem setting it up or complain you can kindly post them on issues or message me directly

About

This a REST API that calls an external API service to get information about books with a simple CRUD (Create, Read, Update, Delete) API with a local database of mysql External API used is Ice And Fire API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages