Giter Site home page Giter Site logo

sausyn / solidus_multi_domain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inovaservices/solidus_multi_domain

0.0 0.0 0.0 465 KB

Multi-tenancy for your Solidus store.

License: BSD 3-Clause "New" or "Revised" License

Shell 2.69% Ruby 79.66% CSS 0.18% HTML 17.47%

solidus_multi_domain's Introduction

SolidusMultiDomain

CircleCI

This extension allows a single Solidus instance to have several customer facing stores, with a single shared backend administration system (i.e. multi-store, single-vendor).

Current features:

  1. Store model which has the following attributes:

    1.1 name - The display name for the store.

    1.2 domains - a line separated list of fully qualified domain names used to associate a customers session with a particular store (you can use localhost and/or IP addresses too).

    1.3 code - which is a abbreviated version of the store's name (used as the layout directory name, and also helpful for separating partials by store).

    1.4 default - one store should be marked a default as a fallback in case the URL being used to access the site cannot be matched against any of the configured stores.

  2. Stores and domains can be maintained via the configuration section of the Admin interface

  3. Each store can have its own layout(s) - these layouts should be located in your site's theme extension in the app/views/spree/layouts/store#code/directory. So, if you have a store with a code of "alpha" you should store its default layout in app/views/spree/layouts/alpha/spree_application.html.erb

  4. Each product can be assigned to one or more stores.

  5. All orders are associated with the store / domain that they were placed on.

Looking for additional information? Checkout out the wiki.

Installation

Add solidus_multi_domain to your Gemfile:

gem 'solidus_multi_domain', github: 'solidusio-contrib/solidus_multi_domain'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g solidus_multi_domain:install

You should see 'Stores & Domains' in Configuration tab of Spree Admin.

Development

To see if your stores indeed do point to the correct and unique domains, start your server with

rails s -p 3000 -b lvh.me

and give a store a domain like store1.lvh.me.

Then you can access to your store by going to http://store1.lvh.me:3000/ in your browser.

If you'd like access to Solidus factories for your own tests that work well with this extension, add the following to your spec_helper:

require "spree_multi_domain/testing_support/factory_overrides"

Authorization

For discrete authorization, two permission sets have been added to allow for granular display in the admin.

Spree::PermissionSets::StoreDisplay and Spree::PermissionSets::StoreManagement have been added and can be assigned via RoleConfiguration

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs, and Rubocop static code analysis. The dummy app can be regenerated by using rake test_app.

bundle
bin/rake

When testing your application's integration with this extension you may use its factories. Simply add this require statement to your spec_helper:

require 'solidus_multi_domain/factories'

Releasing

Your new extension version can be released using gem-release like this:

bundle exec gem bump -v VERSION --tag --push --remote upstream && gem release

Copyright (c) 2016 Solidus Team, released under the New BSD License

solidus_multi_domain's People

Contributors

adammathys avatar afdev82 avatar aitbw avatar aldesantis avatar athal7 avatar ccarruitero avatar dholdren avatar exsuzme avatar filipechagas avatar futhr avatar jdutil avatar jgujgu avatar jhawthorn avatar jordan-brough avatar joshcheek avatar jumph4x avatar kamui avatar kennyadsl avatar magnusvk avatar montebrown avatar peterberkenbosch avatar plongyear avatar radar avatar romul avatar sausyn avatar schof avatar sebashton avatar senjai avatar spaghetticode avatar swively 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.