thbighead / olist-test

A products API asked by Olist Pax as a development challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Products API

This project was made to a tech challenge. Here que just have some products entities that may be classified by type, which we called categories.

Installing the project

To develop

After cloning the project, please, create a new .env file based on .env.example and configure the following fields accordingly to your database configurations:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=products-api
DB_USERNAME=root
DB_PASSWORD=

Make sure you do have a database named as DB_DATABASE!

After that, run the following codes in order:

composer install
php artisan key:generate
php artisan migrate --seed

To publish

After cloning the project, please, create a new .env file based on .env.example and configure the following fields accordingly to your database configurations:

APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourawesomeurl.idk.dc

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=products-api
DB_USERNAME=root
DB_PASSWORD=

Make sure you do have a database named as DB_DATABASE!

After that, run the following codes in order:

composer install --no-dev
php artisan key:generate
php artisan migrate
php artisan optimize

Starting a local server

Just run php artisan serve and keep your console opened while you want to make request to your API.

Available endpoints

Please, to check out the available endpoints look at Insomnia.json file. It's recommended to install Insomnia Core so you can import this file and check all ready to use requests there interactively.

Testing

For testing this application, take a look at .env.testing file. It is configured to find a database named products-api_test in a localhost connection. Please, be sure to create it with the same collation used for your development database (utf8mb4 unicode-ci is recommended).

Once everything is set just run the following command:

php artisan test

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel 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.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

About

A products API asked by Olist Pax as a development challenge

License:MIT License


Languages

Language:PHP 89.0%Language:Blade 10.5%Language:Shell 0.5%