GithubHelp home page GithubHelp logo

rootknight / spree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vuestorefront-community/spree

0.0 1.0 0.0 5.76 MB

Vue Storefront 2 Integration for Spree

Home Page: https://docs.vuestorefront.io/spree

License: MIT License

Shell 0.17% JavaScript 8.84% TypeScript 35.06% Vue 55.67% Dockerfile 0.10% SCSS 0.15%

spree's Introduction

Vue Storefront

Stay connected

GitHub Repo stars Twitter Follow YouTube Channel Subscribers Discord

Vue Storefront 2 integration for Spree Commerce

See it action: Vue Storefront - Spree demo

Overview

This repository contains an Spree integration for Vue Storefront 2.

This integration is being developed and maintained by Upside

Requirements

  • Node 14.15+
  • Spree 4.3+

Deploy in the cloud

Deploy

Getting Started

The easiest way to setup a new Spree + Vue Storefront setup, is to follow out Quick Start Guide.

Simply run the Spree CLI and follow the instructions:

npx @spree/cli new app

Manually adding Vue Storefront to an existing Spree project

  1. Clone this repository
git clone https://github.com/vuestorefront/spree.git
  1. Set backend URL via env variable
export BACKEND_URL=https://demo.spreecommerce.org

Or via .env.development file:

BACKEND_URL=https://demo.spreecommerce.org
  1. Then install dependencies and build the required packages
bin/setup
  1. If everything built properly, you can start working on your new frontend with:
bin/start

Changing some parts of the code (notably the api-client) will trigger a re-build but the change will not be hot-reloaded. To ensure that the app sees you changes, re-run either yarn build or yarn dev.

Enabling optional features

Some features that are either provided by Spree's extensions or that are only available in newer versions, need to be manually enabled in the configuration file. To do that, open the packages/theme/middleware.config.js and update the configuration to desired state

module.exports = {
  integrations: {
    spree: {
      location: '@vue-storefront/spree-api/server',
      configuration: {
        backendUrl: process.env.BACKEND_URL,
        assetsUrl: process.env.ASSETS_URL,
        spreeFeatures: {
          // Associate guest cart after the customer logs in. Requires Spree 4.3+
          associateGuestCart: false,
          // Fetch basic information about products from the `primary_variant` relationship. Requires Spree 4.3+
          fetchPrimaryVariant: false,
          // Wishlist for authenticated users.
          // Accepted values: 'enabled' (Spree 4.4+), 'legacy' (Spree with `spree_wishlist` gem), 'disabled'.
          wishlist:  'disabled'
        }
      }
    }
  }
};

Serving under a subpath

You might want to serve your store under a subpath (for example: https://example.com/shop/). In order to do that, you just have to add a BASE_URL environment variable to the .env.production file containing a full url.

Note that in development it will still be served on the root path (http://localhost:3000 by default) unless you change the .env.development file too.

Repository structure

The monorepo contains three submodules:

  • api-client - low level backend API connector, utilizing Spree's v2 Storefront API
  • composables - reusable business logic
  • theme - Nuxt.js-based frontend application

For more details, refer to the official project structure.

Resources

Demo

spree's People

Contributors

rafalcymerys avatar fpdrozd avatar letelete avatar rafalkosla101 avatar witoldkesek avatar kshalot avatar diegolezana avatar bloodf avatar mdavo6 avatar tniezg avatar filipsobol avatar danielhajduk avatar dimidev avatar elgohr avatar mystix 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.