Shopware Frontends
repository·main·Indexed 42 days ago
https://github.com/shopware/frontendsA Vue.js framework for building custom, high-performance storefronts for Shopware 6. It utilizes a cloud-first approach with HTTP APIs to decouple the frontend from internal platform APIs, providing a stable alternative to Twig-based themes.
What's inside Shopware Frontends
- The B2B modules collection provides a set of specialized elements and documentation designed for B2B commerce scenarios. The primary module currently documented is Quote Management, which handles B2B-specific workflows like requesting and managing quotes.
Overview of Shopware Composable Frontends
mainShopware Composable Frontends is a toolkit designed for creating platform-agnostic custom storefronts. It is built as a collection of multiple packages that can be integrated into custom storefront projects. While the reference demo implementation uses Vue.js and Nuxt3, the toolkit is designed to be flexible across different environments.What is @shopware/unocss-design-tokens-layer?
mainThe
@shopware/unocss-design-tokens-layeris a Nuxt layer that provides the shared Shopware Frontends UnoCSS setup, design tokens, a reset stylesheet, and runtime support for resolving dynamic utility classes.It is designed to be composed with other layers (like
@shopware/cms-base-layer), allowing developers to keep design tokens separate from CMS-specific functionality.Overview of Caching Layers in Shopware Frontends
mainShopware Frontends employs multiple independent caching layers that compose to optimize performance. A request can be served from various levels, including the browser, a CDN, ISR-rendered HTML, the Shopware backend HTTP cache, or a fresh Store API call.
Layer What it caches Where it runs How you configure it Request layer ( cacheableReads)Anonymous Store API reads via GET routes Composables -> HTTP infrastructure shopware: { cacheableReads: true }Render layer ( routeRules)Rendered HTML (ISR / SWR), per-route headers Nuxt / Nitro server routeRulesinnuxt.config.tsEdge / CDN layer GET responses and HTML with Cache-ControlCDN / reverse proxy Cache-Controlheaders + your CDNBackend HTTP cache Store API GET responses (Varnish / Fastly) Shopware backend Shopware reverse-proxy config Client state Session, cart, user, listings, navigation Browser memory Shared composables, provide/injectAssets / images Optimized images, SVGs, static files CDN / browser @nuxt/imagepresets, route headersNote: ISR and
routeRulescaching only work in production builds on deployment targets that support them (e.g., Node server, Vercel, Netlify). They have no effect duringnuxt dev.Explore Composable Frontends Features
mainThe Composable Frontends ecosystem provides several built-in features to enhance frontend applications. Key features include:
- Wishlist: Use the built-in wishlist API to implement wishlist functionalities within your application.
- Broadcasting: Implement communication between different browser tabs.
- Maintenance Mode: Configure and use maintenance mode within the Composable Frontends app.
Explore Commercial Integrations for Composable Frontends
mainThe
shopware/frontendsrepository provides integration documentation for commercial features available in the Rise, Evolve, and Beyond plans for Shopware. These integrations allow you to implement advanced business capabilities within your composable frontend.Available commercial integrations include:
- B2B Quick-Order: Streamlined ordering processes for business customers.
- B2B Quote-Management: Tools for managing quotes and negotiations in a B2B context.
- Custom Products: Support for products with specialized configurations or attributes.
- Digital Sales Rooms: Collaborative sales environments for managing customer interactions.
CMS Overview and Shopping Experiences
mainThe CMS functionality in Shopware frontends is centered around 'Shopping Experiences'. This system allows for the creation and management of content pages. The CMS architecture supports displaying content pages using data directly from Shopware's own CMS, as well as integrating third-party CMS systems.Understand the Shopware Frontends flow via Recipes
mainShopware Frontends Recipes provide end-to-end explanations of how specific features are implemented. Instead of generic Vue tutorials, these recipes trace a single UI action through the entire technical stack, including:
- UI Actions: The user interaction in the frontend.
- Composables: The logic layer managing state and behavior.
- API Client Calls: How the frontend communicates with the backend.
- Store API Endpoints: The specific backend routes being hit.
- Generated Types: The TypeScript definitions used for data integrity.
- Session State: How user state is maintained.
- Production Concerns: Real-world considerations for deployment and stability.
Key features of Shopware Frontends
mainShopware Frontends is designed for high-performance, cloud-first storefront development with the following characteristics:
- Shopware Native: Deeply integrated with Shopware 6 core concepts like content management, checkout, and payment.
- Cloud First: Designed to work exclusively with HTTP APIs available in Shopware Cloud; requires no themes, plugins, or server access.
- Stable: Does not rely on volatile internal Shopware APIs (like Twig blocks, DAL, or Events), making it resistant to breaking changes during platform updates.
- Efficient & Flexible: Uses a modern tech stack (Vue3, Vite, Nuxt 4, UnoCSS/Tailwind.css) with no inheritance-based theming system, allowing for complete design freedom.
- Fast: Optimized for performance using server-side rendering, code splitting, below-the-fold rendering, and lazy-loading.
Choose a distribution channel for @shopware/* packages
mainThe
@shopware/*packages are published through three distinct channels depending on your stability and testing requirements.- Stable: Use for production and everyday app development. This is the default channel and provides semantic versioning (semver) guarantees.
- Canary: Use to test changes that have been merged to
mainbut are not yet part of a stable release. These are unstable and change frequently. - PR preview: Use to test the exact code from a specific open pull request before it is merged. These are ephemeral and served via
pkg.pr.newrather than npm.
| Channel | Source | Stability | When to use | | --- | --- | --- | --- | | Stable | npm tag `latest` | Stable, semver | Production and normal app development. The default. | | Canary | npm tag `canary` | Unstable, no semver | Test changes merged to `main` but not yet released. | | PR preview | pkg-pr-new (not on npm) | Ephemeral, per-PR | Try the code from one specific open pull request. |Documentation structure and sections
mainThe documentation is organized into several distinct sections. When adding new content, ensure it is categorized correctly:
- Framework: Documentation regarding internals and packages (e.g., Composables).
- Building (getting-started): Business use-case guides that bridge the framework and examples. Includes:
- CMS: Sub-pages for CMS blocks, elements, and pages.
- E-Commerce: Components related to e-commerce, such as prices.
- Page-Elements: Page elements not related to CMS or E-Commerce.
- Templates: Setup guides for existing templates.
- Best Practices: Frontend-specific or general ecosystem guidance.
- Package Reference: Technical references for available packages (primarily non-narrative).
- Resources:
- Examples: Purely for copy-and-paste code examples (no guides allowed here).
- Community Modules: A list of known community modules for Frontends.
Explore E-Commerce frontend elements
mainThe E-Commerce collection provides specialized elements and documentation for building common shopping experiences. You can implement the following core features using the provided composables and packages:
- Product Listing: Initialize the
useListingcomposable to search for products, display them in a list, implement pagination, apply sortings, and use filters. The@shopware/helperspackage can be used to assist with listing logic. - Product Detail Page: Learn how to fetch product data and construct a Product Detail Page (PDP).
- Prices: Understand the structure of the price object, how to format pricing tiers, and how to display context-aware prices using the
useProductPricecomposable. - Cart: Manage the shopping cart lifecycle, including creating a cart, adding products or promotions, removing items, and displaying cart contents.
- Checkout: Handle the checkout flow, including fetching payment/shipping information, generating order summaries (totals and taxes), and placing orders.
- Payments: Understand the implementation differences between synchronous and asynchronous payment methods.
- SEO with JSON-LD: Implement JSON-LD structured data to improve e-commerce visibility in search engines.
- Product Listing: Initialize the