All Projects → shopware → production

shopware / production

Licence: MIT license
Shopware 6 production template

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to production

hubble-frontend-pwa
E-Commerce PWA Frontend
Stars: ✭ 43 (-72.44%)
Mutual labels:  ecommerce, shopware, shopware6
v-shopware-api-client
The reliable way to import and update a bazillion products.
Stars: ✭ 20 (-87.18%)
Mutual labels:  ecommerce, shopware, shopware6
FroshProductCompare
A Plugin for Shopware 6 - Ecommerce Platform
Stars: ✭ 27 (-82.69%)
Mutual labels:  shopware, shopware6
RecentlyViewedProduct
Recently viewed products plugin for SW6
Stars: ✭ 20 (-87.18%)
Mutual labels:  shopware, shopware6
sw6-media-optimizer
Image Optimizer for Shopware 6 💙
Stars: ✭ 18 (-88.46%)
Mutual labels:  shopware, shopware6
shopware-cms-generator
Generate a CMS element scaffolding within seconds.
Stars: ✭ 26 (-83.33%)
Mutual labels:  shopware, shopware6
composer-project
Skeleton for Shopware projects with composer
Stars: ✭ 72 (-53.85%)
Mutual labels:  ecommerce, shopware
downtown
With our portal, we want to support local authorities and merchants. We want to connect merchants with closed stores to their customers. And we want to keep in mind, that not every merchant has a sophisticated digital strategy - or even a homepage.
Stars: ✭ 45 (-71.15%)
Mutual labels:  ecommerce, shopware
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 (+5740.38%)
Mutual labels:  ecommerce, shopware
shopware6-advanced-banners
Advanced Banners (Digital Publishing) for Shopware 6 💙
Stars: ✭ 30 (-80.77%)
Mutual labels:  shopware, shopware6
docs
No description or website provided.
Stars: ✭ 28 (-82.05%)
Mutual labels:  shopware, shopware6
magento2-freeshipping-progress-bar
Add a free shipping eligibility progress bar to your Magento 2 websites cart to promote increased order value.
Stars: ✭ 37 (-76.28%)
Mutual labels:  ecommerce
headstart
A complete and opinionated eCommerce solution using OrderCloud as the backbone - built with .NET Core and Angular
Stars: ✭ 28 (-82.05%)
Mutual labels:  ecommerce
mern-ecommerce
MERN Stack ecommerce site
Stars: ✭ 122 (-21.79%)
Mutual labels:  ecommerce
dress-shop
A full stack server side rendered e-commerce built with Next.js, TypeScript, Node.js, Express and MongoDB.
Stars: ✭ 164 (+5.13%)
Mutual labels:  ecommerce
grav-skeleton-gravcart
The Grav Shopping Cart skeleton
Stars: ✭ 11 (-92.95%)
Mutual labels:  ecommerce
spartacus-capybara
SAP Spartacus Theme based on https://storefrontui.io look and feel and design system. Headless storefront solution for Hybris. Always Open Source, MIT license. Made with 💙 by Divante
Stars: ✭ 44 (-71.79%)
Mutual labels:  ecommerce
FoodDelivery
E-Commerce demo project. Food delivery application project made with.
Stars: ✭ 106 (-32.05%)
Mutual labels:  ecommerce
retailbox
🛍️RetailBox - eCommerce Recommender System using Machine Learning
Stars: ✭ 32 (-79.49%)
Mutual labels:  ecommerce
taracode
Hotels booking system
Stars: ✭ 28 (-82.05%)
Mutual labels:  ecommerce

Shopware 6 production template

This repository contains the production template that enables you to build, package and deploy Shopware 6 to production shops. This template is also used to build the official packages distributed by shopware at https://www.shopware.com/en/download.

This template is optimized for production usage and contains basic development tooling. It's intended as a basis for project customizations, which are usually done by agencies.

If you want to contribute to the Shopware Platform or develop store plugins, you should use the development template.

Branches and stability

In each commit a composer.lock is contained to ensure that the version being deployed is the version that was tested in our CI. We currently provide the following branches:

  • 6.3: stable minor and patch releases (v6.3.0.0-rc2, v6.3.0.1, v6.3.1.0, v6.1.*, but not v6.4.0.0)
  • master: stable major, minor and patch releases (v6.3.0.0, v6.3.1.0, v6.4.0.0, v6.5.0.0...)

The 6.3 branch contains all the 6.3 releases. It's stable now and only gets non-breaking changes. (security issues are an exception).

The master branch contains the newest stable release, including major releases. That may result in plugins being incompatible, so be careful.

Starting with 6.3.0.0, we use a slightly modified version of SemVer. The pattern looks like this: 6.MAJOR.MINOR.PATCH. Examples:

  • 6.3.2.5 - Major=3, Minor=2, Patch=5
  • 6.4.1.0 - Major=4, Minor=1, Patch=0

See also: https://www.shopware.com/en/news/shopware-6-versioning-strategy/

Requirements

See https://developer.shopware.com/docs/guides/installation/overview#prerequisites

NPM and Node are only required during the build process and for development. If you don't have javascript customizations it's not required at all because the storefront and admin are prebuilt.

If you are using a separate build server, consider having NPM and Node as build-only requirements. Your operating application server doesn't require any of these to run Shopware 6.

Setup and install

To set up the environment and install with a basic setup run the following commands:

# clone the newest patch version from github 
git clone --branch=[current version] https://github.com/shopware/production shopware
cd shopware

# install shopware and dependencies according to the composer.lock 
composer install

# setup the environment
bin/console system:setup
# or create .env yourself, if you need more control
# create jwt secret: bin/console system:generate-jwt-secret
# create app secret: APP_SECRET=$(bin/console system:generate-app-secret)
# create .env

# create database with a basic setup (admin user and storefront sales channel)
bin/console system:install --create-database --basic-setup

# or run `bin/console assets:install` and use the interactive installer in the browser: /recovery/install/index.php

Update

To update Shopware 6 just run this:

# pull newest changes from origin
git pull origin

# the (pre|post)-(install|update)-cmd will execute all steps automatically
composer install

Customization

This project is called production template because it can be used to create project specific configurations. The template provides a basic setup that is equivalent to the official distribution. If you need customization, the workflow could look like this:

  • Fork template
  • Make customization
  • Add dependencies
  • Add project specific plugins
  • Update var/plugins.json (bin/console bundle:dump, paths need to be relative to the project root)
  • Build administration/storefront
  • Update composer.json and composer.lock
  • Commit changes

Development

Command overview

The following commands and scripts are available

Setup/Install/Deployment

Command Description
bin/console system:setup Configure and create .env and optionally create jwt secret
bin/console system:generate-jwt-secret Generates a new jwt secret
bin/console system:generate-app-secret Outputs a new app secret. This does not update your .env!
bin/console system:install Setup database and optional install some basic data
bin/console system:update:prepare Run update preparations before the update. Do not update if this fails
bin/console system:update:finish Executes the migrations and finishes the update
bin/console theme:change Assign theme to a sales channel

Build

bash is required for the shell scripts

Command Description
bin/console theme:compile Compile all assigned themes
bin/build.sh Complete build including composer install
bin/build-js.sh Build administration and storefront, including all plugins in var/plugins.json.
bin/build-administration.sh Just build the administration.
bin/build-storefront.sh Just build the storefront. You need to have built the administration once.

Dev

Run bin/build-js.sh once to install the npm dependencies.

bash is required for the shell scripts

Command Description
bin/console theme:refresh Reload theme.json of active themes
bin/watch-administration.sh Watcher for administration changes, recompile and reload page if required
bin/watch-storefront.sh Watcher for storefront changes, recompile and reload page if required

Configuration

See also config/README.md

Template overview

This directory tree should give an overview of the template structure.

├── bin/                  # binaries to setup, build and run symfony console commands 
├── composer.json         # defines dependencies and setups autoloading
├── composer.lock         # pins all dependencies to allow for reproducible installs
├── config                # contains application configuration
│   ├── bundles.php       # defines static symfony bundles - use plugins for dynamic bundles
│   ├── etc/              # contains the configuration of the docker image
│   ├── jwt/              # secrets for generating jwt tokens - DO NOT COMMIT these secrets
│   ├── packages/         # configure packages - see: config/README.md
│   ├── secrets/          # symfony secrets store - DO NOT COMMIT these secrets
│   ├── services/         # contains some default overrides
│   ├── services.xml      # just imports the default overrides - this file should not change
│   └── services_test.xml # just imports the default overrides for tests
├── custom                # contains custom files
│   ├── plugins           # store plugins
│   ├── static-plugins    # static project specific plugins
├── docker-compose.yml    # example docker-compose
├── Dockerfile            # minimal docker image
├── phpunit.xml.dist      # phpunit config
├── public                # should be the web root
│   ├── index.php         # main entrypoint for the web application
├── README.md             # this file
├── src
│   ├── Command/*
│   ├── Kernel.php        # our kernel extension
│   └── TestBootstrap.php # required to run unit tests
└── var
    ├── log/              # log dir
    |── cache/            # cache directory for symfony
    └── plugins.json      # javascript build configuration

Managing Dependencies

Composer

You only need to require the things you want. If you only want to run shopware 6 in headless mode, your composer.json could look like this:

{
    "name": "acme/shopware-production",
    "type": "project",
    "license": "MIT",
    "config": {
        "optimize-autoloader": true
    },
    "prefer-stable": true,
    "minimum-stability": "stable",
    "autoload": {
        "psr-4": {
            "Shopware\\Production\\": "src/"
        }
    },
    "require": {
        "php": "~7.4",
        "composer/package-versions-deprecated": "^1.8.0",
        "shopware/core": "~v[current version]"
    }
}

Require project plugins

If you have project specific plugins, place them under custom/static-plugins/{YourPlugin} and require them in your composer.json.

Note: The plugins needs a (stable) version to work with the default stability stable.

composer require "exampleorg/myplugin"

External plugins in private repositories can also be required by adding the repository to your composer.json.

See Using private repositories

Update shopware packages

Run the following command, to update all shopware dependencies:

composer update "shopware/*"

Deployment

Docker

The DOCKERFILE and docker-compose.yml service definitions should work but are still experimental.

Storage and caches

The following directories should be shared by all app servers:

.
├── config
│   ├── jwt # ro - should be written on first deployment
│   ├── secrets # rw shared - For usage refer to: https://symfony.com/blog/new-in-symfony-4-4-encrypted-secrets-management 
├── public
│   ├── bundles # rw shared - Written by `assets:install` / `theme:compile`, can also be initiated by the administration
│   ├── media # rw shared
│   ├── theme # rw shared - generated themes by `theme:compile/change`
│   └── thumbnail # rw shared - media thumbnails
│   └── sitemap # rw shared - generated sitemaps
├── var
│   ├── cache # rw local - contains the containers which contain additional cache directories (twig, translations, etc)
│   ├── log # a - append only, can be changed in the monolog config

ro - Readonly after deployment
rw shared - read and write access, it should be shared across the app servers
rw local - local read and write access

Some of these directories like public can also be changed to a different flysystem to host the files on s3 for example.

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].