Skip to content

baktash93/petshop

Repository files navigation

Pet Shop eCommerce API

About Pet shop eCommerce API

This Laravel-based API backend was developed for the purpose of a test conducted by Buckhill for the position of Laravel PHP developer.

Configuration

The following needs to be specified in the .env before properly running the API server

Environment variable

Please refer .env.example in the root of the project:

  • TIMEZONE - Can be set to a proper timezone value (e.g. Asia/Kabul)
  • SESSION_MAX_AGE - This needs to be set to specify the defualt age of a generated token for a user. It can be set to any value acceptable by DateTimeImmutable (modify method) such as +1 day, +6 hour, etc.

Migrations and seeds

  • php artisan migrate
  • php artisan db:seed

After the values on the .env file have been updated, please run php artisan config:cache to update the config cache values for the server.

Serve

php artisan serve --port 8001

Swagger API documentation

To run Swagger documentation server for this application you need to install npx and swagger-ui-serve as npm dependencies:

  • NPX

    npm i -g npx
    
  • Swagger UI Serve package

    npm i swagger-ui-serve
    

To run the Swagger API server run npm run swagger from the project root directory. You should be guided to a tab opened on your browser on port 3000.

Testing

To execute the tests included with this API please run php artisan test

or

./vendor/bin/phpunit on the terminal.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages