From 7d2fb0c73761f2907b46ef52a2b653fd8f1a1397 Mon Sep 17 00:00:00 2001 From: Danijel Date: Mon, 19 Jan 2026 20:21:14 +0100 Subject: [PATCH] chore: transfer repo --- .env.example | 7 + .gitea/workflows/deploy-staging.yml | 34 + .gitignore | 38 + .vscode/launch.json | 28 + .vscode/settings.json | 9 + Dockerfile | 61 + README.md | 74 + app/[page]/layout.tsx | 12 + app/[page]/opengraph-image.tsx | 11 + app/[page]/page.tsx | 45 + app/about/page.tsx | 11 + app/api/products/route.ts | 21 + app/api/revalidate/route.ts | 6 + app/build-box/customize/page.tsx | 10 + app/build-box/page.tsx | 11 + app/cart/page.tsx | 10 + app/error.tsx | 19 + app/favicon.ico | Bin 0 -> 15086 bytes app/fonts.css | 28 + app/globals.css | 153 + app/layout.tsx | 92 + app/opengraph-image.tsx | 8 + app/page.tsx | 20 + app/privacy-policy/page.tsx | 64 + app/product/[handle]/page.tsx | 122 + app/products/page.tsx | 11 + app/robots.ts | 15 + app/search/[collection]/opengraph-image.tsx | 11 + app/search/[collection]/page.tsx | 45 + app/search/children-wrapper.tsx | 10 + app/search/layout.tsx | 24 + app/search/loading.tsx | 18 + app/search/page.tsx | 38 + app/sitemap.ts | 54 + app/terms-of-service/page.tsx | 78 + app/test-boxes/page.tsx | 29 + components.json | 21 + components/Label.tsx | 34 + components/LoadingDots.tsx | 15 + components/about/AboutPageContent.tsx | 104 + components/build-box/AddBoxToCartClient.tsx | 173 + components/build-box/BuildBoxClientPage.tsx | 53 + .../build-box/BuildBoxCustomizeClient.tsx | 119 + .../build-box/BuildBoxCustomizePage.tsx | 21 + .../build-box/BuildBoxMobileSummary.tsx | 24 + components/build-box/BuildBoxPage.tsx | 12 + components/build-box/BuildBoxSidebar.tsx | 203 + components/build-box/ClientSidebarWrapper.tsx | 49 + components/build-box/RedirectIfEmptyBox.tsx | 24 + .../AddBoxToCartClientWithTranslation.tsx | 90 + ...BuildBoxCustomizeClientWithTranslation.tsx | 119 + .../client/BuildBoxCustomizePageContent.tsx | 47 + .../build-box/client/BuildBoxLayout.tsx | 113 + .../build-box/client/BuildBoxPageContent.tsx | 71 + .../client/BuildBoxSidebarWithTranslation.tsx | 210 + .../ClientSidebarWrapperWithTranslation.tsx | 56 + components/carousel.tsx | 40 + components/cart/CartBoxItem.tsx | 161 + components/cart/CartDiscountForm.tsx | 84 + components/cart/CartLink.tsx | 23 + components/cart/CartPage.tsx | 180 + components/cart/CartProductItem.tsx | 142 + components/cart/CartSummary.tsx | 64 + components/cart/EmptyCartMessage.tsx | 25 + components/cart/QuantityControls.tsx | 51 + components/cart/actions.ts | 251 ++ components/cart/add-to-cart.tsx | 115 + components/cart/cart-context.tsx | 217 + components/cart/hooks/useCartProcessing.ts | 100 + components/cart/processCartItems.tsx | 22 + components/cart/sections/BoxesSection.tsx | 34 + components/cart/sections/CartHeader.tsx | 20 + components/cart/sections/CartLoading.tsx | 18 + components/cart/sections/OrderNotes.tsx | 18 + components/cart/sections/ProductsSection.tsx | 34 + components/cookies/CookieBanner.tsx | 45 + components/cookies/CookieCategoryCard.tsx | 36 + components/cookies/CookieContext.tsx | 160 + components/cookies/CookieSettingsModal.tsx | 164 + components/cookies/ToggleSwitch.tsx | 27 + components/cookies/index.tsx | 17 + components/grid/index.tsx | 21 + components/grid/three-items.tsx | 61 + components/grid/tile.tsx | 42 + components/home/CardSection.tsx | 56 + components/home/CustomerReviews.tsx | 107 + components/home/GiftBoxBuilder.tsx | 73 + components/home/HeroCarousel.tsx | 184 + components/home/NewHomePage.tsx | 31 + components/home/ProductSlider.tsx | 107 + components/home/ProductSliderSection.tsx | 69 + components/home/ProductSliderWrapper.tsx | 25 + components/home/WoltDelivery.tsx | 90 + components/i18n/IntlProvider.tsx | 18 + components/i18n/LanguageSwitcher.tsx | 68 + components/icons/logo.tsx | 16 + components/layout/ProductGridItems.tsx | 32 + components/layout/categories.tsx | 59 + components/layout/footer.tsx | 120 + components/layout/navbar/index.tsx | 252 ++ components/layout/navbar/search.tsx | 40 + components/layout/search/collections.tsx | 37 + components/layout/search/filter/dropdown.tsx | 64 + components/layout/search/filter/index.tsx | 41 + components/layout/search/filter/item.tsx | 67 + components/logo-square.tsx | 23 + components/opengraph-image.tsx | 94 + components/price.tsx | 24 + components/product/BackButton.tsx | 33 + components/product/CollapsibleSection.tsx | 38 + components/product/ProductDescription.tsx | 47 + components/product/ProductDetailsSection.tsx | 36 + components/product/ProductGallery.tsx | 60 + components/product/ProductQuantity.tsx | 71 + components/product/VariantSelector.tsx | 93 + components/product/gallery.tsx | 92 + components/product/product-context.tsx | 81 + components/products/AddToBoxButton.tsx | 62 + components/products/FilterSidebar.tsx | 477 ++ .../ProductComponents/FilterButton.tsx | 25 + .../ProductComponents/FilterTagList.tsx | 52 + .../ProductComponents/ProductCounter.tsx | 13 + .../ProductComponents/ProductsList.tsx | 29 + .../ProductComponents/SortDropdown.tsx | 25 + components/products/ProductGrid.tsx | 77 + components/products/ProductsPage.tsx | 11 + components/products/client/ProductCounter.tsx | 17 + .../client/ProductGridWithTranslation.tsx | 75 + .../products/client/ProductsPageContent.tsx | 31 + components/products/client/SortDropdown.tsx | 117 + .../products/hooks/useProductFilters.ts | 69 + components/products/utils/colorUtils.ts | 81 + components/products/utils/productHelpers.ts | 177 + components/prose.tsx | 15 + components/ui/AddToCartButton.tsx | 77 + components/ui/Button.tsx | 74 + components/ui/Card.tsx | 76 + components/ui/Carousel.tsx | 83 + components/ui/Checkbox.tsx | 93 + components/ui/ColorSelector.tsx | 62 + components/ui/ContactForm.tsx | 202 + components/ui/CustomCard.tsx | 39 + components/ui/Newsletter.tsx | 124 + components/ui/ProductCard.tsx | 157 + components/ui/RadioButton.tsx | 86 + components/ui/Section.tsx | 45 + components/ui/SectionHeader.tsx | 26 + components/ui/StarRating.tsx | 40 + components/ui/Typography.tsx | 182 + docker-compose.yml | 21 + lib/constants.ts | 31 + lib/hooks/useTranslation.ts | 65 + lib/i18n/pathnames.ts | 53 + lib/redux/hooks.ts | 6 + lib/redux/provider.tsx | 15 + lib/redux/slices/boxSlice.ts | 234 + lib/redux/store.ts | 11 + lib/shopify/fragments/cart.ts | 57 + lib/shopify/fragments/image.ts | 10 + lib/shopify/fragments/product.ts | 69 + lib/shopify/fragments/seo.ts | 8 + lib/shopify/index.ts | 495 +++ lib/shopify/mutations/cart.ts | 45 + lib/shopify/queries/cart.ts | 10 + lib/shopify/queries/collection.ts | 56 + lib/shopify/queries/menu.ts | 10 + lib/shopify/queries/page.ts | 41 + lib/shopify/queries/product.ts | 32 + lib/shopify/types.ts | 287 ++ lib/type-guards.ts | 27 + lib/types/carousel.ts | 10 + lib/utils.ts | 60 + license.md | 21 + messages/en.json | 209 + messages/hr.json | 209 + middleware.ts | 40 + next.config.ts | 32 + package-lock.json | 3927 +++++++++++++++++ package.json | 49 + pnpm-lock.yaml | 1786 ++++++++ postcss.config.mjs | 7 + prettier.config.js | 9 + public/assets/images/Facebook.png | Bin 0 -> 959 bytes public/assets/images/Frame3.png | Bin 0 -> 4152 bytes public/assets/images/Frame4.png | Bin 0 -> 4359 bytes public/assets/images/Frame5.png | Bin 0 -> 4465 bytes public/assets/images/Frame6.png | Bin 0 -> 4152 bytes public/assets/images/Instagram.png | Bin 0 -> 981 bytes public/assets/images/build-box.png | Bin 0 -> 828957 bytes public/assets/images/builder.png | Bin 0 -> 404660 bytes public/assets/images/builder1.png | Bin 0 -> 416289 bytes public/assets/images/card1.png | Bin 0 -> 273167 bytes public/assets/images/card2.png | Bin 0 -> 243066 bytes public/assets/images/card3.png | Bin 0 -> 105710 bytes public/assets/images/carousel1.png | Bin 0 -> 631768 bytes public/assets/images/carousel2.png | Bin 0 -> 492397 bytes public/assets/images/cart-icon-black.png | Bin 0 -> 541 bytes public/assets/images/cart-icon.png | Bin 0 -> 396 bytes public/assets/images/image1.png | Bin 0 -> 540250 bytes public/assets/images/image11.png | Bin 0 -> 1484532 bytes public/assets/images/image2.webp | Bin 0 -> 112270 bytes public/assets/images/image22.png | Bin 0 -> 1449718 bytes public/assets/images/image3.webp | Bin 0 -> 256114 bytes public/assets/images/logo.svg | 7 + public/assets/images/placeholder_image.svg | 9 + public/assets/images/wolt-image.png | Bin 0 -> 412798 bytes public/assets/images/wolt.jpeg | Bin 0 -> 8006 bytes public/assets/images/wolt.png | Bin 0 -> 15764 bytes public/fonts/Poppins-Regular.ttf | Bin 0 -> 158240 bytes public/fonts/Poppins-SemiBold.ttf | Bin 0 -> 155232 bytes .../fonts/allenoire-allenoire-regular-400.ttf | Bin 0 -> 234468 bytes tailwind.config.ts | 172 + tsconfig.json | 31 + 213 files changed, 18085 insertions(+) create mode 100644 .env.example create mode 100644 .gitea/workflows/deploy-staging.yml create mode 100644 .gitignore create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 app/[page]/layout.tsx create mode 100644 app/[page]/opengraph-image.tsx create mode 100644 app/[page]/page.tsx create mode 100644 app/about/page.tsx create mode 100644 app/api/products/route.ts create mode 100644 app/api/revalidate/route.ts create mode 100644 app/build-box/customize/page.tsx create mode 100644 app/build-box/page.tsx create mode 100644 app/cart/page.tsx create mode 100644 app/error.tsx create mode 100644 app/favicon.ico create mode 100644 app/fonts.css create mode 100644 app/globals.css create mode 100644 app/layout.tsx create mode 100644 app/opengraph-image.tsx create mode 100644 app/page.tsx create mode 100644 app/privacy-policy/page.tsx create mode 100644 app/product/[handle]/page.tsx create mode 100644 app/products/page.tsx create mode 100644 app/robots.ts create mode 100644 app/search/[collection]/opengraph-image.tsx create mode 100644 app/search/[collection]/page.tsx create mode 100644 app/search/children-wrapper.tsx create mode 100644 app/search/layout.tsx create mode 100644 app/search/loading.tsx create mode 100644 app/search/page.tsx create mode 100644 app/sitemap.ts create mode 100644 app/terms-of-service/page.tsx create mode 100644 app/test-boxes/page.tsx create mode 100644 components.json create mode 100644 components/Label.tsx create mode 100644 components/LoadingDots.tsx create mode 100644 components/about/AboutPageContent.tsx create mode 100644 components/build-box/AddBoxToCartClient.tsx create mode 100644 components/build-box/BuildBoxClientPage.tsx create mode 100644 components/build-box/BuildBoxCustomizeClient.tsx create mode 100644 components/build-box/BuildBoxCustomizePage.tsx create mode 100644 components/build-box/BuildBoxMobileSummary.tsx create mode 100644 components/build-box/BuildBoxPage.tsx create mode 100644 components/build-box/BuildBoxSidebar.tsx create mode 100644 components/build-box/ClientSidebarWrapper.tsx create mode 100644 components/build-box/RedirectIfEmptyBox.tsx create mode 100644 components/build-box/client/AddBoxToCartClientWithTranslation.tsx create mode 100644 components/build-box/client/BuildBoxCustomizeClientWithTranslation.tsx create mode 100644 components/build-box/client/BuildBoxCustomizePageContent.tsx create mode 100644 components/build-box/client/BuildBoxLayout.tsx create mode 100644 components/build-box/client/BuildBoxPageContent.tsx create mode 100644 components/build-box/client/BuildBoxSidebarWithTranslation.tsx create mode 100644 components/build-box/client/ClientSidebarWrapperWithTranslation.tsx create mode 100644 components/carousel.tsx create mode 100644 components/cart/CartBoxItem.tsx create mode 100644 components/cart/CartDiscountForm.tsx create mode 100644 components/cart/CartLink.tsx create mode 100644 components/cart/CartPage.tsx create mode 100644 components/cart/CartProductItem.tsx create mode 100644 components/cart/CartSummary.tsx create mode 100644 components/cart/EmptyCartMessage.tsx create mode 100644 components/cart/QuantityControls.tsx create mode 100644 components/cart/actions.ts create mode 100644 components/cart/add-to-cart.tsx create mode 100644 components/cart/cart-context.tsx create mode 100644 components/cart/hooks/useCartProcessing.ts create mode 100644 components/cart/processCartItems.tsx create mode 100644 components/cart/sections/BoxesSection.tsx create mode 100644 components/cart/sections/CartHeader.tsx create mode 100644 components/cart/sections/CartLoading.tsx create mode 100644 components/cart/sections/OrderNotes.tsx create mode 100644 components/cart/sections/ProductsSection.tsx create mode 100644 components/cookies/CookieBanner.tsx create mode 100644 components/cookies/CookieCategoryCard.tsx create mode 100644 components/cookies/CookieContext.tsx create mode 100644 components/cookies/CookieSettingsModal.tsx create mode 100644 components/cookies/ToggleSwitch.tsx create mode 100644 components/cookies/index.tsx create mode 100644 components/grid/index.tsx create mode 100644 components/grid/three-items.tsx create mode 100644 components/grid/tile.tsx create mode 100644 components/home/CardSection.tsx create mode 100644 components/home/CustomerReviews.tsx create mode 100644 components/home/GiftBoxBuilder.tsx create mode 100644 components/home/HeroCarousel.tsx create mode 100644 components/home/NewHomePage.tsx create mode 100644 components/home/ProductSlider.tsx create mode 100644 components/home/ProductSliderSection.tsx create mode 100644 components/home/ProductSliderWrapper.tsx create mode 100644 components/home/WoltDelivery.tsx create mode 100644 components/i18n/IntlProvider.tsx create mode 100644 components/i18n/LanguageSwitcher.tsx create mode 100644 components/icons/logo.tsx create mode 100644 components/layout/ProductGridItems.tsx create mode 100644 components/layout/categories.tsx create mode 100644 components/layout/footer.tsx create mode 100644 components/layout/navbar/index.tsx create mode 100644 components/layout/navbar/search.tsx create mode 100644 components/layout/search/collections.tsx create mode 100644 components/layout/search/filter/dropdown.tsx create mode 100644 components/layout/search/filter/index.tsx create mode 100644 components/layout/search/filter/item.tsx create mode 100644 components/logo-square.tsx create mode 100644 components/opengraph-image.tsx create mode 100644 components/price.tsx create mode 100644 components/product/BackButton.tsx create mode 100644 components/product/CollapsibleSection.tsx create mode 100644 components/product/ProductDescription.tsx create mode 100644 components/product/ProductDetailsSection.tsx create mode 100644 components/product/ProductGallery.tsx create mode 100644 components/product/ProductQuantity.tsx create mode 100644 components/product/VariantSelector.tsx create mode 100644 components/product/gallery.tsx create mode 100644 components/product/product-context.tsx create mode 100644 components/products/AddToBoxButton.tsx create mode 100644 components/products/FilterSidebar.tsx create mode 100644 components/products/ProductComponents/FilterButton.tsx create mode 100644 components/products/ProductComponents/FilterTagList.tsx create mode 100644 components/products/ProductComponents/ProductCounter.tsx create mode 100644 components/products/ProductComponents/ProductsList.tsx create mode 100644 components/products/ProductComponents/SortDropdown.tsx create mode 100644 components/products/ProductGrid.tsx create mode 100644 components/products/ProductsPage.tsx create mode 100644 components/products/client/ProductCounter.tsx create mode 100644 components/products/client/ProductGridWithTranslation.tsx create mode 100644 components/products/client/ProductsPageContent.tsx create mode 100644 components/products/client/SortDropdown.tsx create mode 100644 components/products/hooks/useProductFilters.ts create mode 100644 components/products/utils/colorUtils.ts create mode 100644 components/products/utils/productHelpers.ts create mode 100644 components/prose.tsx create mode 100644 components/ui/AddToCartButton.tsx create mode 100644 components/ui/Button.tsx create mode 100644 components/ui/Card.tsx create mode 100644 components/ui/Carousel.tsx create mode 100644 components/ui/Checkbox.tsx create mode 100644 components/ui/ColorSelector.tsx create mode 100644 components/ui/ContactForm.tsx create mode 100644 components/ui/CustomCard.tsx create mode 100644 components/ui/Newsletter.tsx create mode 100644 components/ui/ProductCard.tsx create mode 100644 components/ui/RadioButton.tsx create mode 100644 components/ui/Section.tsx create mode 100644 components/ui/SectionHeader.tsx create mode 100644 components/ui/StarRating.tsx create mode 100644 components/ui/Typography.tsx create mode 100644 docker-compose.yml create mode 100644 lib/constants.ts create mode 100644 lib/hooks/useTranslation.ts create mode 100644 lib/i18n/pathnames.ts create mode 100644 lib/redux/hooks.ts create mode 100644 lib/redux/provider.tsx create mode 100644 lib/redux/slices/boxSlice.ts create mode 100644 lib/redux/store.ts create mode 100644 lib/shopify/fragments/cart.ts create mode 100644 lib/shopify/fragments/image.ts create mode 100644 lib/shopify/fragments/product.ts create mode 100644 lib/shopify/fragments/seo.ts create mode 100644 lib/shopify/index.ts create mode 100644 lib/shopify/mutations/cart.ts create mode 100644 lib/shopify/queries/cart.ts create mode 100644 lib/shopify/queries/collection.ts create mode 100644 lib/shopify/queries/menu.ts create mode 100644 lib/shopify/queries/page.ts create mode 100644 lib/shopify/queries/product.ts create mode 100644 lib/shopify/types.ts create mode 100644 lib/type-guards.ts create mode 100644 lib/types/carousel.ts create mode 100644 lib/utils.ts create mode 100644 license.md create mode 100644 messages/en.json create mode 100644 messages/hr.json create mode 100644 middleware.ts create mode 100644 next.config.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 postcss.config.mjs create mode 100644 prettier.config.js create mode 100644 public/assets/images/Facebook.png create mode 100644 public/assets/images/Frame3.png create mode 100644 public/assets/images/Frame4.png create mode 100644 public/assets/images/Frame5.png create mode 100644 public/assets/images/Frame6.png create mode 100644 public/assets/images/Instagram.png create mode 100644 public/assets/images/build-box.png create mode 100644 public/assets/images/builder.png create mode 100644 public/assets/images/builder1.png create mode 100644 public/assets/images/card1.png create mode 100644 public/assets/images/card2.png create mode 100644 public/assets/images/card3.png create mode 100644 public/assets/images/carousel1.png create mode 100644 public/assets/images/carousel2.png create mode 100644 public/assets/images/cart-icon-black.png create mode 100644 public/assets/images/cart-icon.png create mode 100644 public/assets/images/image1.png create mode 100644 public/assets/images/image11.png create mode 100644 public/assets/images/image2.webp create mode 100644 public/assets/images/image22.png create mode 100644 public/assets/images/image3.webp create mode 100644 public/assets/images/logo.svg create mode 100644 public/assets/images/placeholder_image.svg create mode 100644 public/assets/images/wolt-image.png create mode 100644 public/assets/images/wolt.jpeg create mode 100644 public/assets/images/wolt.png create mode 100644 public/fonts/Poppins-Regular.ttf create mode 100644 public/fonts/Poppins-SemiBold.ttf create mode 100644 public/fonts/allenoire-allenoire-regular-400.ttf create mode 100644 tailwind.config.ts create mode 100644 tsconfig.json diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..9ff0463 --- /dev/null +++ b/.env.example @@ -0,0 +1,7 @@ +COMPANY_NAME="Vercel Inc." +TWITTER_CREATOR="@vercel" +TWITTER_SITE="https://nextjs.org/commerce" +SITE_NAME="Next.js Commerce" +SHOPIFY_REVALIDATION_SECRET="" +SHOPIFY_STOREFRONT_ACCESS_TOKEN="" +SHOPIFY_STORE_DOMAIN="[your-shopify-store-subdomain].myshopify.com" diff --git a/.gitea/workflows/deploy-staging.yml b/.gitea/workflows/deploy-staging.yml new file mode 100644 index 0000000..1d5b118 --- /dev/null +++ b/.gitea/workflows/deploy-staging.yml @@ -0,0 +1,34 @@ +name: Build and Deploy +on: workflow_dispatch + +inputs: + user_version: + description: 'Custom version (e.g., 1.2.3)' + required: true + default: '1.0.0' + +jobs: + deploy: + runs-on: sent-shop-vps + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Calculate version + id: version + run: | + SHORT_SHA=$(git rev-parse --short=7 HEAD) + APP_VERSION=${{ inputs.user_version }}-${SHORT_SHA} + echo "Using version: ${APP_VERSION}" + + - name: Build and deploy + env: + COMPOSE_PROJECT_NAME: sent-shop # Unique identifier, must be kept not to overwrite other composes. + APP_VERSION: ${{ env.APP_VERSION }} + SHOPIFY_REVALIDATION_SECRET: ${{ secrets.SHOPIFY_REVALIDATION_SECRET }} + SHOPIFY_STOREFRONT_ACCESS_TOKEN: ${{ secrets.SHOPIFY_STOREFRONT_ACCESS_TOKEN }} + run: | + docker-compose build + docker-compose down + docker-compose up -d + echo "New version is up and running \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0298027 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage +.playwright + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env* +!.env.example + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..448434d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Next.js: debug server-side", + "type": "node-terminal", + "request": "launch", + "command": "pnpm dev" + }, + { + "name": "Next.js: debug client-side", + "type": "chrome", + "request": "launch", + "url": "http://localhost:3000" + }, + { + "name": "Next.js: debug full stack", + "type": "node-terminal", + "request": "launch", + "command": "pnpm dev", + "serverReadyAction": { + "pattern": "started server on .+, url: (https?://.+)", + "uriFormat": "%s", + "action": "debugWithChrome" + } + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8345c10 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.organizeImports": "explicit", + "source.sortMembers": "explicit" + } +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5df18d1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,61 @@ +# syntax = docker/dockerfile:1 + +FROM node:22-slim AS base + +ARG PORT=3005 +ARG COMPANY_NAME +ARG TWITTER_CREATOR +ARG TWITTER_SITE +ARG SITE_NAME +ARG SHOPIFY_REVALIDATION_SECRET +ARG SHOPIFY_STOREFRONT_ACCESS_TOKEN +ARG SHOPIFY_STORE_DOMAIN + +ENV PORT=${PORT} +ENV COMPANY_NAME=${COMPANY_NAME} +ENV TWITTER_CREATOR=${TWITTER_CREATOR} +ENV TWITTER_SITE=${TWITTER_SITE} +ENV SITE_NAME=${SITE_NAME} +ENV SHOPIFY_REVALIDATION_SECRET=${SHOPIFY_REVALIDATION_SECRET} +ENV SHOPIFY_STOREFRONT_ACCESS_TOKEN=${SHOPIFY_STOREFRONT_ACCESS_TOKEN} +ENV SHOPIFY_STORE_DOMAIN=${SHOPIFY_STORE_DOMAIN} +ENV NEXT_TELEMETRY_DISABLED=1 + +WORKDIR /app + +# Dependencies +FROM base AS dependencies + +COPY package.json package-lock.json ./ +RUN npm ci + +# Build +FROM base AS build + +COPY --from=dependencies /app/node_modules ./node_modules +COPY . . + +#Should be set to npm run build. +RUN npm run build + +# Run +FROM base AS run + +ENV NODE_ENV=production +ENV PORT=$PORT + +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs +RUN mkdir .next +RUN chown nextjs:nodejs .next + +COPY --from=build /app/public ./public +COPY --from=build --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=build --chown=nextjs:nodejs /app/.next/static ./.next/static + +USER nextjs + +EXPOSE $PORT + +ENV HOSTNAME="0.0.0.0" +CMD ["node", "server.js"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..ccb4861 --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fcommerce&project-name=commerce&repo-name=commerce&demo-title=Next.js%20Commerce&demo-url=https%3A%2F%2Fdemo.vercel.store&demo-image=https%3A%2F%2Fbigcommerce-demo-asset-ksvtgfvnd.vercel.app%2Fbigcommerce.png&env=COMPANY_NAME,SHOPIFY_REVALIDATION_SECRET,SHOPIFY_STORE_DOMAIN,SHOPIFY_STOREFRONT_ACCESS_TOKEN,SITE_NAME,TWITTER_CREATOR,TWITTER_SITE) + +# Next.js Commerce + +A high-performance, server-rendered Next.js App Router ecommerce application. + +This template uses React Server Components, Server Actions, `Suspense`, `useOptimistic`, and more. + +

+ +> Note: Looking for Next.js Commerce v1? View the [code](https://github.com/vercel/commerce/tree/v1), [demo](https://commerce-v1.vercel.store), and [release notes](https://github.com/vercel/commerce/releases/tag/v1). + +## Providers + +Vercel will only be actively maintaining a Shopify version [as outlined in our vision and strategy for Next.js Commerce](https://github.com/vercel/commerce/pull/966). + +Vercel is happy to partner and work with any commerce provider to help them get a similar template up and running and listed below. Alternative providers should be able to fork this repository and swap out the `lib/shopify` file with their own implementation while leaving the rest of the template mostly unchanged. + +- Shopify (this repository) +- [BigCommerce](https://github.com/bigcommerce/nextjs-commerce) ([Demo](https://next-commerce-v2.vercel.app/)) +- [Ecwid by Lightspeed](https://github.com/Ecwid/ecwid-nextjs-commerce/) ([Demo](https://ecwid-nextjs-commerce.vercel.app/)) +- [Geins](https://github.com/geins-io/vercel-nextjs-commerce) ([Demo](https://geins-nextjs-commerce-starter.vercel.app/)) +- [Medusa](https://github.com/medusajs/vercel-commerce) ([Demo](https://medusa-nextjs-commerce.vercel.app/)) +- [Saleor](https://github.com/saleor/nextjs-commerce) ([Demo](https://saleor-commerce.vercel.app/)) +- [Shopware](https://github.com/shopwareLabs/vercel-commerce) ([Demo](https://shopware-vercel-commerce-react.vercel.app/)) +- [Swell](https://github.com/swellstores/verswell-commerce) ([Demo](https://verswell-commerce.vercel.app/)) +- [Umbraco](https://github.com/umbraco/Umbraco.VercelCommerce.Demo) ([Demo](https://vercel-commerce-demo.umbraco.com/)) +- [Wix](https://github.com/wix/nextjs-commerce) ([Demo](https://wix-nextjs-commerce.vercel.app/)) +- [Fourthwall](https://github.com/FourthwallHQ/vercel-commerce) ([Demo](https://vercel-storefront.fourthwall.app/)) + +> Note: Providers, if you are looking to use similar products for your demo, you can [download these assets](https://drive.google.com/file/d/1q_bKerjrwZgHwCw0ovfUMW6He9VtepO_/view?usp=sharing). + +## Integrations + +Integrations enable upgraded or additional functionality for Next.js Commerce + +- [Orama](https://github.com/oramasearch/nextjs-commerce) ([Demo](https://vercel-commerce.oramasearch.com/)) + + - Upgrades search to include typeahead with dynamic re-rendering, vector-based similarity search, and JS-based configuration. + - Search runs entirely in the browser for smaller catalogs or on a CDN for larger. + +- [React Bricks](https://github.com/ReactBricks/nextjs-commerce-rb) ([Demo](https://nextjs-commerce.reactbricks.com/)) + - Edit pages, product details, and footer content visually using [React Bricks](https://www.reactbricks.com) visual headless CMS. + +## Running locally + +You will need to use the environment variables [defined in `.env.example`](.env.example) to run Next.js Commerce. It's recommended you use [Vercel Environment Variables](https://vercel.com/docs/concepts/projects/environment-variables) for this, but a `.env` file is all that is necessary. + +> Note: You should not commit your `.env` file or it will expose secrets that will allow others to control your Shopify store. + +1. Install Vercel CLI: `npm i -g vercel` +2. Link local instance with Vercel and GitHub accounts (creates `.vercel` directory): `vercel link` +3. Download your environment variables: `vercel env pull` + +```bash +pnpm install +pnpm dev +``` + +Your app should now be running on [localhost:3000](http://localhost:3000/). + +
+ Expand if you work at Vercel and want to run locally and / or contribute + +1. Run `vc link`. +1. Select the `Vercel Solutions` scope. +1. Connect to the existing `commerce-shopify` project. +1. Run `vc env pull` to get environment variables. +1. Run `pnpm dev` to ensure everything is working correctly. +
+ +## Vercel, Next.js Commerce, and Shopify Integration Guide + +You can use this comprehensive [integration guide](https://vercel.com/docs/integrations/ecommerce/shopify) with step-by-step instructions on how to configure Shopify as a headless CMS using Next.js Commerce as your headless Shopify storefront on Vercel. diff --git a/app/[page]/layout.tsx b/app/[page]/layout.tsx new file mode 100644 index 0000000..b99b0bc --- /dev/null +++ b/app/[page]/layout.tsx @@ -0,0 +1,12 @@ +import { Footer } from 'components/layout/footer'; + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> +
+
{children}
+
+