GithubHelp home page GithubHelp logo

0xsid0703 / laravel-ecommerce Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avored/laravel-ecommerce

2.0 0.0 0.0 114.77 MB

AvoRed an Open Source Laravel Shopping Cart

Home Page: https://avored.com

Shell 0.07% JavaScript 0.43% PHP 25.91% TypeScript 42.92% CSS 0.87% HTML 0.50% Vue 27.78% Blade 1.52%

laravel-ecommerce's Introduction

AvoRed an laravel headless e commerce

A headless e commerce GraphQL API which uses Laravel as a backend.

Installation

Backend APP setup

First thing first we will install laravel backend api service. First thing first we will install the laravel app.

composer create-project laravel/laravel avored-backend
cd avored-backend
composer require avored/framework
composer require avored/dummy-data
composer require avored/cash-on-delivery
composer require avored/pickup

Set up your .env values and CORS

To fixed the CORS in your laravel8 app. You can open config/cors.php and replace the code like below in the file.

'allowed_origins' => ['http://localhost:8080'],

Once the .env setup is done then we can install the AvoRed E commerce

php artisan avored:install
php artisan vendor:publish --provider="AvoRed\Framework\AvoRedServiceProvider"
yoursite.com/graphiql

Once the avored/framework has been installed after that we will make sure we setup the CORS to allow access of an graphql api via any frontend.

Frontend APP Setup
git clone https://github.com/avored/laravel-ecommerce avored-frontend
cd avored-frontend
npm install
npm run serve

Installation via Docker

Execute the below command:

git clone https://github.com/avored/docker-dev.git
cd docker-dev

git clone https://github.com/avored/laravel-ecommerce ./src/frontend
docker-compose up -d
docker-compose run --rm composer create-project laravel/laravel:8.6 ./
docker-compose run --rm composer require avored/framework
docker-compose run --rm composer require avored/dummy-data avored/cash-on-delivery avored/pickup

Now setup .env file. Open a avored app .env file which is located at ./src/backend/.env then setup your database and any other env as per your docker-compose.yml file

DB_HOST=mysql
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

Now we just have to install the AvoRed and create an avored admin user account

docker-compose run --rm artisan avored:install
docker-compose run --rm artisan vendor:publish --provider="AvoRed\Framework\AvoRedServiceProvider"

Now we need to setup CORS so frontend application can receive api call from backnd. Open ./src/backend/config/cors.php then replace the below line

    'paths' => ['/graphql', 'sanctum/csrf-cookie'],
    'allowed_origins' => ['http://localhost:8060'],

That's It. Now you can visit http://localhost:8060 for frontend and for backend you can visit http://localhost:8050/admin

laravel-ecommerce's People

Contributors

indpurvesh avatar dependabot[bot] avatar ghermans avatar ishifoev avatar d1ms1m avatar lhsazevedo avatar purveshpatelau avatar petro-ivvysoft avatar itrack avatar flexander avatar cchoe1 avatar chandresh1339 avatar nextdoorpanda avatar vanthao03596 avatar nbrabant avatar bachilli avatar ozdemirburak avatar dangenendt avatar mattkelliher avatar mimou78 avatar peerrabe avatar wikiccu avatar rowayda-khayri avatar marciojc avatar yarynka avatar tortuvshin avatar gitter-badger avatar santiagogg avatar sajjad-rezaei avatar olivsinz avatar

Stargazers

SID avatar  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.