All Projects → Jordaneisenburger → Fallback Studio

Jordaneisenburger / Fallback Studio

Licence: mit
Magento 2 PWA fallback wrapper to easily create a custom theme on top of PWA Studio

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fallback Studio

Vue Storefront
The open-source frontend for any eCommerce. Built with a PWA and headless approach, using a modern JS stack. We have custom integrations with Magento, commercetools, Shopware and Shopify and total coverage is just a matter of time. The API approach also allows you to merge VSF with any third-party tool like CMS, payment gateways or analytics. Ne…
Stars: ✭ 9,111 (+8108.11%)
Mutual labels:  storefront, magento, magento2
Module Rocketjavascript
Stars: ✭ 37 (-66.67%)
Mutual labels:  magento, magento2
Magento 2 Seo
Magento 2 SEO extension will do perfectly for your better SEO. This is a bundle of outstanding features that are auto-active when you install it from Mageplaza without any code modifications. It is also friendly with your store if you need to insert meta keywords and meta descriptions for your product.
Stars: ✭ 99 (-10.81%)
Mutual labels:  magento, magento2
Ampersand Magento2 Upgrade Patch Helper
Helper script to aid upgrading magento 2 websites by detecting overrides
Stars: ✭ 98 (-11.71%)
Mutual labels:  magento, magento2
Magento2
All Submissions you make to Magento Inc. ("Magento") through GitHub are subject to the following terms and conditions: (1) You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, subli…
Stars: ✭ 9,816 (+8743.24%)
Mutual labels:  magento, magento2
Magento2 Easy Template Path Hints
Magento 2 Easy Template Path Hints
Stars: ✭ 36 (-67.57%)
Mutual labels:  magento, magento2
Magento2 Faq
This module adds an easy way to use FAQ Section to your Magento store with jQuery Accordion. In this module, admin can add and update FAQ. Admin can also create FAQ group with group icon.
Stars: ✭ 43 (-61.26%)
Mutual labels:  magento, magento2
Ddev
DDEV-Local: a local PHP development environment system
Stars: ✭ 915 (+724.32%)
Mutual labels:  magento, magento2
Magento2 Import Export Sample Files
Default Magento 2 CE import / export CSV files & sample files for Firebear Improved Import / Export extension
Stars: ✭ 68 (-38.74%)
Mutual labels:  magento, magento2
Magentoextensions
Magento Extension Directory 1> Themes Switcher 2> Default Shipping On Cart 3> Upshare 4> Product Image Optimizer 5> Idealo Product Export 6> magento Google shopping Api v2 7>Google feed and facebook feed 8> Pdf upload in magento media wysiwyg 9> Product Image optimizer. If You want magento 2 extensions 1>Advance Layred Navigation(including SEO URL, Rating as filter, slider filter, Ajax Filtering), 2>Attribute Pages with SEO and Custom URL key(you can do all kind of seo on those pages with logos) 3>Improved Sorting (Enable users to view products by options as 'Best Sellers', 'Top Rated', 'Most Viewed' etc.) 4>Custom Stock Status(Add statuses to products automatically or manually, Create multiple custom stock statuses, Upload special icons for stock statuses) 5>Product Labels(Using this extension you can add any label to your produts on product page or category page) 6>Custom Order Number(Using this extension you can customize order, invoice, shippment, credit memo Number) 7>All type of file upload in Wysiwyg(pdf, zip, doc etc file upload in wysiwyg), 8>Infinite Scroll, 9>Multiple FlatRate Shipping, 10>Open Api,Google api for currency Rates, 11>Product Attribute's Description, 12>Store and Currency switcher according to Ip address Please Contact me and All those extensions are paid with installation and configuration are free support.
Stars: ✭ 106 (-4.5%)
Mutual labels:  magento, magento2
Magento2 Form Field Manager
Customer and Address Form Fields Manager for Magento2
Stars: ✭ 21 (-81.08%)
Mutual labels:  magento, magento2
Magento2 Fixtures
Fixture library for Magento 2 integration tests by @schmengler (@integer-net)
Stars: ✭ 110 (-0.9%)
Mutual labels:  magento, magento2
Generator Mage2
Yeoman generator for Magento 2 extensions (modules and themes)
Stars: ✭ 12 (-89.19%)
Mutual labels:  magento, magento2
Magento2 Varnish Redis Ssl Docker Compose
Deploy Magento2 with Varnish Cache and Redis with SSL termination using Docker-compose tool
Stars: ✭ 37 (-66.67%)
Mutual labels:  magento, magento2
Magento2 Module Pagebuildersourcecode
The Page Builder Source Code module adds a Source Code button to the toolbar of the Page Builder WYSIWYG editor.
Stars: ✭ 24 (-78.38%)
Mutual labels:  magento, magento2
M2 Opcache Monitor
Monitor PHP OpCache from the Admin
Stars: ✭ 38 (-65.77%)
Mutual labels:  magento, magento2
Magento Nginx Config
Default Nginx config for Magento
Stars: ✭ 462 (+316.22%)
Mutual labels:  magento, magento2
Elasticsuite
Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
Stars: ✭ 647 (+482.88%)
Mutual labels:  magento, magento2
Docker Magento
Mark Shust's Docker Configuration for Magento
Stars: ✭ 1,123 (+911.71%)
Mutual labels:  magento, magento2
Magento2 Custom Shipping Rate
Create your own Custom Shipping rates for admin order or a predefined sets of shipping methods for frontend customers.
Stars: ✭ 76 (-31.53%)
Mutual labels:  magento, magento2

node pwa-studio

DEPRECATED! You should check www.pwastudio.io on how to start a project

Fallback Studio

Fallback Studio (the name was too funny not to use) creates a wrapper around PWA Studio and provides a basic fallback structure so you can create storefronts that depend on the venia-concept storefront.

Motivation

The reason i created this repository is because the first time i cloned pwa-studio and followed the docs i had no clue on how or where to start building my own storefront.

The idea behind this fallback structure is basically the same as we know it from default Magento. Your custom storefront will be the same as venia-concept except the components that you've changed to your needs or custom made. When you've been developing follow this approach for a while you will find that in-time hardly anything will fallback to venia-concept thus making your storefront stand on it's own.

I assume that for a lot of frontend Magento developers PWA and all the techniques used to create one are somewhat uncharted waters. With this setup i hope to remove the "i have no clue where to start" feeling and make it simple for developers to start playing with pwa-studio

Based on the amount questions i've been asked and seen in the community around this topic i decided to make this public.

Prerequisites

Make sure you have the following:

Quick setup

Note: only run commands from the root dir

step: 1

git clone https://github.com/Jordaneisenburger/fallback-studio.git

step: 2

cd fallback-studio

step: 3 (this runs all necessary package.json commands back to back)

yarn run setup

step: 4

yarn run watch:example-shop

Right now you should see something like this in your terminal:

Alt text

How the fallback structure works

So to give you a feeling on how it all works we first need to take a look at a crucial file in the fallback structure. If you open the following file src/example-company/example-shop/webpack.config.js you see it looks a lot like the default webpack.config.json from venia-concept. The big difference is that everywhere there is a path to a certain file or folder we removed the contents from our storefront and added a fallback path.

For example:
in our storefront we don't want to create a custom validate-environment.js because the default from venia-concept fits our needs so we've deleted it from the example-shop storefront.

Now to fallback to venia-concept we've changed this:

const validEnv = require('./validate-environment')(process.env);

to this:

//declared at the top of our webpack.config.js
const parentTheme = path.resolve(process.cwd() + '/../../pwa-studio/packages/venia-concept');

const validEnv = require(`${parentTheme}/validate-environment`)(process.env);

As you can tell this is pretty basic and straightforward.

So how about React components?

To do this we again need to take a look at our webpack.config.js file but this time we need to scroll down a bit till we get to the resolve part that looks like:

resolve: {
    modules: [__dirname, 'node_modules', parentTheme],
    mainFiles: ['index'],
    extensions: ['.mjs', '.js', '.json', '.graphql'],
    alias: {
        parentSrc: path.resolve(parentTheme, 'src'),
        parentComponents: path.resolve(parentTheme, 'src/components'),
        parentQueries: path.resolve(parentTheme, 'src/queries')
    }

}

As you can see we once again included the const parentTheme in the modules array. But the real 'magic' happens in the alias part. 3 aliases are added for different folders inside the venia-concept folder.

For example:
parentComponents will resolve to pwa-studio/packages/venia-concept/src/components

I've created a really basic example on how to fallback on venia-concept components. But first I'd like you to navigate to src/example-company/example-shop/src/components as you can tell we are missing quite a few components.

Now pleas run the follow command from the root directory yarn run watch:example-shop as you can tell it's pretty much the same as venia-concept but we've added a custom TopBar component and overwritten the Footer component and added and extra block of content.

Lets take a look at the code:
Look at the following folder src/example-company/example-shop/src/components/Footer as you can tell we've only copied index.js and footer.js but we are missing footer.css but the styling still works. That's because inside footer.js we made a little change:

from this:

import defaultClasses from './footer.css';

to this: (remember our alias inside webpack.config.js?)

import defaultClasses from 'parentComponents/Footer/footer.css';

So we've changed this component with a custom piece of content 'Custom Example shop' but kept the default styling.

Another example:
I've created a custom component called TopBar this one is not overwritten from venia-concept storefront. I want to include this on every page so I've copied the Main component from venia-concept to our components folder.

As you can tell I've added aliases for all components that we are not changing and included my own custom component:

//Uncomment to use venia-concept footer again
//import Footer from 'parentComponents/Footer';

import Footer from 'src/components/Footer';

import Header from 'parentComponents/Header';
import TopBar from 'src/components/TopBar';
import defaultClasses from 'parentComponents/Main/main.css';

...

<main className={classes.root}>
    <TopBar />
    <Header />
    <article className={classes.page}>{children}</article>
    <Footer />
</main>

Creating a custom storefront

The easiest way to add a custom storefront is to duplicate the example-company folder and rename it to your likings. Don't forget to change it inside the root package.json, lerna.json and the package.json from the storefront.

NOTE:
For now you shouldn't change the names of the folder because there will be bugfixes etc. and if you've changed the folder names this will cause problems when you update this repo. I'm planning on adding a simple CLI like create-react-app to setup your own theme.

Updating PWA Studio

To update to the latest pwa-studio version you want to run the following commands from the project root dir

yarn run upgrade:pwa-studio

NOTE:
Always check the changes before you update because you might need to make changes to your custom storefront to prevent issues.

TODO

  • add simple CLI for creating storefronts
  • get the complete dev experience by working with the watch:all script

Credits

Definitely not needed but appreciated

Buy Me A Coffee

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].