Fully documented & tested Laravel 9 RESTful books API scraped from Gramedia.
This app provides a list of books in a RESTful API. Source of data obtained from Gramedia by using the web scraping technique.
Apart from providing a booklist API, this app was created primarily to learn how to write unit-testable code in Laravel and also presents use cases of framework features such as:
If you are interested in exploring this app, you can check to start from routes/api.php
, app/
folder & tests/
folder.
In addition to the official documentation from Laravel, here are some reference articles that help the development of this application and may be of interest to you:
You can read the API documentation on the following page.
Requirements: PHP 8.1, Composer, RDBMS (such as: MySQL, SQLite, PostgreSQL, etc).
Installation steps:
git clone https://github.com/yusuftaufiq/laravel-books-api.git
cd laravel-books-api
cp .env.example .env
.env
.env.testing
DB_DATABASE
environment value you setcomposer install
php artisan migrate
php artisan serve
Requirements: Docker
Installation steps:
git clone https://github.com/yusuftaufiq/laravel-books-api.git
cd laravel-books-api
cp .env.example .env
DOCKER_FORWARD_*
in .env
to prevent port conflictsdocker-compose up -d --build site
docker-compose run --rm composer install
docker-compose run --rm artisan migrate
composer cache:clear
: clear app cachecomposer code:analyze
: run static code analyzer using PHP Stan and check code style using PHP Code Snifferphp artisan insights
: analyze code quality using PHP Insightsphp artisan test
: run feature & unit testsSince this app is currently hosted on Heroku using a free plan, there is no guarantee that this app will be accessible at any time.
docker-compose
configurationThis application is licensed under the MIT license.