added frontend for k8s changes in k8s and comp and pages and dockerfile

This commit is contained in:
tusuii
2026-02-25 00:49:09 +05:30
parent ed87721301
commit 5af349316e
12 changed files with 22 additions and 16 deletions

View File

@@ -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

View File

@@ -13,4 +13,5 @@ spec:
protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
nodePort: 30081
type: NodePort

View File

@@ -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;
}

View File

@@ -15,7 +15,7 @@ const CategoryCard = ({ category }) => {
{/* Image */}
<img
src={category.image}
src={category.image || "/default-product.png"}
alt={category.name}
className="h-full w-full object-cover transition-transform duration-700 group-hover:scale-110"
/>

View File

@@ -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 &&

View File

@@ -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;

View File

@@ -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

View File

@@ -109,7 +109,7 @@ const RecentlyViewedCard = ({ product, wishlistIds, handleWishlist }) => {
{/* Image */}
<div className="relative bg-gray-50 overflow-hidden aspect-[3/4]">
<img
src={product.image || "/placeholder-product.png"}
src={product.image || "/default-product.png"}
alt={product.name}
className="w-full h-full object-cover object-top group-hover:scale-105 transition-transform duration-500"
loading="lazy"

View File

@@ -11,7 +11,7 @@ const Trending = () => {
<TrendingChips />
{/* Mini Banner */}
<MiniBanner title="New Arrivals" img="/hero1.jpg" href="/new-arrivals" />
<MiniBanner title="New Arrivals" img="/hero1.png" href="/new-arrivals" />
{/* Trending Circle Row */}
<TrendingCircleRow />

View File

@@ -40,7 +40,7 @@ const TrendingCard = ({ title, img, href }) => {
<Link to={href}>
{/* Image */}
<img
src={img}
src={img || "/default-product.png"}
alt={title}
className="w-full h-44 md:h-52 object-cover transition-transform duration-500 hover:scale-105"
/>

View File

@@ -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 = () => {

View File

@@ -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 = () => {