Coder Social home page Coder Social logo

pet_shop's Introduction

Pet-Shop API

Pet-Shop API Laravel Application.


Getting started

1. Docker installation

To start container

git clone [email protected]:mhojaguliyev/pet_shop.git
cd pet_shop
cp .env.example .env
docker run --rm --interactive --tty --volume $PWD:/app composer install --ignore-platform-reqs --no-scripts
docker-compose up -d --build

Migrate data with seeding

docker exec -i app php artisan migrate --seed

Seeding categories and products with dummy data

docker exec -i app php artisan db:seed --class=CategoryProductSeeder

Run larastan

 docker exec -i app ./vendor/bin/phpstan analyse

Run tests

 docker exec -i app php artisan test

Run php insights

docker exec -i app php artisan insights

2. Manual Installation

Clone the repository

git clone [email protected]:mhojaguliyev/pet_shop.git

Switch to the repo folder

cd pet_shop

Install all the dependencies using composer

composer install

Copy the example env file and make the required configuration changes in the .env file

cp .env.example .env

Generate a new application key

php artisan key:generate

Run the database migrations (Set the database connection in .env before migrating)

php artisan migrate --seed

Start the local development server

php artisan serve --port=8888

You can now access the server at http://localhost:8888/api/v1

Make sure you set the correct database connection information before running the migrations Environment variables

php artisan migrate --seed
php artisan serve --port=8888

Code overview

Dependencies

Dev Dependencies

Folders

  • app - Contains all the Eloquent models
  • app/Enums - Contains the Enums
  • app/Filters - Contains the Eloquent Filter classes
  • app/Http/Controllers - Contains all the controllers
  • app/Http/Middleware - Contains the middlewares
  • app/Http/Requests - Contains all the api form requests
  • app/Http/Resources - Contains all the api resource files
  • config - Contains all the application configuration files
  • database/factories - Contains the model factory for all the models
  • database/migrations - Contains all the database migrations
  • database/seeds - Contains the database seeder
  • routes - Contains all the api routes defined in api_v1.php file
  • tests - Contains all the application tests
  • tests/Feature - Contains all the api feature tests
  • tests/Unit - Contains all the api unit tests

Environment variables

  • .env - Environment variables can be set in this file

Note : You can quickly set the database information and other variables in this file and have the application fully working.


API Documentation

The api documentation can be accessed at http://localhost:8888.

After seeding the database,

  1. The default admin credentials are:
  1. The default user credentials are:

pet_shop's People

Contributors

mhojaguliyev avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.