Giter Club home page Giter Club logo

ildaviz / headless-ecommerce Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bagisto/headless-ecommerce

1.0 0.0 1.0 204 KB

Laravel Headless eCommerce APIs allow you to experience seamless and easily scalable storefront performance. An open-source and GraphQL based Rest API Laravel platform delivering ultra-fast, dynamic, and personalized shopping experiences.

Home Page: https://bagisto.com/en/headless-ecommerce/

License: MIT License

PHP 100.00%

headless-ecommerce's Introduction

Bagisto GraphQL API

Laravel eCommerce headless APIs allow you to experience seamless and easily scalable storefront performance. An open-source and GraphQL based Rest API Laravel platform delivering ultra-fast, dynamic, and personalized shopping experiences.

The Bagisto GraphQL API is made in collaboration with Ucraft Team

1. Requirements:

  • Bagisto: v1.2.0, v1.3.x

2. Installation:

  • Unzip the respective extension zip and then merge "packages" folder into project root directory.

Goto config/app.php file and add following line under 'providers'

    Webkul\GraphQLAPI\Providers\GraphQLAPIServiceProvider::class

Find a file auth.php present inside config folder from root and do the following changes:

  • change the token driver to jwt in 'guards' array like below mentioned (for Bagisto v1.2.0):
    'admin-api' => [
        'driver'    => 'jwt',
        'provider'  => 'admins',
    ]
  • replace the admins array index with the below-mentioned value in 'providers' array:
    'admins' => [
        'driver'    => 'eloquent',
        'model'     => Webkul\GraphQLAPI\Models\User\Admin::class,
    ]

Goto composer.json file and add following line under 'psr-4'

    "Webkul\\GraphQLAPI\\": "packages/Webkul/GraphQLAPI"

Goto packages/Webkul/Checkout/src/Http/helpers.php file and replace the Cart::class to

  • replace Cart::class to 'cart' keyword.

Run the below mentioned commands from the root directory in terminal:

    composer dump-autoload
    php artisan bagisto_graphql:install

Find a file config/lighthouse.php from root and do the following changes:

  • change the guard index value from api to admin-api like below mentioned:
    https://prnt.sc/y03ye5
  • change the path from 'graphql/schema.graphql' to 'packages/Webkul/GraphQLAPI/graphql/schema.graphql' for the register index under schema array index like below mentioned:
    https://prnt.sc/y03vxl
  • change the App\GraphQL\ path to Webkul\GraphQLAPI\ in all the indexes of namespace index:
    https://prnt.sc/y03tnh
  • Add the JWT_TTL (JWT time to live) entry in the .env file under the JWT_SECRET key:
    JWT_TTL=525600

Now to use the graphql-playground for testing the APIs:

    http://example.com/graphql-playground

To check the customer's API (front APIs), you have to put all the shop schemas at the end in the schema file (i.e. packages/Webkul/GraphQLAPI/graphql/schema.graphql).

    put all shop schemas #import /shop/*/*.graphql after #import /promotion/*.graphql this line.

Or you can also use the Postmen for testing the APIs:

    http://example.com/graphql

That's it, now just execute the project on your specified domain.

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

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.