added frontend for k8s changes in k8s and comp and pages and dockerfile
This commit is contained in:
@@ -3,6 +3,10 @@ FROM node:20-alpine AS builder
|
|||||||
|
|
||||||
WORKDIR /app
|
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)
|
# Install dependencies first (layer-cache friendly)
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci --frozen-lockfile
|
RUN npm ci --frozen-lockfile
|
||||||
|
|||||||
@@ -13,4 +13,5 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 80
|
targetPort: 80
|
||||||
type: ClusterIP
|
nodePort: 30081
|
||||||
|
type: NodePort
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ server {
|
|||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|avif|webp|woff|woff2|ttf|eot)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|avif|webp|woff|woff2|ttf|eot)$ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
|
access_log off;
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const CategoryCard = ({ category }) => {
|
|||||||
|
|
||||||
{/* Image */}
|
{/* Image */}
|
||||||
<img
|
<img
|
||||||
src={category.image}
|
src={category.image || "/default-product.png"}
|
||||||
alt={category.name}
|
alt={category.name}
|
||||||
className="h-full w-full object-cover transition-transform duration-700 group-hover:scale-110"
|
className="h-full w-full object-cover transition-transform duration-700 group-hover:scale-110"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ const MostLovedCard = ({ product }) => {
|
|||||||
const image =
|
const image =
|
||||||
product?.images?.gallery?.[0] ||
|
product?.images?.gallery?.[0] ||
|
||||||
product?.images?.primary ||
|
product?.images?.primary ||
|
||||||
"/placeholder-product.png";
|
"/default-product.png";
|
||||||
|
|
||||||
const hasOffer =
|
const hasOffer =
|
||||||
product?.compareAtPrice &&
|
product?.compareAtPrice &&
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const NewArrivalCard = ({ product }) => {
|
|||||||
product?.variants?.[0]?.images?.[0] ||
|
product?.variants?.[0]?.images?.[0] ||
|
||||||
product?.images?.gallery?.[0] ||
|
product?.images?.gallery?.[0] ||
|
||||||
product?.images?.primary ||
|
product?.images?.primary ||
|
||||||
"/placeholder-product.png";
|
"/default-product.png";
|
||||||
|
|
||||||
const price = product?.variants?.[0]?.price || product?.basePrice;
|
const price = product?.variants?.[0]?.price || product?.basePrice;
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ const RecommendedForYou = ({ limit = 10 }) => {
|
|||||||
src={
|
src={
|
||||||
product.images?.primary ||
|
product.images?.primary ||
|
||||||
product.images?.gallery?.[0] ||
|
product.images?.gallery?.[0] ||
|
||||||
"/placeholder.jpg"
|
"/default-product.png"
|
||||||
}
|
}
|
||||||
alt={product.name}
|
alt={product.name}
|
||||||
className="w-full h-full object-cover
|
className="w-full h-full object-cover
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ const RecentlyViewedCard = ({ product, wishlistIds, handleWishlist }) => {
|
|||||||
{/* Image */}
|
{/* Image */}
|
||||||
<div className="relative bg-gray-50 overflow-hidden aspect-[3/4]">
|
<div className="relative bg-gray-50 overflow-hidden aspect-[3/4]">
|
||||||
<img
|
<img
|
||||||
src={product.image || "/placeholder-product.png"}
|
src={product.image || "/default-product.png"}
|
||||||
alt={product.name}
|
alt={product.name}
|
||||||
className="w-full h-full object-cover object-top group-hover:scale-105 transition-transform duration-500"
|
className="w-full h-full object-cover object-top group-hover:scale-105 transition-transform duration-500"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const Trending = () => {
|
|||||||
<TrendingChips />
|
<TrendingChips />
|
||||||
|
|
||||||
{/* Mini Banner */}
|
{/* 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 */}
|
{/* Trending Circle Row */}
|
||||||
<TrendingCircleRow />
|
<TrendingCircleRow />
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const TrendingCard = ({ title, img, href }) => {
|
|||||||
<Link to={href}>
|
<Link to={href}>
|
||||||
{/* Image */}
|
{/* Image */}
|
||||||
<img
|
<img
|
||||||
src={img}
|
src={img || "/default-product.png"}
|
||||||
alt={title}
|
alt={title}
|
||||||
className="w-full h-44 md:h-52 object-cover transition-transform duration-500 hover:scale-105"
|
className="w-full h-44 md:h-52 object-cover transition-transform duration-500 hover:scale-105"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import TrendingCircle from "./TrendingCircle";
|
import TrendingCircle from "./TrendingCircle";
|
||||||
|
|
||||||
const data = [
|
const data = [
|
||||||
{ title: "Sarees", img: "/hero1.jpg", href: "/sarees" },
|
{ title: "Sarees", img: "/hero1.png", href: "/sarees" },
|
||||||
{ title: "Lehengas", img: "/hero2.jpg", href: "/lehenga" },
|
{ title: "Lehengas", img: "/hero2.png", href: "/lehenga" },
|
||||||
{ title: "Kurtas", img: "/hero3.jpg", href: "/kurtas" },
|
{ title: "Kurtas", img: "/hero3.png", href: "/kurtas" },
|
||||||
{ title: "Patola", img: "/hero1.jpg", href: "/patola" },
|
{ title: "Patola", img: "/hero1.png", href: "/patola" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const TrendingCircleRow = () => {
|
const TrendingCircleRow = () => {
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
import TrendingCard from "./TrendingCard";
|
import TrendingCard from "./TrendingCard";
|
||||||
|
|
||||||
const smallTrendingData = [
|
const smallTrendingData = [
|
||||||
{ title: "Sarees", img: "/hero1.jpg", href: "/sarees" },
|
{ title: "Sarees", img: "/hero1.png", href: "/sarees" },
|
||||||
{ title: "Lehengas", img: "/hero2.jpg", href: "/lehenga" },
|
{ title: "Lehengas", img: "/hero2.png", href: "/lehenga" },
|
||||||
{ title: "Kurtas", img: "/hero3.jpg", href: "/kurtas" },
|
{ title: "Kurtas", img: "/hero3.png", href: "/kurtas" },
|
||||||
{ title: "Patola", img: "/hero1.jpg", href: "/patola" },
|
{ title: "Patola", img: "/hero1.png", href: "/patola" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const TrendingSmallGrid = () => {
|
const TrendingSmallGrid = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user