From 5af349316e42cfd89008c173ce57e615f7bf2788 Mon Sep 17 00:00:00 2001 From: tusuii Date: Wed, 25 Feb 2026 00:49:09 +0530 Subject: [PATCH] added frontend for k8s changes in k8s and comp and pages and dockerfile --- Dockerfile | 4 ++++ k8s/service.yaml | 3 ++- nginx.conf | 1 + src/components/home/Category/CategoryCard.jsx | 2 +- src/components/home/MostLoved/MostLovedCard.jsx | 2 +- src/components/home/NewGems/NewArrivalCard.jsx | 2 +- .../home/RecommendedForYou/RecommendedForYou.jsx | 2 +- src/components/recentlyViewed/RecentlyViewed.jsx | 2 +- src/pages/Trending/Trending.jsx | 2 +- src/pages/Trending/TrendingCard.jsx | 2 +- src/pages/Trending/TrendingCircleRow.jsx | 8 ++++---- src/pages/Trending/TrendingSmallGrid.jsx | 8 ++++---- 12 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 712442c..5fa94c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,10 @@ FROM node:20-alpine AS builder WORKDIR /app +# Accept build arguments +ARG VITE_API_BASE_URL +ENV VITE_API_BASE_URL=$VITE_API_BASE_URL + # Install dependencies first (layer-cache friendly) COPY package.json package-lock.json ./ RUN npm ci --frozen-lockfile diff --git a/k8s/service.yaml b/k8s/service.yaml index 8718130..43c89f8 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -13,4 +13,5 @@ spec: protocol: TCP port: 80 targetPort: 80 - type: ClusterIP + nodePort: 30081 + type: NodePort diff --git a/nginx.conf b/nginx.conf index 97d889f..04cac65 100644 --- a/nginx.conf +++ b/nginx.conf @@ -14,6 +14,7 @@ server { location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|avif|webp|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public, immutable"; + access_log off; try_files $uri =404; } diff --git a/src/components/home/Category/CategoryCard.jsx b/src/components/home/Category/CategoryCard.jsx index cee6c4b..aef7243 100644 --- a/src/components/home/Category/CategoryCard.jsx +++ b/src/components/home/Category/CategoryCard.jsx @@ -15,7 +15,7 @@ const CategoryCard = ({ category }) => { {/* Image */} {category.name} diff --git a/src/components/home/MostLoved/MostLovedCard.jsx b/src/components/home/MostLoved/MostLovedCard.jsx index 671c6ed..ff31a90 100644 --- a/src/components/home/MostLoved/MostLovedCard.jsx +++ b/src/components/home/MostLoved/MostLovedCard.jsx @@ -91,7 +91,7 @@ const MostLovedCard = ({ product }) => { const image = product?.images?.gallery?.[0] || product?.images?.primary || - "/placeholder-product.png"; + "/default-product.png"; const hasOffer = product?.compareAtPrice && diff --git a/src/components/home/NewGems/NewArrivalCard.jsx b/src/components/home/NewGems/NewArrivalCard.jsx index 5cbbd45..d3093b4 100644 --- a/src/components/home/NewGems/NewArrivalCard.jsx +++ b/src/components/home/NewGems/NewArrivalCard.jsx @@ -102,7 +102,7 @@ const NewArrivalCard = ({ product }) => { product?.variants?.[0]?.images?.[0] || product?.images?.gallery?.[0] || product?.images?.primary || - "/placeholder-product.png"; + "/default-product.png"; const price = product?.variants?.[0]?.price || product?.basePrice; diff --git a/src/components/home/RecommendedForYou/RecommendedForYou.jsx b/src/components/home/RecommendedForYou/RecommendedForYou.jsx index b407386..e15dc7f 100644 --- a/src/components/home/RecommendedForYou/RecommendedForYou.jsx +++ b/src/components/home/RecommendedForYou/RecommendedForYou.jsx @@ -129,7 +129,7 @@ const RecommendedForYou = ({ limit = 10 }) => { src={ product.images?.primary || product.images?.gallery?.[0] || - "/placeholder.jpg" + "/default-product.png" } alt={product.name} className="w-full h-full object-cover diff --git a/src/components/recentlyViewed/RecentlyViewed.jsx b/src/components/recentlyViewed/RecentlyViewed.jsx index c4122d9..1f18672 100644 --- a/src/components/recentlyViewed/RecentlyViewed.jsx +++ b/src/components/recentlyViewed/RecentlyViewed.jsx @@ -109,7 +109,7 @@ const RecentlyViewedCard = ({ product, wishlistIds, handleWishlist }) => { {/* Image */}
{product.name} { {/* Mini Banner */} - + {/* Trending Circle Row */} diff --git a/src/pages/Trending/TrendingCard.jsx b/src/pages/Trending/TrendingCard.jsx index 191f825..b410d27 100644 --- a/src/pages/Trending/TrendingCard.jsx +++ b/src/pages/Trending/TrendingCard.jsx @@ -40,7 +40,7 @@ const TrendingCard = ({ title, img, href }) => { {/* Image */} {title} diff --git a/src/pages/Trending/TrendingCircleRow.jsx b/src/pages/Trending/TrendingCircleRow.jsx index 860cbe1..42be938 100644 --- a/src/pages/Trending/TrendingCircleRow.jsx +++ b/src/pages/Trending/TrendingCircleRow.jsx @@ -1,10 +1,10 @@ import TrendingCircle from "./TrendingCircle"; const data = [ - { title: "Sarees", img: "/hero1.jpg", href: "/sarees" }, - { title: "Lehengas", img: "/hero2.jpg", href: "/lehenga" }, - { title: "Kurtas", img: "/hero3.jpg", href: "/kurtas" }, - { title: "Patola", img: "/hero1.jpg", href: "/patola" }, + { title: "Sarees", img: "/hero1.png", href: "/sarees" }, + { title: "Lehengas", img: "/hero2.png", href: "/lehenga" }, + { title: "Kurtas", img: "/hero3.png", href: "/kurtas" }, + { title: "Patola", img: "/hero1.png", href: "/patola" }, ]; const TrendingCircleRow = () => { diff --git a/src/pages/Trending/TrendingSmallGrid.jsx b/src/pages/Trending/TrendingSmallGrid.jsx index c08e443..d3dddd5 100644 --- a/src/pages/Trending/TrendingSmallGrid.jsx +++ b/src/pages/Trending/TrendingSmallGrid.jsx @@ -31,10 +31,10 @@ import TrendingCard from "./TrendingCard"; const smallTrendingData = [ - { title: "Sarees", img: "/hero1.jpg", href: "/sarees" }, - { title: "Lehengas", img: "/hero2.jpg", href: "/lehenga" }, - { title: "Kurtas", img: "/hero3.jpg", href: "/kurtas" }, - { title: "Patola", img: "/hero1.jpg", href: "/patola" }, + { title: "Sarees", img: "/hero1.png", href: "/sarees" }, + { title: "Lehengas", img: "/hero2.png", href: "/lehenga" }, + { title: "Kurtas", img: "/hero3.png", href: "/kurtas" }, + { title: "Patola", img: "/hero1.png", href: "/patola" }, ]; const TrendingSmallGrid = () => {