@shopbite-de/storefront 1.23.3 → 1.24.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.
Files changed (153) hide show
  1. package/.env.example +19 -0
  2. package/.github/workflows/build.yaml +1 -1
  3. package/.github/workflows/ci.yaml +6 -3
  4. package/CLAUDE.md +41 -3
  5. package/README.md +139 -40
  6. package/api-gen.config.json +9 -0
  7. package/api-types/storeApiSchema.shopbite.overrides.json +35 -0
  8. package/api-types/storeApiTypes.d.ts +95 -81
  9. package/app/app.vue +37 -53
  10. package/app/assets/css/main.css +20 -4
  11. package/app/components/Address/Fields.vue +2 -21
  12. package/app/components/AnimatedSection.vue +9 -4
  13. package/app/components/BottomNavi.vue +9 -2
  14. package/app/components/Cart/Item.vue +21 -10
  15. package/app/components/Category/Header.vue +9 -3
  16. package/app/components/Category/Listing.vue +51 -42
  17. package/app/components/Checkout/PaymentAndDelivery.vue +19 -3
  18. package/app/components/Checkout/Summary.vue +65 -1
  19. package/app/components/Cta.vue +4 -2
  20. package/app/components/Food/MarqueeItem.vue +20 -8
  21. package/app/components/Footer/Contact.vue +78 -0
  22. package/app/components/Footer/StoreStatus.vue +30 -0
  23. package/app/components/Footer.vue +2 -1
  24. package/app/components/Header/Body.vue +1 -1
  25. package/app/components/Header/Right.vue +27 -13
  26. package/app/components/Header/Title.vue +1 -0
  27. package/app/components/Header.vue +5 -15
  28. package/app/components/Hero.vue +45 -2
  29. package/app/components/ImageGallery.vue +11 -5
  30. package/app/components/Product/Card.vue +9 -3
  31. package/app/components/Product/CardFooter.vue +22 -12
  32. package/app/components/User/RegistrationForm.vue +0 -1
  33. package/app/components/Wishlist.vue +2 -15
  34. package/app/composables/useAddToCart.ts +13 -13
  35. package/app/composables/useAddressAutocomplete.ts +12 -19
  36. package/app/composables/useAddressSuggestionArea.ts +16 -0
  37. package/app/composables/useAddressValidation.ts +3 -19
  38. package/app/composables/useCartMutations.ts +168 -0
  39. package/app/composables/{useCategory.ts → useCategoryById.ts} +1 -1
  40. package/app/composables/useCategorySeo.ts +22 -25
  41. package/app/composables/useCheckoutMethodGuard.ts +201 -0
  42. package/app/composables/useMatomo.ts +25 -0
  43. package/app/composables/useMatomoConfig.ts +12 -0
  44. package/app/composables/useMenuSectionSchema.ts +55 -0
  45. package/app/composables/useNavigation.ts +12 -9
  46. package/app/composables/usePageSeo.ts +50 -0
  47. package/app/composables/useRestaurantSchema.ts +64 -0
  48. package/app/composables/useScrollAnimation.ts +39 -8
  49. package/app/composables/useSearchTracking.ts +33 -0
  50. package/app/composables/useSeoUrlRoute.ts +58 -0
  51. package/app/composables/useSortingSelection.ts +28 -0
  52. package/app/composables/useStoreStatus.ts +48 -0
  53. package/app/composables/useTrackEvent.ts +29 -23
  54. package/app/pages/[...all].vue +4 -4
  55. package/app/pages/account/recover/password/index.vue +1 -0
  56. package/app/pages/anmelden.vue +4 -0
  57. package/app/pages/bestellung/[id]/erfolg.vue +1 -5
  58. package/app/pages/bestellung/[id]/fehler.vue +2 -2
  59. package/app/pages/bestellung/[id]/index.vue +9 -3
  60. package/app/pages/bestellung/bestaetigen.vue +1 -5
  61. package/app/pages/bestellung/warenkorb.vue +1 -5
  62. package/app/pages/bestellung/zahlung-versand.vue +1 -5
  63. package/app/pages/c/[...all].vue +2 -35
  64. package/app/pages/index.vue +25 -13
  65. package/app/pages/kontakt.vue +4 -0
  66. package/app/pages/konto/adressen.vue +4 -0
  67. package/app/pages/konto/bestellung/[id].vue +4 -0
  68. package/app/pages/konto/bestellungen.vue +4 -0
  69. package/app/pages/konto/index.vue +4 -0
  70. package/app/pages/konto/profil.vue +4 -0
  71. package/app/pages/maintenance.vue +6 -0
  72. package/app/pages/merkliste.vue +1 -7
  73. package/app/pages/passwort-vergessen.vue +1 -0
  74. package/app/pages/registrierung/bestaetigen.vue +4 -0
  75. package/app/pages/registrierung/index.vue +4 -0
  76. package/app/pages/speisekarte/[...all].vue +2 -36
  77. package/app/pages/suche.vue +24 -21
  78. package/app/plugins/matomo.ts +35 -0
  79. package/app/utils/hydrateWhenVisible.ts +20 -0
  80. package/app/utils/media.ts +33 -0
  81. package/app/utils/openingHours.ts +67 -0
  82. package/app/utils/schema.ts +235 -0
  83. package/app/utils/seo.ts +56 -0
  84. package/app/utils/seoPath.ts +57 -0
  85. package/content/index.yml +10 -9
  86. package/content.config.ts +3 -0
  87. package/docs/notes/2026-07-05-issue-259-matomo-broken.md +7 -0
  88. package/docs/notes/2026-09-08-issue-240-shipping-method-blocked.md +83 -0
  89. package/docs/notes/2026-09-08-issue-241-cart-lock-conflicts.md +63 -0
  90. package/docs/notes/2026-09-08-issue-244-category-url-trailing-slash.md +65 -0
  91. package/docs/notes/2026-09-08-issue-276-payment-method-blocked.md +39 -0
  92. package/docs/notes/2026-09-08-issue-277-typecheck.md +99 -0
  93. package/docs/notes/2026-09-10-issue-250-animated-section.md +23 -0
  94. package/docs/notes/2026-09-10-issue-251-shop-data-in-base-layer.md +30 -0
  95. package/docs/notes/2026-09-10-issue-272-restaurant-schema.md +27 -0
  96. package/docs/notes/2026-09-10-issue-273-performance-media.md +64 -0
  97. package/docs/notes/2026-09-10-issue-274-seo-basics.md +49 -0
  98. package/docs/notes/2026-09-10-issue-275-accessibility.md +46 -0
  99. package/docs/notes/2026-09-10-issue-290-footer-nap.md +28 -0
  100. package/docs/notes/2026-09-10-issue-291-seo-url-trailing-slash.md +24 -0
  101. package/docs/notes/2026-09-10-issue-294-matomo-without-config.md +33 -0
  102. package/docs/notes/2026-09-10-issue-295-search-hydration-mismatch.md +25 -0
  103. package/docs/notes/2026-09-10-issue-296-track-direct-search.md +19 -0
  104. package/docs/notes/2026-09-10-issue-312-store-api-criteria-post.md +64 -0
  105. package/docs/notes/2026-09-10-issue-313-wishlist-scoped-tailwind.md +29 -0
  106. package/docs/notes/2026-09-10-issue-314-mobile-js-cost.md +119 -0
  107. package/node.dockerfile +5 -2
  108. package/nuxt.config.ts +74 -15
  109. package/package.json +5 -3
  110. package/patches/@shopware__nuxt-module@1.5.1.patch +32 -0
  111. package/pnpm-workspace.yaml +2 -0
  112. package/public/hero-poster.webp +0 -0
  113. package/server/api/__sitemap__/urls.get.ts +49 -0
  114. package/server/api/category/[categoryId].get.ts +20 -9
  115. package/server/api/content/home.get.ts +14 -0
  116. package/server/api/content/page.get.ts +22 -0
  117. package/server/api/listing/[categoryId].get.ts +12 -18
  118. package/server/api/product/[productId]/cross-selling.get.ts +3 -9
  119. package/server/api/product/[productId].get.ts +4 -8
  120. package/server/plugins/site-url.ts +13 -0
  121. package/server/plugins/sitemap-trailing-slash.ts +26 -0
  122. package/server/utils/sitemap.ts +60 -0
  123. package/server/utils/storeApi.ts +34 -0
  124. package/shopware.d.ts +35 -11
  125. package/test/nuxt/AddressFields.test.ts +2 -73
  126. package/test/nuxt/AnimatedSection.test.ts +67 -0
  127. package/test/nuxt/CartItem.test.ts +95 -0
  128. package/test/nuxt/FooterContact.test.ts +102 -0
  129. package/test/nuxt/FooterStoreStatus.test.ts +48 -0
  130. package/test/nuxt/HeaderRight.test.ts +14 -10
  131. package/test/nuxt/Hero.test.ts +68 -0
  132. package/test/nuxt/PaymentAndDelivery.test.ts +67 -8
  133. package/test/nuxt/RegistrationForm.test.ts +3 -0
  134. package/test/nuxt/useAddToCart.test.ts +34 -1
  135. package/test/nuxt/useAddressAutocomplete.test.ts +2 -38
  136. package/test/nuxt/useAddressSuggestionArea.test.ts +27 -0
  137. package/test/nuxt/useBusinessHours.test.ts +1 -1
  138. package/test/nuxt/useCartMutations.test.ts +225 -0
  139. package/test/nuxt/useCheckoutMethodGuard.test.ts +386 -0
  140. package/test/nuxt/useScrollAnimation.test.ts +55 -49
  141. package/test/nuxt/useSearchTracking.test.ts +71 -0
  142. package/test/nuxt/useSeoUrlRoute.test.ts +93 -0
  143. package/test/nuxt/useStoreStatus.test.ts +77 -0
  144. package/test/nuxt/useTrackEvent.test.ts +112 -0
  145. package/test/unit/media.spec.ts +49 -0
  146. package/test/unit/openingHours.spec.ts +59 -0
  147. package/test/unit/schema.spec.ts +243 -0
  148. package/test/unit/seo.spec.ts +107 -0
  149. package/test/unit/seoPath.spec.ts +116 -0
  150. package/test/unit/sitemap.spec.ts +88 -0
  151. package/test/unit/useCategorySeo.spec.ts +40 -30
  152. package/test/unit/useSortingSelection.spec.ts +39 -0
  153. package/app/composables/useValidCitiesForDelivery.ts +0 -12
package/.env.example CHANGED
@@ -9,14 +9,33 @@ 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
+ # Optional Geoapify bounding box lon1,lat1,lon2,lat2 for the address
13
+ # suggestions in the checkout (empty = no filter)
14
+ NUXT_PUBLIC_SHOP_BITE_ADDRESS_AUTOCOMPLETE_BOUNDING_BOX=
12
15
 
13
16
  OPENAPI_ACCESS_KEY=key
14
17
  OPENAPI_JSON_URL="https://shopware.shopbite.net"
15
18
 
16
19
  NUXT_GEOAPIFY_API_KEY=
17
20
 
21
+ # Matomo loads only when both values are set
18
22
  NUXT_PUBLIC_SCRIPTS_MATOMO_ANALYTICS_MATOMO_URL=
19
23
  NUXT_PUBLIC_SCRIPTS_MATOMO_ANALYTICS_SITE_ID=
20
24
 
25
+ # SEO (NUXT_PUBLIC_STORE_URL above is the base of canonical URLs and the sitemap)
26
+ NUXT_PUBLIC_SITE_TITLE_TEMPLATE="%s | %siteName – Online bestellen"
27
+ NUXT_PUBLIC_SITE_OG_IMAGE="/card.png"
28
+ NUXT_PUBLIC_SITE_CUISINE=
29
+ NUXT_PUBLIC_SITE_ADDRESS_CITY=
30
+
31
+ # Footer contact block (empty values are hidden)
32
+ NUXT_PUBLIC_SITE_ADDRESS_STREET=
33
+ NUXT_PUBLIC_SITE_ADDRESS_POSTAL_CODE=
34
+ NUXT_PUBLIC_SITE_ADDRESS_COUNTRY=DE
35
+ NUXT_PUBLIC_SITE_TELEPHONE=
36
+ NUXT_PUBLIC_SITE_GOOGLE_BUSINESS_PROFILE_URL=
37
+ # Restaurant schema (schema.org), e.g. "€€"
38
+ NUXT_PUBLIC_SITE_PRICE_RANGE=
39
+
21
40
  NUXT_STORE_NAME="ShopBite"
22
41
  STORE_DESCRIPTION="Reduziere deine Kosten und steigere deinen Umsatz"
@@ -68,7 +68,7 @@ jobs:
68
68
  version: 10.34.5
69
69
 
70
70
  - name: Install Node.js
71
- uses: actions/setup-node@v6
71
+ uses: actions/setup-node@v7
72
72
  with:
73
73
  node-version: '24'
74
74
  cache: 'pnpm'
@@ -27,7 +27,7 @@ jobs:
27
27
  with:
28
28
  version: 10.34.5
29
29
 
30
- - uses: actions/setup-node@v6
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@v6
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@v6
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,38 @@ 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).
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), both 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
+ ### SEO
117
+
118
+ - `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`).
119
+ - `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.
120
+ - 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.
121
+ - `@nuxtjs/sitemap` must stay before `@nuxt/content` in `modules`; content collections need the `sitemap` schema field to appear in the sitemap.
122
+ - 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
123
 
88
124
  ### Testing setup
89
125
 
@@ -92,6 +128,8 @@ Two Vitest projects in `vitest.config.ts`:
92
128
  - **`unit`** – `test/unit/`, Node environment, pure function tests
93
129
  - **`nuxt`** – `test/nuxt/`, Nuxt environment via `@nuxt/test-utils`, for composables and components
94
130
 
131
+ 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, { … })`.
132
+
95
133
  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
134
 
97
135
  ### Route rendering strategy
package/README.md CHANGED
@@ -1,81 +1,180 @@
1
- # @shopbite-de/storefront
1
+ <div align="center">
2
2
 
3
- Shopware storefront for food delivery shops, built with Nuxt 4 and Vue 3.
3
+ # 🍕 ShopBite Storefront
4
4
 
5
- This is a Nuxt project based on [shopware/frontends](https://github.com/shopware/frontends) to provide a cutting-edge frontend store based on Shopware 6.
5
+ **A headless Shopware 6 storefront built for food delivery.**
6
6
 
7
- ## Features
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
- - Built with Nuxt 4 and Vue 3
10
- - Based on shopware/frontends
11
- - Integration with Shopware Store API (Shopware 6)
12
- - Tailwind CSS and Nuxt UI
13
- - PWA support
10
+ [![Nuxt](https://img.shields.io/badge/Nuxt-4-00DC82?logo=nuxt&logoColor=white)](https://nuxt.com)
11
+ [![Vue](https://img.shields.io/badge/Vue-3-4FC08D?logo=vue.js&logoColor=white)](https://vuejs.org)
12
+ [![Shopware](https://img.shields.io/badge/Shopware-6-189EFF?logo=shopware&logoColor=white)](https://www.shopware.com)
13
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org)
14
+ [![Tailwind CSS](https://img.shields.io/badge/Tailwind-v4-06B6D4?logo=tailwindcss&logoColor=white)](https://tailwindcss.com)
15
+ [![License: MIT](https://img.shields.io/badge/License-MIT-ff5b00)](./LICENSE)
14
16
 
15
- ## Prerequisites
17
+ <img src="./public/screenshot-desktop.png" alt="ShopBite storefront" width="820">
16
18
 
17
- - Node.js (latest LTS recommended)
18
- - pnpm 10+
19
- - [Shopbite Shopware Plugin](https://github.com/shopbite-de/shopware-plugin) (required to enable all features)
19
+ </div>
20
20
 
21
- ## Setup
21
+ ---
22
22
 
23
- Install the dependencies:
23
+ ## Why this exists
24
24
 
25
- ```bash
26
- pnpm install
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
- ## Development
33
+ ## Features
30
34
 
31
- Start the development server on `http://localhost:3000`:
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
- ## Production
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
- Build the application for production:
99
+ ## Scripts
40
100
 
41
101
  ```bash
42
- pnpm build
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
- Locally preview production build:
107
+ pnpm typecheck # nuxt typecheck — must stay at zero errors
108
+ pnpm lint:fix # Prettier + ESLint, autofix
46
109
 
47
- ```bash
48
- pnpm preview
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
- ## Testing
114
+ pnpm generate-types # Regenerate Store API types after plugin changes
115
+ ```
52
116
 
53
- Run unit tests:
117
+ Run a single test:
54
118
 
55
119
  ```bash
56
- pnpm test:unit
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
- Run E2E tests:
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
- ## Linting
144
+ Key ones worth knowing:
66
145
 
67
- Check code quality:
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
- pnpm eslint
155
+ docker compose up --build # → http://localhost:3000
156
+ ./container pnpm -v # run a command inside the container
71
157
  ```
72
158
 
73
- Fix linting issues:
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,9 @@
1
+ {
2
+ "$schema": "./node_modules/@shopware/api-gen/api-gen.schema.json",
3
+ "store-api": {
4
+ "patches": [
5
+ "./node_modules/@shopware/api-client/api-types/storeApiSchema.overrides.json",
6
+ "./api-types/storeApiSchema.shopbite.overrides.json"
7
+ ]
8
+ }
9
+ }
@@ -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
+ }