@shopbite-de/storefront 1.23.3 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +22 -0
- package/.github/workflows/build.yaml +1 -1
- package/.github/workflows/ci.yaml +6 -3
- package/CLAUDE.md +48 -3
- package/README.md +139 -40
- package/api-gen.config.json +9 -0
- package/api-types/storeApiSchema.shopbite.overrides.json +35 -0
- package/api-types/storeApiTypes.d.ts +95 -81
- package/app/app.config.ts +3 -2
- package/app/app.vue +40 -53
- package/app/assets/css/main.css +36 -4
- package/app/components/AddToWishlist.vue +13 -6
- package/app/components/Address/Fields.vue +2 -21
- package/app/components/AnimatedSection.vue +9 -4
- package/app/components/BottomNavi.vue +9 -2
- package/app/components/Cart/Bar.vue +102 -0
- package/app/components/Cart/Item.vue +21 -10
- package/app/components/Cart/QuickView.vue +4 -0
- package/app/components/Cart/Upsell.vue +106 -0
- package/app/components/Category/Header.vue +9 -3
- package/app/components/Category/Listing.vue +62 -45
- package/app/components/Checkout/PaymentAndDelivery.vue +19 -3
- package/app/components/Checkout/Summary.vue +70 -2
- package/app/components/Cta.vue +4 -2
- package/app/components/DemoBanner.vue +13 -0
- package/app/components/Feature/Card.vue +121 -0
- package/app/components/Features.vue +14 -9
- package/app/components/Food/MarqueeItem.vue +20 -8
- package/app/components/Footer/Contact.vue +82 -0
- package/app/components/Footer/StoreStatus.vue +30 -0
- package/app/components/Footer.vue +2 -1
- package/app/components/Header/Body.vue +1 -1
- package/app/components/Header/Right.vue +60 -17
- package/app/components/Header/Title.vue +1 -0
- package/app/components/Header.vue +5 -15
- package/app/components/Hero.vue +169 -36
- package/app/components/ImageGallery.vue +11 -5
- package/app/components/Product/Card.vue +104 -46
- package/app/components/Product/CardCompact.vue +72 -0
- package/app/components/Product/CardDietBadges.vue +38 -31
- package/app/components/Product/CardIngredients.vue +35 -0
- package/app/components/Product/CardSkeleton.vue +10 -18
- package/app/components/Product/Category.vue +9 -2
- package/app/components/Product/Configurator.vue +11 -7
- package/app/components/Product/CrossSelling.vue +45 -34
- package/app/components/Product/DeselectIngredient.vue +37 -31
- package/app/components/Product/Detail.vue +73 -13
- package/app/components/Product/QuickView.vue +77 -0
- package/app/components/Topseller.vue +44 -34
- package/app/components/User/RegistrationForm.vue +0 -1
- package/app/components/Wishlist.vue +2 -15
- package/app/composables/useAddToCart.ts +13 -40
- package/app/composables/useAddressAutocomplete.ts +12 -19
- package/app/composables/useAddressSuggestionArea.ts +16 -0
- package/app/composables/useAddressValidation.ts +3 -19
- package/app/composables/useCartMutations.ts +168 -0
- package/app/composables/useCartQuickView.ts +19 -0
- package/app/composables/useCartUpsell.ts +100 -0
- package/app/composables/{useCategory.ts → useCategoryById.ts} +1 -1
- package/app/composables/useCategorySeo.ts +27 -29
- package/app/composables/useCheckoutMethodGuard.ts +201 -0
- package/app/composables/useMatomo.ts +25 -0
- package/app/composables/useMatomoConfig.ts +12 -0
- package/app/composables/useMenuSectionSchema.ts +55 -0
- package/app/composables/useNavigation.ts +12 -9
- package/app/composables/usePageSeo.ts +50 -0
- package/app/composables/useProductCartQuantity.ts +15 -0
- package/app/composables/useProductCrossSelling.ts +1 -0
- package/app/composables/useProductDetail.ts +15 -1
- package/app/composables/useProductEvents.ts +30 -0
- package/app/composables/useProductQuickView.ts +65 -0
- package/app/composables/useRestaurantSchema.ts +64 -0
- package/app/composables/useScrollAnimation.ts +39 -8
- package/app/composables/useSearchTracking.ts +33 -0
- package/app/composables/useSeoUrlRoute.ts +58 -0
- package/app/composables/useSortingSelection.ts +28 -0
- package/app/composables/useStoreStatus.ts +48 -0
- package/app/composables/useTopSellers.ts +22 -0
- package/app/composables/useTrackEvent.ts +36 -23
- package/app/pages/[...all].vue +4 -4
- package/app/pages/account/recover/password/index.vue +1 -0
- package/app/pages/anmelden.vue +4 -0
- package/app/pages/bestellung/[id]/erfolg.vue +1 -5
- package/app/pages/bestellung/[id]/fehler.vue +2 -2
- package/app/pages/bestellung/[id]/index.vue +9 -3
- package/app/pages/bestellung/bestaetigen.vue +1 -5
- package/app/pages/bestellung/warenkorb.vue +1 -5
- package/app/pages/bestellung/zahlung-versand.vue +1 -5
- package/app/pages/c/[...all].vue +2 -35
- package/app/pages/index.vue +28 -14
- package/app/pages/kontakt.vue +4 -0
- package/app/pages/konto/adressen.vue +4 -0
- package/app/pages/konto/bestellung/[id].vue +4 -0
- package/app/pages/konto/bestellungen.vue +4 -0
- package/app/pages/konto/index.vue +4 -0
- package/app/pages/konto/profil.vue +4 -0
- package/app/pages/maintenance.vue +6 -0
- package/app/pages/merkliste.vue +1 -7
- package/app/pages/passwort-vergessen.vue +1 -0
- package/app/pages/registrierung/bestaetigen.vue +4 -0
- package/app/pages/registrierung/index.vue +4 -0
- package/app/pages/speisekarte/[...all].vue +2 -36
- package/app/pages/suche.vue +42 -26
- package/app/plugins/matomo.ts +35 -0
- package/app/types/Association.d.ts +1 -0
- package/app/utils/hydrateWhenVisible.ts +20 -0
- package/app/utils/media.ts +33 -0
- package/app/utils/openingHours.ts +90 -0
- package/app/utils/product.ts +31 -0
- package/app/utils/schema.ts +235 -0
- package/app/utils/seo.ts +56 -0
- package/app/utils/seoPath.ts +57 -0
- package/content/index.yml +26 -20
- package/content.config.ts +16 -0
- package/docs/notes/2026-07-05-issue-259-matomo-broken.md +7 -0
- package/docs/notes/2026-09-08-issue-240-shipping-method-blocked.md +83 -0
- package/docs/notes/2026-09-08-issue-241-cart-lock-conflicts.md +63 -0
- package/docs/notes/2026-09-08-issue-244-category-url-trailing-slash.md +65 -0
- package/docs/notes/2026-09-08-issue-276-payment-method-blocked.md +39 -0
- package/docs/notes/2026-09-08-issue-277-typecheck.md +99 -0
- package/docs/notes/2026-09-10-issue-250-animated-section.md +23 -0
- package/docs/notes/2026-09-10-issue-251-shop-data-in-base-layer.md +30 -0
- package/docs/notes/2026-09-10-issue-272-restaurant-schema.md +27 -0
- package/docs/notes/2026-09-10-issue-273-performance-media.md +64 -0
- package/docs/notes/2026-09-10-issue-274-seo-basics.md +49 -0
- package/docs/notes/2026-09-10-issue-275-accessibility.md +46 -0
- package/docs/notes/2026-09-10-issue-290-footer-nap.md +28 -0
- package/docs/notes/2026-09-10-issue-291-seo-url-trailing-slash.md +24 -0
- package/docs/notes/2026-09-10-issue-294-matomo-without-config.md +33 -0
- package/docs/notes/2026-09-10-issue-295-search-hydration-mismatch.md +25 -0
- package/docs/notes/2026-09-10-issue-296-track-direct-search.md +19 -0
- package/docs/notes/2026-09-10-issue-312-store-api-criteria-post.md +64 -0
- package/docs/notes/2026-09-10-issue-313-wishlist-scoped-tailwind.md +29 -0
- package/docs/notes/2026-09-10-issue-314-mobile-js-cost.md +119 -0
- package/docs/notes/2026-09-12-issue-319-stylesheet-cost.md +154 -0
- package/docs/notes/2026-09-12-issue-325-product-card.md +100 -0
- package/docs/notes/2026-09-12-issue-327-home-hero.md +64 -0
- package/docs/notes/2026-09-13-demo-banner.md +32 -0
- package/docs/notes/2026-09-13-issue-332-home-info-cards.md +46 -0
- package/docs/notes/2026-09-13-quick-view-flicker.md +65 -0
- package/docs/notes/2026-09-14-cart-upsell.md +105 -0
- package/docs/notes/2026-09-14-demo-noindex.md +57 -0
- package/node.dockerfile +5 -2
- package/nuxt.config.ts +98 -15
- package/package.json +5 -3
- package/patches/@shopware__nuxt-module@1.5.1.patch +32 -0
- package/pnpm-workspace.yaml +2 -0
- package/public/hero-poster.webp +0 -0
- package/scripts/perf/first-render.mjs +30 -0
- package/scripts/perf/h2-proxy.cjs +49 -0
- package/scripts/perf/lighthouse.sh +22 -0
- package/scripts/perf/quick-view-layout.mjs +126 -0
- package/server/api/__sitemap__/urls.get.ts +49 -0
- package/server/api/category/[categoryId].get.ts +20 -9
- package/server/api/content/home.get.ts +14 -0
- package/server/api/content/page.get.ts +22 -0
- package/server/api/listing/[categoryId].get.ts +14 -18
- package/server/api/product/[productId]/cross-selling.get.ts +3 -9
- package/server/api/product/[productId].get.ts +4 -8
- package/server/api/search.get.ts +2 -0
- package/server/plugins/site-url.ts +13 -0
- package/server/plugins/sitemap-trailing-slash.ts +26 -0
- package/server/utils/sitemap.ts +60 -0
- package/server/utils/storeApi.ts +34 -0
- package/shopware.d.ts +35 -11
- package/test/e2e/simple-checkout-as-recurring-customer.test.ts +13 -17
- package/test/nuxt/AddressFields.test.ts +2 -73
- package/test/nuxt/AnimatedSection.test.ts +67 -0
- package/test/nuxt/CartBar.test.ts +110 -0
- package/test/nuxt/CartItem.test.ts +95 -0
- package/test/nuxt/CartUpsell.test.ts +125 -0
- package/test/nuxt/DemoBanner.test.ts +12 -0
- package/test/nuxt/FooterContact.test.ts +102 -0
- package/test/nuxt/FooterStoreStatus.test.ts +48 -0
- package/test/nuxt/HeaderRight.test.ts +14 -10
- package/test/nuxt/Hero.test.ts +68 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +67 -8
- package/test/nuxt/RegistrationForm.test.ts +3 -0
- package/test/nuxt/useAddToCart.test.ts +37 -17
- package/test/nuxt/useAddressAutocomplete.test.ts +2 -38
- package/test/nuxt/useAddressSuggestionArea.test.ts +27 -0
- package/test/nuxt/useBusinessHours.test.ts +1 -1
- package/test/nuxt/useCartMutations.test.ts +225 -0
- package/test/nuxt/useCartUpsell.test.ts +126 -0
- package/test/nuxt/useCheckoutMethodGuard.test.ts +386 -0
- package/test/nuxt/useScrollAnimation.test.ts +55 -49
- package/test/nuxt/useSearchTracking.test.ts +71 -0
- package/test/nuxt/useSeoUrlRoute.test.ts +93 -0
- package/test/nuxt/useStoreStatus.test.ts +77 -0
- package/test/nuxt/useTrackEvent.test.ts +127 -0
- package/test/unit/media.spec.ts +49 -0
- package/test/unit/openingHours.spec.ts +90 -0
- package/test/unit/product.spec.ts +72 -0
- package/test/unit/schema.spec.ts +243 -0
- package/test/unit/seo.spec.ts +107 -0
- package/test/unit/seoPath.spec.ts +116 -0
- package/test/unit/sitemap.spec.ts +88 -0
- package/test/unit/useCategorySeo.spec.ts +42 -31
- package/test/unit/useSortingSelection.spec.ts +39 -0
- package/test/visual/playwright.config.ts +33 -0
- package/test/visual/visual.spec.ts +87 -0
- package/app/components/Product/CardDescription.vue +0 -27
- package/app/components/Product/CardFooter.vue +0 -51
- package/app/composables/useValidCitiesForDelivery.ts +0 -12
package/.env.example
CHANGED
|
@@ -9,14 +9,36 @@ NUXT_PUBLIC_SHOPWARE_COUNTRY_ID=019a17a0f67b706a8ec9ead3059e12ba
|
|
|
9
9
|
|
|
10
10
|
NUXT_PUBLIC_SHOP_BITE_FEATURE_MULTI_CHANNEL=false
|
|
11
11
|
NUXT_PUBLIC_SHOP_BITE_FEATURE_SECURE_KEY=
|
|
12
|
+
NUXT_PUBLIC_SHOP_BITE_FEATURE_CONTACT_FORM=false
|
|
13
|
+
# Demo shops: notice above the header that orders are not fulfilled
|
|
14
|
+
NUXT_PUBLIC_SHOP_BITE_FEATURE_DEMO_BANNER=false
|
|
15
|
+
# Optional Geoapify bounding box lon1,lat1,lon2,lat2 for the address
|
|
16
|
+
# suggestions in the checkout (empty = no filter)
|
|
17
|
+
NUXT_PUBLIC_SHOP_BITE_ADDRESS_AUTOCOMPLETE_BOUNDING_BOX=
|
|
12
18
|
|
|
13
19
|
OPENAPI_ACCESS_KEY=key
|
|
14
20
|
OPENAPI_JSON_URL="https://shopware.shopbite.net"
|
|
15
21
|
|
|
16
22
|
NUXT_GEOAPIFY_API_KEY=
|
|
17
23
|
|
|
24
|
+
# Matomo loads only when both values are set
|
|
18
25
|
NUXT_PUBLIC_SCRIPTS_MATOMO_ANALYTICS_MATOMO_URL=
|
|
19
26
|
NUXT_PUBLIC_SCRIPTS_MATOMO_ANALYTICS_SITE_ID=
|
|
20
27
|
|
|
28
|
+
# SEO (NUXT_PUBLIC_STORE_URL above is the base of canonical URLs and the sitemap)
|
|
29
|
+
NUXT_PUBLIC_SITE_TITLE_TEMPLATE="%s | %siteName – Online bestellen"
|
|
30
|
+
NUXT_PUBLIC_SITE_OG_IMAGE="/card.png"
|
|
31
|
+
NUXT_PUBLIC_SITE_CUISINE=
|
|
32
|
+
NUXT_PUBLIC_SITE_ADDRESS_CITY=
|
|
33
|
+
|
|
34
|
+
# Footer contact block (empty values are hidden)
|
|
35
|
+
NUXT_PUBLIC_SITE_ADDRESS_STREET=
|
|
36
|
+
NUXT_PUBLIC_SITE_ADDRESS_POSTAL_CODE=
|
|
37
|
+
NUXT_PUBLIC_SITE_ADDRESS_COUNTRY=DE
|
|
38
|
+
NUXT_PUBLIC_SITE_TELEPHONE=
|
|
39
|
+
NUXT_PUBLIC_SITE_GOOGLE_BUSINESS_PROFILE_URL=
|
|
40
|
+
# Restaurant schema (schema.org), e.g. "€€"
|
|
41
|
+
NUXT_PUBLIC_SITE_PRICE_RANGE=
|
|
42
|
+
|
|
21
43
|
NUXT_STORE_NAME="ShopBite"
|
|
22
44
|
STORE_DESCRIPTION="Reduziere deine Kosten und steigere deinen Umsatz"
|
|
@@ -27,7 +27,7 @@ jobs:
|
|
|
27
27
|
with:
|
|
28
28
|
version: 10.34.5
|
|
29
29
|
|
|
30
|
-
- uses: actions/setup-node@
|
|
30
|
+
- uses: actions/setup-node@v7
|
|
31
31
|
with:
|
|
32
32
|
node-version: '24'
|
|
33
33
|
cache: 'pnpm'
|
|
@@ -71,7 +71,7 @@ jobs:
|
|
|
71
71
|
with:
|
|
72
72
|
version: 10.34.5
|
|
73
73
|
|
|
74
|
-
- uses: actions/setup-node@
|
|
74
|
+
- uses: actions/setup-node@v7
|
|
75
75
|
with:
|
|
76
76
|
node-version: '24'
|
|
77
77
|
|
|
@@ -91,6 +91,9 @@ jobs:
|
|
|
91
91
|
- name: ESLint
|
|
92
92
|
run: pnpm eslint
|
|
93
93
|
|
|
94
|
+
- name: Typecheck
|
|
95
|
+
run: pnpm typecheck
|
|
96
|
+
|
|
94
97
|
unit-test:
|
|
95
98
|
name: Unit tests
|
|
96
99
|
environment: test
|
|
@@ -104,7 +107,7 @@ jobs:
|
|
|
104
107
|
with:
|
|
105
108
|
version: 10.34.5
|
|
106
109
|
|
|
107
|
-
- uses: actions/setup-node@
|
|
110
|
+
- uses: actions/setup-node@v7
|
|
108
111
|
with:
|
|
109
112
|
node-version: '24'
|
|
110
113
|
|
package/CLAUDE.md
CHANGED
|
@@ -24,7 +24,7 @@ pnpm test:unit # Vitest (unit + nuxt environments, with coverage)
|
|
|
24
24
|
pnpm test:e2E # Playwright e2e (Chromium, requires .env.test)
|
|
25
25
|
|
|
26
26
|
# Shopware API types
|
|
27
|
-
pnpm generate-types # Regenerate api-types/storeApiTypes.d.ts from schema
|
|
27
|
+
pnpm generate-types # Regenerate api-types/storeApiTypes.d.ts from schema (then run pnpm lint:fix)
|
|
28
28
|
pnpm load-schema # Reload Shopware API schema
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -41,7 +41,15 @@ pnpm playwright test test/e2e/checkout.spec.ts
|
|
|
41
41
|
|
|
42
42
|
### Typecheck note
|
|
43
43
|
|
|
44
|
-
Always run `nuxt typecheck` via the `pnpm typecheck` script, not via `npx vue-tsc`. The global npx-cached `vue-tsc` version may not be compatible with the project's installed `vue-router`. If `.nuxt/tsconfig.json` has stale pnpm paths after a dependency update, run `pnpm nuxt prepare` to regenerate it.
|
|
44
|
+
Always run `nuxt typecheck` via the `pnpm typecheck` script, not via `npx vue-tsc`. The global npx-cached `vue-tsc` version may not be compatible with the project's installed `vue-router`. If `.nuxt/tsconfig.json` has stale pnpm paths after a dependency update (or after adding/renaming a composable), run `pnpm nuxt prepare` to regenerate it.
|
|
45
|
+
|
|
46
|
+
`pnpm typecheck` must stay at zero errors; CI runs it in the lint job. The sources of `@shopware/composables` and the `@shopware/nuxt-module` plugin are part of the checked program, so three things keep them green (see `docs/notes/2026-09-08-issue-277-typecheck.md`):
|
|
47
|
+
|
|
48
|
+
- `shopware.d.ts` falls back to the api-client's default types for operations/schemas our instance does not expose, and keeps `LineItem.payload` optional.
|
|
49
|
+
- `api-gen.config.json` applies the upstream schema patches plus `api-types/storeApiSchema.shopbite.overrides.json` when generating types.
|
|
50
|
+
- `patches/@shopware__nuxt-module@1.5.1.patch` (pnpm patch) gives the module's plugin an explicit type. When Renovate bumps `@shopware/nuxt-module`, the patch must be re-applied to the new version (`pnpm patch @shopware/nuxt-module@<version>`).
|
|
51
|
+
|
|
52
|
+
Do not name a project composable like one from the `@shopware/composables` layer (e.g. `useCategory`): the project version shadows the layer's inside the layer's own code as well.
|
|
45
53
|
|
|
46
54
|
## Architecture
|
|
47
55
|
|
|
@@ -66,7 +74,7 @@ declare module "#shopware" {
|
|
|
66
74
|
}
|
|
67
75
|
```
|
|
68
76
|
|
|
69
|
-
Custom ShopBite plugin endpoints are prefixed `shopbite.*` in the operations type (e.g. `shopbite.business-hour.get`, `shopbite.config.get`). Run `pnpm generate-types` after Shopware plugin changes.
|
|
77
|
+
Custom ShopBite plugin endpoints are prefixed `shopbite.*` in the operations type (e.g. `shopbite.business-hour.get`, `shopbite.config.get`). Run `pnpm generate-types` after Shopware plugin changes, then `pnpm lint:fix` (the generator output is not Prettier-formatted). `shopware.d.ts` merges the generated types with the api-client defaults so the composables layer typechecks (see Typecheck note).
|
|
70
78
|
|
|
71
79
|
### Composables layer
|
|
72
80
|
|
|
@@ -80,10 +88,45 @@ Key custom composables:
|
|
|
80
88
|
- **`useAddressAutocomplete`** – proxies Geoapify through `/api/address/autocomplete` to avoid exposing the API key client-side
|
|
81
89
|
- **`useShopBiteConfig`** – fetches delivery config and checkout state from the custom Shopware plugin
|
|
82
90
|
|
|
91
|
+
### Product data model (what Shopware must contain)
|
|
92
|
+
|
|
93
|
+
The storefront reads plain Shopware entities with fixed names; seed data must match them exactly (`shopware/scripts/seed-demo-menu.py` is a working example):
|
|
94
|
+
|
|
95
|
+
- **Navigation:** menu sections are the children of the sales channel navigation root (`readNavigation main-navigation`), optionally scoped by `runtimeConfig.public.shopBite.menuCategoryId`. Category icon comes from the custom field `shopbite_category_icon` (icones.js.org name such as `i-lucide-pizza`), set by the ShopBite plugin.
|
|
96
|
+
- **Property groups:** `Hauptzutaten` (ingredients on the card, deselectable on the detail page, removed ones are appended to the cart label with "-"), `Vegetarisch` and `Vegan` with the option `Ja` (diet badges), `Küche` (kitchen badge). Filterable groups appear as listing filters.
|
|
97
|
+
- **Extras:** product cross-sellings of type `productList`; the cross-selling name is the label ("Extras", "Beilagen"), the assigned products need a price and sales-channel visibility but no category. Selected extras are sent as children of a `container` line item (`useAddToCart.ts`, handled by the ShopBite plugin). The product card has no buttons: the card opens the quick view drawer (`Product/QuickView.vue`), whose state is the `produkt` query parameter (product number) via `useProductQuickView` (#325).
|
|
98
|
+
- **Custom fields on products:** `shopbite_receipt_print_type` (`number` prints the menu number on the receipt, `label` prints the name) and `shopbite_delivery_time_factor` (int) and `shopbite_cart_upsell` (bool, suggests the product on the order confirmation step `/bestellung/bestaetigen` via `useCartUpsell`; variant parents are never suggested, a flag on a parent applies to its variants), all from the ShopBite plugin.
|
|
99
|
+
- **Variants:** standard configurator settings (`Product/Configurator.vue`); `server/api/product/variant.get.ts` resolves a variant by option ids.
|
|
100
|
+
|
|
83
101
|
### Server routes
|
|
84
102
|
|
|
85
103
|
`server/api/address/autocomplete.get.ts` — Geoapify proxy (keeps API key server-side).
|
|
86
104
|
`server/utils/shopware/adminApiClient.ts` — Admin API client for server-side Shopware operations requiring elevated credentials.
|
|
105
|
+
`server/api/__sitemap__/urls.get.ts` — dynamic `@nuxtjs/sitemap` source (navigation categories from the Store API).
|
|
106
|
+
`server/utils/storeApi.ts` — `storeApiPost()` and `MEDIA_INCLUDES` for the routes above. Always send Store API criteria as a POST body (also via `apiClient.invoke("… post …", { body })`): as `_criteria` query parameters Shopware ignores the `includes` projection and returns every field (#312).
|
|
107
|
+
`server/api/content/*.get.ts` — Nuxt Content queries for the pages. Do not call `queryCollection()` in page code: in the browser it downloads the SQLite WASM build (865 KB) on client-side navigation (#314).
|
|
108
|
+
|
|
109
|
+
### Client-side JavaScript budget (#314)
|
|
110
|
+
|
|
111
|
+
- Nothing that the first paint does not need belongs in the entry chunk. Components that only some shops use go behind `Lazy…` + `v-if` (`SalesChannelSwitch`); the Matomo registry is imported in `plugins/matomo.ts` after `onNuxtReady`, tracking pushes to `_paq` via `useTrackEvent`.
|
|
112
|
+
- Overlays (vaul drawers, collapsibles) are created on first use (`v-if` + `nextTick()` before opening), not mounted with the page — mounting forces a layout of the whole page.
|
|
113
|
+
- Long lists render on the server and hydrate on scroll: `hydrateWhenVisible(Component)` (`app/utils`) keeps the markup and the chunk, `AnimatedSection` still animates. Used for product cards and the footer.
|
|
114
|
+
- `NuxtLink` prefetches on interaction only (`experimental.defaults.nuxtLink`), and Rolldown groups shared framework/UI modules into two chunks (`vite.build.rollupOptions.output.codeSplitting`). Measure with Lighthouse behind the h2 proxy (see `docs/notes/2026-09-10-issue-314-mobile-js-cost.md`) before changing either.
|
|
115
|
+
|
|
116
|
+
### Stylesheet (#319)
|
|
117
|
+
|
|
118
|
+
- Nuxt UI runs with `ui.experimental.componentDetection`, so only the theme files of the `<U…>` components found in the layers become Tailwind sources; a component rendered dynamically by name must be listed in the option's array form or its theme is empty.
|
|
119
|
+
- Every family in the `--font-sans` stack costs a system font lookup per text style during the first layout. `fonts.defaults.fallbacks["sans-serif"]` is therefore limited to the phone system fonts (Roboto, Helvetica Neue); do not add desktop families back without measuring Style & Layout (`docs/notes/2026-09-12-issue-319-stylesheet-cost.md`).
|
|
120
|
+
- `ui.colors.primary` in `app.config.ts` must be a colour alias defined in `main.css` (`brand`), not a hex value.
|
|
121
|
+
|
|
122
|
+
### SEO
|
|
123
|
+
|
|
124
|
+
- This repository, deployed as the app, is the demo shop (demo.shopbite.de) and must not be crawled: its Dokploy deployment sets `NUXT_SITE_INDEXABLE=false`. Never set `site.indexable` in `nuxt.config.ts`: shops extending the layer would inherit it and drop out of search engines.
|
|
125
|
+
- `server/plugins/site-url.ts` makes `storeUrl` the nuxt-site-config URL, so canonical, sitemap and robots.txt share one base. Build absolute URLs with `toAbsoluteUrl(useSiteConfig().url, path)` (`app/utils/seo.ts`).
|
|
126
|
+
- `app.vue` sets the title template (`site.titleTemplate`), canonical from the route, `og:url`, fallback `og:image` (`site.ogImage`) and `twitter:card`. Page titles are plain (`"Warenkorb"`), never suffixed with the shop name. Indexable pages use `usePageSeo` (`standalone: true` skips the template, home page); categories use `useCategorySeo`, which overrides the canonical with the SEO URL.
|
|
127
|
+
- Shopware category SEO URLs end in `/` and 404 without it, but the sitemap module strips trailing slashes from every URL. Sitemap entries that need the slash carry `_trailingSlash: true`; `server/plugins/sitemap-trailing-slash.ts` restores it in the XML. Never normalise trailing slashes of backend SEO URLs.
|
|
128
|
+
- `@nuxtjs/sitemap` must stay before `@nuxt/content` in `modules`; content collections need the `sitemap` schema field to appear in the sitemap.
|
|
129
|
+
- Shop contact data (NAP) lives in `runtimeConfig.public.site` (`address.*`, `telephone`, `googleBusinessProfileUrl`) and is rendered by `components/Footer/Contact.vue`. `useBusinessHours`/`useHolidays` use `immediate: false` (app.vue loads them on mount); a component that needs them in the SSR HTML calls `onServerPrefetch(() => refresh())`.
|
|
87
130
|
|
|
88
131
|
### Testing setup
|
|
89
132
|
|
|
@@ -92,6 +135,8 @@ Two Vitest projects in `vitest.config.ts`:
|
|
|
92
135
|
- **`unit`** – `test/unit/`, Node environment, pure function tests
|
|
93
136
|
- **`nuxt`** – `test/nuxt/`, Nuxt environment via `@nuxt/test-utils`, for composables and components
|
|
94
137
|
|
|
138
|
+
In `test/nuxt/`, a `mockNuxtImport("useRuntimeConfig")` without `app.baseURL` breaks the router setup of the test environment (`useRouter()` is undefined, see `HeaderRight.test.ts` for a working mock). For config values, prefer setting them on the real config, e.g. `Object.assign(useRuntimeConfig().public.site, { … })`.
|
|
139
|
+
|
|
95
140
|
E2E tests in `test/e2e/` use Playwright (Chromium only) and require `TEST_USER` / `TEST_USER_PASS` env vars. A local dev server must be running before the suite executes.
|
|
96
141
|
|
|
97
142
|
### Route rendering strategy
|
package/README.md
CHANGED
|
@@ -1,81 +1,180 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# 🍕 ShopBite Storefront
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**A headless Shopware 6 storefront built for food delivery.**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Nuxt 4 · Vue 3 · Tailwind CSS v4 · TypeScript — shipped as a reusable Nuxt layer,
|
|
8
|
+
so every shop is a handful of config lines instead of a fork.
|
|
8
9
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
10
|
+
[](https://nuxt.com)
|
|
11
|
+
[](https://vuejs.org)
|
|
12
|
+
[](https://www.shopware.com)
|
|
13
|
+
[](https://www.typescriptlang.org)
|
|
14
|
+
[](https://tailwindcss.com)
|
|
15
|
+
[](./LICENSE)
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
<img src="./public/screenshot-desktop.png" alt="ShopBite storefront" width="820">
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
- pnpm 10+
|
|
19
|
-
- [Shopbite Shopware Plugin](https://github.com/shopbite-de/shopware-plugin) (required to enable all features)
|
|
19
|
+
</div>
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
---
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
## Why this exists
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
Generic shop templates don't know that a kitchen closes at 22:00, that a pizza comes
|
|
26
|
+
with four toppings priced individually, or that "delivery in 30 minutes" has to be
|
|
27
|
+
validated against today's opening hours _and_ the public holiday calendar.
|
|
28
|
+
|
|
29
|
+
ShopBite does. It's a pure headless frontend — no Shopware template engine, no Twig —
|
|
30
|
+
talking to the Store API and to the custom routes added by the
|
|
31
|
+
[ShopBite Shopware plugin](https://github.com/shopbite-de/shopware-plugin).
|
|
28
32
|
|
|
29
|
-
##
|
|
33
|
+
## Features
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
| | |
|
|
36
|
+
| ----------------------------- | --------------------------------------------------------------------------- |
|
|
37
|
+
| 🕒 **Opening hours** | Multi-interval business hours per weekday, live open/closed state |
|
|
38
|
+
| 📅 **Delivery slots** | 5-minute increments, respects prep time, holidays and closing times |
|
|
39
|
+
| 🧀 **Extras & toppings** | Configurable products grouped into container line items (UUID v5 reference) |
|
|
40
|
+
| 📍 **Address autocomplete** | Geoapify via a server proxy — the API key never reaches the browser |
|
|
41
|
+
| 🚚 **Delivery zones** | City/postcode validation before checkout even starts |
|
|
42
|
+
| 🎟️ **Vouchers** | Discount codes backed by the ShopBite plugin |
|
|
43
|
+
| 📱 **Installable PWA** | Offline-aware service worker, app manifest, mobile bottom navigation |
|
|
44
|
+
| ⚡ **SSR + caching** | Server routes with tuned TTLs for products, listings, categories |
|
|
45
|
+
| 🔍 **SEO ready** | Sitemap, canonical URLs, share previews, title template, structured data |
|
|
46
|
+
| 📊 **Analytics & monitoring** | Matomo via `@nuxt/scripts`, error tracking via Sentry |
|
|
47
|
+
| 🎨 **Themeable** | Nuxt UI + Tailwind v4 tokens — brand a shop by overriding CSS variables |
|
|
48
|
+
| 🌐 **Multi-channel** | Optional sales channel switching for multi-location businesses |
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
32
51
|
|
|
33
52
|
```bash
|
|
53
|
+
pnpm install
|
|
54
|
+
cp .env.example .env
|
|
34
55
|
pnpm dev
|
|
35
56
|
```
|
|
36
57
|
|
|
37
|
-
|
|
58
|
+
The shop is now running on **http://localhost:3000**.
|
|
59
|
+
|
|
60
|
+
> **Prerequisites** — Node.js LTS, pnpm 10+, and a Shopware 6 instance with the
|
|
61
|
+
> [ShopBite plugin](https://github.com/shopbite-de/shopware-plugin) installed
|
|
62
|
+
> (required for business hours, holidays and shop config).
|
|
63
|
+
|
|
64
|
+
### Minimum configuration
|
|
65
|
+
|
|
66
|
+
| Variable | What it does |
|
|
67
|
+
| --------------------------------------- | ------------------------------------------------------------- |
|
|
68
|
+
| `NUXT_PUBLIC_SHOPWARE_ENDPOINT` | Store API base URL, e.g. `https://shop.example.com/store-api` |
|
|
69
|
+
| `NUXT_PUBLIC_SHOPWARE_ACCESS_TOKEN` | Sales channel access key |
|
|
70
|
+
| `NUXT_PUBLIC_STORE_URL` | Public shop URL, base for canonical URLs and the sitemap |
|
|
71
|
+
| `NUXT_STORE_NAME` / `STORE_DESCRIPTION` | Branding for `<head>`, PWA manifest and OG tags |
|
|
72
|
+
| `NUXT_GEOAPIFY_API_KEY` | Server-side key for address autocomplete (optional) |
|
|
73
|
+
|
|
74
|
+
See [`.env.example`](./.env.example) for the full list.
|
|
75
|
+
|
|
76
|
+
## Use it as a Nuxt layer
|
|
77
|
+
|
|
78
|
+
This package is published to npm and designed to be **extended**, not cloned.
|
|
79
|
+
A complete shop looks like this:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
// nuxt.config.ts
|
|
83
|
+
export default defineNuxtConfig({
|
|
84
|
+
extends: ["@shopbite-de/storefront"],
|
|
85
|
+
runtimeConfig: {
|
|
86
|
+
public: {
|
|
87
|
+
site: {
|
|
88
|
+
name: "Masala Mio",
|
|
89
|
+
description: "Indische Küche, italienisch gedacht",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Everything — pages, components, composables, server routes — comes along. Override any
|
|
97
|
+
file by recreating it at the same path in your own `app/` directory.
|
|
38
98
|
|
|
39
|
-
|
|
99
|
+
## Scripts
|
|
40
100
|
|
|
41
101
|
```bash
|
|
42
|
-
pnpm
|
|
43
|
-
|
|
102
|
+
pnpm dev # Dev server on :3000
|
|
103
|
+
pnpm build # Production build
|
|
104
|
+
pnpm preview # Preview the production build
|
|
105
|
+
pnpm generate # Static generation
|
|
44
106
|
|
|
45
|
-
|
|
107
|
+
pnpm typecheck # nuxt typecheck — must stay at zero errors
|
|
108
|
+
pnpm lint:fix # Prettier + ESLint, autofix
|
|
46
109
|
|
|
47
|
-
|
|
48
|
-
pnpm
|
|
49
|
-
|
|
110
|
+
pnpm test:unit # Vitest (unit + Nuxt environments)
|
|
111
|
+
pnpm test:e2e # Playwright, Chromium — needs a running server
|
|
112
|
+
pnpm test:ui # Vitest UI
|
|
50
113
|
|
|
51
|
-
|
|
114
|
+
pnpm generate-types # Regenerate Store API types after plugin changes
|
|
115
|
+
```
|
|
52
116
|
|
|
53
|
-
Run
|
|
117
|
+
Run a single test:
|
|
54
118
|
|
|
55
119
|
```bash
|
|
56
|
-
pnpm test
|
|
120
|
+
pnpm vitest run test/nuxt/useBusinessHours.test.ts
|
|
121
|
+
pnpm playwright test test/e2e/simple-checkout-as-recurring-customer.test.ts
|
|
57
122
|
```
|
|
58
123
|
|
|
59
|
-
|
|
124
|
+
## Architecture
|
|
60
125
|
|
|
61
|
-
```bash
|
|
62
|
-
pnpm test:e2e
|
|
63
126
|
```
|
|
127
|
+
app/
|
|
128
|
+
├── components/ Cart, Checkout, Product, Food, Navigation, Header, …
|
|
129
|
+
├── composables/ Business logic — useBusinessHours, useDeliveryTime, useAddToCart, …
|
|
130
|
+
├── pages/ German routes: /speisekarte, /warenkorb, /konto, /bestellung
|
|
131
|
+
├── stores/ Pinia (checkout state)
|
|
132
|
+
├── validation/ Zod schemas for forms
|
|
133
|
+
└── assets/css/ Tailwind v4 theme tokens
|
|
134
|
+
server/api/ Cached Store API proxies + the Geoapify key guard
|
|
135
|
+
api-types/ Auto-generated Store API types (pnpm generate-types)
|
|
136
|
+
content/ Legal pages as Markdown (@nuxt/content)
|
|
137
|
+
test/ unit · nuxt · e2e
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Composables carry the domain.** `@shopware/composables` is extended as a Nuxt layer,
|
|
141
|
+
so project composables in `app/composables/` transparently override the upstream ones.
|
|
142
|
+
API responses are validated with Zod before they reach a component.
|
|
64
143
|
|
|
65
|
-
|
|
144
|
+
Key ones worth knowing:
|
|
66
145
|
|
|
67
|
-
|
|
146
|
+
- **`useBusinessHours`** — opening hours with multiple intervals per day (Sunday is day 7)
|
|
147
|
+
- **`useDeliveryTime`** — slot validation in 5-minute steps, prep time and holiday aware
|
|
148
|
+
- **`useAddToCart`** — extras/toppings become a container line item keyed by UUID v5
|
|
149
|
+
- **`useShopBiteConfig`** — delivery config and checkout state from the plugin
|
|
150
|
+
- **`useAddressAutocomplete`** — Geoapify behind `/api/address/autocomplete`
|
|
151
|
+
|
|
152
|
+
## Docker
|
|
68
153
|
|
|
69
154
|
```bash
|
|
70
|
-
|
|
155
|
+
docker compose up --build # → http://localhost:3000
|
|
156
|
+
./container pnpm -v # run a command inside the container
|
|
71
157
|
```
|
|
72
158
|
|
|
73
|
-
|
|
159
|
+
## Contributing
|
|
160
|
+
|
|
161
|
+
CI runs **setup → lint → unit → e2e** on every push. Before opening a PR:
|
|
74
162
|
|
|
75
163
|
```bash
|
|
76
|
-
pnpm lint:fix
|
|
164
|
+
pnpm lint:fix && pnpm typecheck && pnpm test:unit
|
|
77
165
|
```
|
|
78
166
|
|
|
167
|
+
Engineering notes for tricky changes live in [`docs/notes/`](./docs/notes);
|
|
168
|
+
day-to-day conventions and gotchas are in [`CLAUDE.md`](./CLAUDE.md).
|
|
169
|
+
|
|
170
|
+
## Related services
|
|
171
|
+
|
|
172
|
+
| Repo | Role |
|
|
173
|
+
| ------------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
174
|
+
| [`shopware-plugin`](https://github.com/shopbite-de/shopware-plugin) | Custom Store API routes, DAL entities, checkout processors |
|
|
175
|
+
| `migrator` | Scrapes restaurant menus and imports them via the Admin API |
|
|
176
|
+
| `order-printer` | Polls orders and prints them on an ESC/POS thermal printer |
|
|
177
|
+
|
|
79
178
|
## License
|
|
80
179
|
|
|
81
|
-
[MIT](./LICENSE)
|
|
180
|
+
[MIT](./LICENSE) — built with 🔥 by [@veliu](https://github.com/veliu)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"paths": {
|
|
3
|
+
"/newsletter/subscribe": {
|
|
4
|
+
"post": [
|
|
5
|
+
{
|
|
6
|
+
"responses": {
|
|
7
|
+
"200": {
|
|
8
|
+
"content": {
|
|
9
|
+
"application/json": {
|
|
10
|
+
"schema": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": [
|
|
13
|
+
"status"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"status": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"enum": [
|
|
19
|
+
"notSet",
|
|
20
|
+
"optIn",
|
|
21
|
+
"optOut",
|
|
22
|
+
"direct"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|