• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

avored/laravel-ecommerce: AvoRed an Open Source Laravel Shopping Cart

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

avored/laravel-ecommerce

开源软件地址(OpenSource Url):

https://github.com/avored/laravel-ecommerce

开源编程语言(OpenSource Language):

Vue 83.9%

开源软件介绍(OpenSource 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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap