-
-
setValue(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter") {
- handleSearch(value);
- }
- }}
- />
+
+ {/* Desktop Search */}
+
+
+
+
+ setValue(e.target.value)}
+ placeholder="Search products..."
+ className="bg-transparent outline-none text-sm text-gray-900 placeholder-gray-500 w-64"
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ handleSearch(value);
+ }
+ }}
+ />
+ {value && (
+
+
+
+ )}
+
+
+
+
+ {/* Mobile Search */}
+
+
+
+ setValue(e.target.value)}
+ placeholder="Search..."
+ className="bg-transparent outline-none text-sm text-gray-900 placeholder-gray-500 flex-1"
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ handleSearch(value);
+ }
+ }}
+ />
+ {value && (
+
+
+
+ )}
+
+
);
};
diff --git a/apps/client/src/components/ShopByCategory.tsx b/apps/client/src/components/ShopByCategory.tsx
new file mode 100644
index 00000000..5fa5a5a8
--- /dev/null
+++ b/apps/client/src/components/ShopByCategory.tsx
@@ -0,0 +1,209 @@
+"use client";
+
+import Image from "next/image";
+import Link from "next/link";
+import { ArrowRight } from "lucide-react";
+
+interface CategoryCard {
+ id: number;
+ badge: string;
+ descriptor: string;
+ name: string;
+ bgColor: string;
+ textColor: string;
+ buttonColor: string;
+ image: string;
+ link: string;
+ size: "small" | "large";
+}
+
+const categories: CategoryCard[] = [
+ {
+ id: 1,
+ badge: "Enjoy",
+ descriptor: "With",
+ name: "HEADPHONE",
+ bgColor: "bg-purple-600",
+ textColor: "text-white",
+ buttonColor: "bg-white text-purple-600 hover:bg-purple-50",
+ image: "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=400&fit=crop",
+ link: "/products?category=audio",
+ size: "small",
+ },
+ {
+ id: 2,
+ badge: "New",
+ descriptor: "Smart",
+ name: "WATCH",
+ bgColor: "bg-orange-500",
+ textColor: "text-white",
+ buttonColor: "bg-white text-orange-500 hover:bg-orange-50",
+ image: "https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=400&h=400&fit=crop",
+ link: "/products?category=wearables",
+ size: "small",
+ },
+ {
+ id: 3,
+ badge: "Productivity",
+ descriptor: "Gaming",
+ name: "LAPTOP",
+ bgColor: "bg-cyan-500",
+ textColor: "text-white",
+ buttonColor: "bg-white text-cyan-600 hover:bg-cyan-50",
+ image: "https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=400&h=400&fit=crop",
+ link: "/products?category=laptops",
+ size: "large",
+ },
+ {
+ id: 4,
+ badge: "Play",
+ descriptor: "Game",
+ name: "CONSOLE",
+ bgColor: "bg-gray-900",
+ textColor: "text-white",
+ buttonColor: "bg-white text-gray-900 hover:bg-gray-100",
+ image: "https://images.unsplash.com/photo-1606144042614-b2417e99c4e3?w=400&h=400&fit=crop",
+ link: "/products?category=gaming",
+ size: "large",
+ },
+ {
+ id: 5,
+ badge: "Play",
+ descriptor: "VR",
+ name: "OCULUS",
+ bgColor: "bg-green-600",
+ textColor: "text-white",
+ buttonColor: "bg-white text-green-600 hover:bg-green-50",
+ image: "https://images.unsplash.com/photo-1622979135225-d2ba269cf1ac?w=400&h=400&fit=crop",
+ link: "/products?category=vr-headsets",
+ size: "small",
+ },
+ {
+ id: 6,
+ badge: "New",
+ descriptor: "Smart",
+ name: "SPEAKER",
+ bgColor: "bg-blue-600",
+ textColor: "text-white",
+ buttonColor: "bg-white text-blue-600 hover:bg-blue-50",
+ image: "https://images.unsplash.com/photo-1608043152269-423dbba4e7e1?w=400&h=400&fit=crop",
+ link: "/products?category=audio",
+ size: "small",
+ },
+];
+
+const ShopByCategory = () => {
+ return (
+
+
+ {/* Header */}
+
+
+ CATEGORY
+
+
+ Shop By Category
+
+
+ Explore our gallery to learn more about our amazing products and their features.
+
+
+
+ {/* Category Grid - 2 Rows x 3 Columns */}
+
+ {/* Row 1: 3 Cards */}
+ {categories.slice(0, 3).map((category) => (
+
+ {/* Background Image - Full Cover */}
+
+
+ {/* Overlay for better text readability */}
+
+
+
+ {/* Badge */}
+
+ {category.badge}
+
+
+ {/* Content */}
+
+
+
+ {category.descriptor}
+
+
+ {category.name}
+
+
+
+ {/* Browse Button */}
+
+ Browse
+
+
+
+
+ ))}
+
+ {/* Row 2: 3 Cards */}
+ {categories.slice(3, 6).map((category) => (
+
+ {/* Background Image - Full Cover */}
+
+
+ {/* Overlay for better text readability */}
+
+
+
+ {/* Badge */}
+
+ {category.badge}
+
+
+ {/* Content */}
+
+
+
+ {category.descriptor}
+
+
+ {category.name}
+
+
+
+ {/* Browse Button */}
+
+ Browse
+
+
+
+
+ ))}
+
+
+
+ );
+};
+
+export default ShopByCategory;
diff --git a/apps/client/src/components/TrustIndicators.tsx b/apps/client/src/components/TrustIndicators.tsx
new file mode 100644
index 00000000..d41ca39d
--- /dev/null
+++ b/apps/client/src/components/TrustIndicators.tsx
@@ -0,0 +1,199 @@
+"use client";
+
+import { Star, Shield, Truck, RotateCcw } from "lucide-react";
+import Image from "next/image";
+
+const TrustIndicators = () => {
+ const trustMetrics = [
+ {
+ icon:
,
+ rating: "4.9/5",
+ label: "Rating",
+ description: "12.8K reviews"
+ },
+ {
+ icon:
,
+ label: "Free Shipping",
+ description: "Orders 115K+"
+ },
+ {
+ icon:
,
+ label: "Secure Pay",
+ description: "SSL encrypted"
+ },
+ {
+ icon:
,
+ label: "Easy Returns",
+ description: "30-day policy"
+ }
+ ];
+
+ const brands = [
+ {
+ name: "Apple",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg",
+ },
+ {
+ name: "Samsung",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/2/24/Samsung_Logo.svg",
+ },
+ {
+ name: "Sony",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/c/ca/Sony_logo.svg",
+ },
+ {
+ name: "Dell",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/4/48/Dell_Logo.svg",
+ },
+ {
+ name: "HP",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/a/ad/HP_logo_2012.svg",
+ },
+ {
+ name: "Lenovo",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/0/03/Lenovo_Global_Corporate_Logo.svg",
+ },
+ {
+ name: "Asus",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/2/2e/ASUS_Logo.svg",
+ },
+ {
+ name: "Microsoft",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/4/44/Microsoft_logo.svg",
+ },
+ {
+ name: "LG",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/b/bf/LG_logo_%282015%29.svg",
+ },
+ {
+ name: "Canon",
+ logo: "https://upload.wikimedia.org/wikipedia/commons/4/45/Canon_wordmark.svg",
+ },
+ ];
+
+ return (
+
+
+ {/* Compact Trust Indicators */}
+
+ {trustMetrics.map((metric, index) => (
+
+
+ {metric.icon}
+
+
+ {metric.rating && (
+
+ {metric.rating}
+
+ )}
+
+ {metric.label}
+
+
+ {metric.description}
+
+
+
+ ))}
+
+
+ {/* Brand Logo Cloud */}
+
+
+ Trusted Brands We Partner With
+
+
+
+
+ {/* Gradient Overlays */}
+
+
+
+ {/* Scrolling Logo Container */}
+
+ {/* First set of logos */}
+
+ {brands.map((brand, index) => (
+
+
+
+ ))}
+
+
+ {/* Duplicate set for seamless loop */}
+
+ {brands.map((brand, index) => (
+
+
+
+ ))}
+
+
+
+
+ {/* Add custom CSS for animation */}
+
+
+ {/* Bottom Trust Line */}
+
+
+
+ 256-bit SSL
+
+
+
+ 50K+ Happy Customers
+
+
+
+ PCI DSS Compliant
+
+
+
+ Trusted Delivery Partners
+
+
+
+
+ );
+};
+
+export default TrustIndicators;
\ No newline at end of file
diff --git a/apps/client/src/utils/currency.ts b/apps/client/src/utils/currency.ts
new file mode 100644
index 00000000..4228efe0
--- /dev/null
+++ b/apps/client/src/utils/currency.ts
@@ -0,0 +1,80 @@
+/**
+ * Currency utility functions for Neuraltale E-commerce
+ * Handles conversion between USD and Tanzanian Shillings (TZS)
+ */
+
+// Exchange rate: 1 USD = 2300 TZS (approximate)
+export const USD_TO_TZS_RATE = 2300;
+
+/**
+ * Convert USD amount to TZS
+ * @param usdAmount - Amount in USD
+ * @returns Amount in TZS
+ */
+export function convertUsdToTzs(usdAmount: number): number {
+ return usdAmount * USD_TO_TZS_RATE;
+}
+
+/**
+ * Convert TZS amount to USD
+ * @param tzsAmount - Amount in TZS
+ * @returns Amount in USD
+ */
+export function convertTzsToUsd(tzsAmount: number): number {
+ return tzsAmount / USD_TO_TZS_RATE;
+}
+
+/**
+ * Format TZS amount with proper formatting
+ * @param amount - Amount to format (can be in USD or TZS)
+ * @param fromUsd - Whether to convert from USD first (default: false)
+ * @returns Formatted TZS string
+ */
+export function formatTzs(amount: number, fromUsd: boolean = false): string {
+ const tzsAmount = fromUsd ? convertUsdToTzs(amount) : amount;
+ return `TZs ${tzsAmount.toLocaleString()}`;
+}
+
+/**
+ * Format USD amount with proper formatting
+ * @param amount - Amount in USD
+ * @returns Formatted USD string
+ */
+export function formatUsd(amount: number): string {
+ return `$${amount.toLocaleString()}`;
+}
+
+/**
+ * Get price display for UI components
+ * @param usdPrice - Price in USD (base price)
+ * @returns Object with both USD and TZS formatted prices
+ */
+export function getPriceDisplay(usdPrice: number) {
+ return {
+ usd: formatUsd(usdPrice),
+ tzs: formatTzs(usdPrice, true),
+ tzsAmount: convertUsdToTzs(usdPrice),
+ usdAmount: usdPrice
+ };
+}
+
+/**
+ * Calculate savings in TZS
+ * @param originalUsdPrice - Original price in USD
+ * @param discountedUsdPrice - Discounted price in USD
+ * @returns Savings amount in TZS
+ */
+export function calculateSavingsTzs(originalUsdPrice: number, discountedUsdPrice: number): number {
+ return convertUsdToTzs(originalUsdPrice - discountedUsdPrice);
+}
+
+/**
+ * Format savings display
+ * @param originalUsdPrice - Original price in USD
+ * @param discountedUsdPrice - Discounted price in USD
+ * @returns Formatted savings string
+ */
+export function formatSavings(originalUsdPrice: number, discountedUsdPrice: number): string {
+ const savings = calculateSavingsTzs(originalUsdPrice, discountedUsdPrice);
+ return `SAVE ${formatTzs(savings)}`;
+}
\ No newline at end of file
diff --git a/apps/order-service/src/index.ts b/apps/order-service/src/index.ts
index a2c6634a..06de7aad 100644
--- a/apps/order-service/src/index.ts
+++ b/apps/order-service/src/index.ts
@@ -29,16 +29,19 @@ fastify.register(orderRoute);
const start = async () => {
try {
- Promise.all([
- await connectOrderDB(),
- await producer.connect(),
- await consumer.connect(),
+ console.log("Starting order service...");
+ await Promise.all([
+ connectOrderDB(),
+ producer.connect(),
+ consumer.connect(),
]);
+ console.log("Database and Kafka connections established");
await runKafkaSubscriptions();
- await fastify.listen({ port: 8001 });
+ console.log("Kafka subscriptions running");
+ await fastify.listen({ port: 8001, host: '0.0.0.0' });
console.log("Order service is running on port 8001");
} catch (err) {
- console.log(err);
+ console.error("Failed to start order service:", err);
process.exit(1);
}
};
diff --git a/apps/payment-service/src/routes/session.route.ts b/apps/payment-service/src/routes/session.route.ts
index ce6daecb..1b546768 100644
--- a/apps/payment-service/src/routes/session.route.ts
+++ b/apps/payment-service/src/routes/session.route.ts
@@ -15,7 +15,7 @@ sessionRoute.post("/create-checkout-session", shouldBeUser, async (c) => {
const unitAmount = await getStripeProductPrice(item.id);
return {
price_data: {
- currency: "usd",
+ currency: "tzs", // Tanzanian Shilling
product_data: {
name: item.name,
},
diff --git a/apps/payment-service/src/utils/stripeProduct.ts b/apps/payment-service/src/utils/stripeProduct.ts
index cb1a897f..be8a6c0f 100644
--- a/apps/payment-service/src/utils/stripeProduct.ts
+++ b/apps/payment-service/src/utils/stripeProduct.ts
@@ -7,8 +7,8 @@ export const createStripeProduct = async (item: StripeProductType) => {
id: item.id,
name: item.name,
default_price_data: {
- currency: "usd",
- unit_amount: item.price * 100,
+ currency: "tzs", // Tanzanian Shilling
+ unit_amount: item.price * 100 * 2300, // Convert USD to TZS (1 USD ≈ 2300 TZS) and to cents
},
});
return res;
diff --git a/apps/product-service/src/index.ts b/apps/product-service/src/index.ts
index 21b7086b..8a467717 100644
--- a/apps/product-service/src/index.ts
+++ b/apps/product-service/src/index.ts
@@ -8,7 +8,7 @@ import { consumer, producer } from "./utils/kafka.js";
const app = express();
app.use(
cors({
- origin: ["http://localhost:3002", "http://localhost:3003"],
+ origin: ["http://localhost:3002", "http://localhost:3003", "http://localhost:3004"],
credentials: true,
})
);
@@ -39,7 +39,14 @@ app.use((err: any, req: Request, res: Response, next: NextFunction) => {
const start = async () => {
try {
- Promise.all([await producer.connect(), await consumer.connect()]);
+ // Try to connect to Kafka, but don't fail if it's not available
+ try {
+ await Promise.all([producer.connect(), consumer.connect()]);
+ console.log("Kafka connected successfully");
+ } catch (kafkaError) {
+ console.log("Kafka connection failed (service will run without it):", kafkaError.message);
+ }
+
app.listen(8000, () => {
console.log("Product service is running on 8000");
});
diff --git a/neuraltale-database-setup-fixed.sql b/neuraltale-database-setup-fixed.sql
new file mode 100644
index 00000000..bdceb370
--- /dev/null
+++ b/neuraltale-database-setup-fixed.sql
@@ -0,0 +1,166 @@
+-- ======================================
+-- NEURALTALE E-COMMERCE DATABASE SETUP
+-- ======================================
+-- This script sets up the complete database schema and sample data for Neuraltale e-commerce platform
+-- All prices are in Tanzanian Shillings (TZS)
+
+-- ======================================
+-- INSERT CATEGORIES
+-- ======================================
+
+INSERT INTO "Category" (name, slug) VALUES
+('Smartphones', 'smartphones'),
+('Laptops', 'laptops'),
+('Gaming Laptops', 'gaming-laptops'),
+('Audio', 'audio'),
+('Accessories', 'accessories'),
+('Tablets', 'tablets'),
+('Monitors', 'monitors'),
+('Wearables', 'wearables'),
+('Graphics Cards', 'graphics-cards'),
+('Processors', 'processors'),
+('RAM', 'ram'),
+('SSDs', 'ssds'),
+('Hard Drives', 'hard-drives'),
+('Keyboards', 'keyboards'),
+('Mice', 'mice'),
+('Webcams', 'webcams'),
+('Speakers', 'speakers'),
+('Networking', 'networking'),
+('Storage', 'storage'),
+('Gaming Chairs', 'gaming-chairs'),
+('Desks', 'desks'),
+('Lighting', 'lighting'),
+('Cables', 'cables'),
+('Power Supplies', 'power-supplies'),
+('Cooling', 'cooling'),
+('Cases', 'cases'),
+('Motherboards', 'motherboards'),
+('Smart Home', 'smart-home'),
+('Drones', 'drones'),
+('VR Headsets', 'vr-headsets'),
+('Action Cameras', 'action-cameras'),
+('Home Security', 'home-security'),
+('Fitness Tech', 'fitness-tech'),
+('E-readers', 'e-readers'),
+('Portable Chargers', 'portable-chargers'),
+('Phone Cases', 'phone-cases'),
+('Screen Protectors', 'screen-protectors'),
+('Memory Cards', 'memory-cards'),
+('Adapters', 'adapters'),
+('Hubs', 'hubs'),
+('Stands', 'stands'),
+('Mounts', 'mounts'),
+('Cleaning Kits', 'cleaning-kits'),
+('Surge Protectors', 'surge-protectors'),
+('UPS Systems', 'ups-systems'),
+('External Drives', 'external-drives'),
+('Bluetooth Devices', 'bluetooth-devices'),
+('Smart Watches', 'smart-watches'),
+('Earbuds', 'earbuds'),
+('Headphones', 'headphones'),
+('Microphones', 'microphones'),
+('Studio Equipment', 'studio-equipment'),
+('Productivity Software', 'productivity-software'),
+('Security Software', 'security-software'),
+('Digital Games', 'digital-games');
+
+-- ======================================
+-- INSERT PRODUCTS - SMARTPHONES
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('iPhone 15 Pro Max', 'The ultimate iPhone with titanium design, Action Button, and powerful A17 Pro chip.', 'Experience the pinnacle of iPhone innovation with the iPhone 15 Pro Max. Featuring a lightweight titanium design, the revolutionary Action Button for quick access to your favorite features, and the industry-leading A17 Pro chip with 6-core GPU. The advanced camera system captures stunning detail with 5x Telephoto zoom and next-generation portraits with Focus and Depth Control.', 119999, '{"128GB", "256GB", "512GB", "1TB"}', '{"Natural Titanium", "Blue Titanium", "White Titanium", "Black Titanium"}', '{"Natural Titanium": "/products/iphone-15-pro-natural.jpg", "Blue Titanium": "/products/iphone-15-pro-blue.jpg", "White Titanium": "/products/iphone-15-pro-white.jpg", "Black Titanium": "/products/iphone-15-pro-black.jpg"}', 'smartphones', NOW(), NOW()),
+
+('Samsung Galaxy S24 Ultra', 'AI-powered smartphone with S Pen, 200MP camera, and brilliant 6.8" Dynamic AMOLED display.', 'Discover the power of Galaxy AI with the Samsung Galaxy S24 Ultra. This premium smartphone features a built-in S Pen for precision control, a pro-grade 200MP camera system with AI-enhanced photography, and a stunning 6.8-inch Dynamic AMOLED 2X display. The Snapdragon 8 Gen 3 processor delivers exceptional performance for gaming, productivity, and creative tasks.', 129999, '{"256GB", "512GB", "1TB"}', '{"Titanium Gray", "Titanium Black", "Titanium Violet", "Titanium Yellow"}', '{"Titanium Gray": "/products/galaxy-s24-ultra-gray.jpg", "Titanium Black": "/products/galaxy-s24-ultra-black.jpg", "Titanium Violet": "/products/galaxy-s24-ultra-violet.jpg", "Titanium Yellow": "/products/galaxy-s24-ultra-yellow.jpg"}', 'smartphones', NOW(), NOW()),
+
+('Google Pixel 9 Pro', 'AI-powered smartphone with advanced computational photography and pure Android experience.', 'Capture life''s moments with extraordinary detail using the Pixel 9 Pro''s advanced AI photography features. The Google Tensor G4 chip delivers intelligent performance, while the pure Android experience ensures seamless updates and security. Features include Magic Eraser, Real Tone technology, and Live Translate for global communication.', 99999, '{"128GB", "256GB", "512GB"}', '{"Obsidian", "Porcelain", "Hazel", "Rose"}', '{"Obsidian": "/products/pixel-9-pro-obsidian.jpg", "Porcelain": "/products/pixel-9-pro-porcelain.jpg", "Hazel": "/products/pixel-9-pro-hazel.jpg", "Rose": "/products/pixel-9-pro-rose.jpg"}', 'smartphones', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - LAPTOPS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('MacBook Pro 16-inch M4 Pro', 'Professional laptop with M4 Pro chip, Liquid Retina XDR display, and up to 22-hour battery life.', 'Unleash your creativity with the MacBook Pro 16-inch powered by the revolutionary M4 Pro chip. Features a stunning Liquid Retina XDR display with 1000 nits sustained brightness, advanced thermal design for sustained pro performance, and an impressive battery life of up to 22 hours. Perfect for video editing, 3D rendering, and software development.', 249999, '{"512GB", "1TB", "2TB", "4TB"}', '{"Space Black", "Silver"}', '{"Space Black": "/products/macbook-pro-16-space-black.jpg", "Silver": "/products/macbook-pro-16-silver.jpg"}', 'laptops', NOW(), NOW()),
+
+('Dell XPS 15 OLED', 'Premium Windows laptop with 4K OLED InfinityEdge display and 13th Gen Intel processors.', 'Experience premium performance with the Dell XPS 15 featuring a breathtaking 4K OLED InfinityEdge display with 100% DCI-P3 color accuracy. Powered by 13th Gen Intel Core processors and NVIDIA GeForce RTX graphics, this laptop delivers exceptional performance for creative professionals and power users. The precision-crafted aluminum chassis ensures durability and style.', 189999, '{"512GB", "1TB", "2TB"}', '{"Platinum Silver", "Graphite"}', '{"Platinum Silver": "/products/dell-xps-15-silver.jpg", "Graphite": "/products/dell-xps-15-graphite.jpg"}', 'laptops', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - GAMING LAPTOPS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('ASUS ROG Strix G15', 'AMD Ryzen 7 5800H, RTX 3060, 144Hz FHD', 'High-performance gaming laptop with AMD Ryzen 7 processor and NVIDIA GeForce RTX 3060 graphics. Features a 144Hz Full HD display for smooth gaming.', 129900, '{"15.6in", "17.3in"}', '{"Eclipse Gray", "Electro Punk"}', '{"Eclipse Gray": "/products/asus-rog-gray.jpg", "Electro Punk": "/products/asus-rog-pink.jpg"}', 'gaming-laptops', NOW(), NOW()),
+
+('MSI Katana 15', 'Intel Core i7-12650H, RTX 4060, 144Hz', 'Gaming laptop with Intel 12th Gen processor and RTX 4060 graphics. Perfect for gaming and content creation with high refresh rate display.', 149900, '{"15.6in"}', '{"Black", "Blue"}', '{"Black": "/products/msi-katana-black.jpg", "Blue": "/products/msi-katana-blue.jpg"}', 'gaming-laptops', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - AUDIO
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('Sony WH-1000XM5', 'Industry-leading noise canceling headphones with 30-hour battery and crystal-clear calls.', 'Immerse yourself in premium sound with the Sony WH-1000XM5 wireless headphones. Featuring industry-leading noise cancellation, exceptional sound quality with LDAC codec support, and an impressive 30-hour battery life. The lightweight design with soft leather cushioning ensures all-day comfort, while Speak-to-Chat technology automatically pauses music when you start talking.', 39999, '{"Standard"}', '{"Black", "Silver"}', '{"Black": "/products/sony-wh1000xm5-black.jpg", "Silver": "/products/sony-wh1000xm5-silver.jpg"}', 'audio', NOW(), NOW()),
+
+('AirPods Pro (3rd Generation)', 'Premium wireless earbuds with Active Noise Cancellation and Spatial Audio support.', 'Experience premium wireless audio with AirPods Pro featuring Active Noise Cancellation, Transparency mode, and Personalized Spatial Audio. The H2 chip delivers smarter noise cancellation and superior three-dimensional sound. With up to 6 hours of listening time and the MagSafe Charging Case providing multiple additional charges.', 24999, '{"Standard"}', '{"White"}', '{"White": "/products/airpods-pro-3rd-gen.jpg"}', 'audio', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - ACCESSORIES
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('Logitech MX Master 3S', 'Advanced wireless mouse with 8K DPI sensor, quiet clicks, and 70-day battery life.', 'Achieve precision and comfort with the Logitech MX Master 3S, featuring an 8000 DPI sensor for ultimate tracking accuracy. The 90% quieter clicks provide a premium experience without disturbing others. With 70-day battery life, USB-C fast charging, and seamless connectivity across multiple devices, it is perfect for professionals and creatives.', 9999, '{"Standard"}', '{"Graphite", "Pale Gray"}', '{"Graphite": "/products/mx-master-3s-graphite.jpg", "Pale Gray": "/products/mx-master-3s-pale-gray.jpg"}', 'accessories', NOW(), NOW()),
+
+('Logitech K380 Multi-Device Keyboard', 'Compact wireless keyboard with Easy-Switch technology for seamless multi-device typing.', 'Type comfortably on the Logitech K380, a compact wireless keyboard designed for multi-device use. Easy-Switch technology lets you connect up to three devices and switch between them with the press of a button. The round concave keys provide a comfortable, familiar typing experience, while the 2-year battery life ensures long-lasting performance.', 3999, '{"Compact"}', '{"Dark Grey", "Off-White", "Blue"}', '{"Dark Grey": "/products/k380-dark-grey.jpg", "Off-White": "/products/k380-off-white.jpg", "Blue": "/products/k380-blue.jpg"}', 'accessories', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - TABLETS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('iPad Pro 12.9"', 'M2 chip, 128GB, Wi-Fi + Cellular', 'Ultimate iPad experience with M2 chip. Features Liquid Retina XDR display and support for Apple Pencil (2nd generation).', 109900, '{"128GB", "256GB", "512GB", "1TB"}', '{"Space Gray", "Silver"}', '{"Space Gray": "/products/ipad-pro-gray.jpg", "Silver": "/products/ipad-pro-silver.jpg"}', 'tablets', NOW(), NOW()),
+
+('Samsung Galaxy Tab S9', 'Snapdragon 8 Gen 2, 128GB, 11 inch', 'Premium Android tablet with Snapdragon processor. Includes S Pen and features a stunning AMOLED display.', 79900, '{"128GB", "256GB"}', '{"Graphite", "Beige", "Mint"}', '{"Graphite": "/products/galaxy-tab-graphite.jpg", "Beige": "/products/galaxy-tab-beige.jpg", "Mint": "/products/galaxy-tab-mint.jpg"}', 'tablets', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - MONITORS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('LG UltraGear 27GL850', '27" QHD IPS, 144Hz, 1ms, G-Sync Compatible', 'High-performance gaming monitor with Nano IPS technology. Features 144Hz refresh rate and 1ms response time for competitive gaming.', 44900, '{"27in"}', '{"Black"}', '{"Black": "/products/lg-ultragear-black.jpg"}', 'monitors', NOW(), NOW()),
+
+('Samsung Odyssey G7', '32" Curved QLED, 240Hz, 1ms, G-Sync', 'Curved gaming monitor with QLED technology and 1000R curvature. Features 240Hz refresh rate for ultimate gaming performance.', 69900, '{"27in", "32in"}', '{"Black"}', '{"Black": "/products/samsung-odyssey-black.jpg"}', 'monitors', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - WEARABLES
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('Apple Watch Series 9', 'GPS + Cellular, 45mm, Titanium', 'Advanced smartwatch with S9 SiP and Double Tap gesture. Features Always-On Retina display and comprehensive health tracking.', 74900, '{"41mm", "45mm"}', '{"Natural Titanium", "Blue Titanium", "Silver"}', '{"Natural Titanium": "/products/apple-watch-titanium.jpg", "Blue Titanium": "/products/apple-watch-blue.jpg", "Silver": "/products/apple-watch-silver.jpg"}', 'wearables', NOW(), NOW()),
+
+('Samsung Galaxy Watch6', '40mm, Bluetooth, Health Monitoring', 'Advanced smartwatch with comprehensive health monitoring. Features sleep tracking, heart rate monitoring, and long battery life.', 32900, '{"40mm", "44mm"}', '{"Graphite", "Gold", "Silver"}', '{"Graphite": "/products/galaxy-watch-graphite.jpg", "Gold": "/products/galaxy-watch-gold.jpg", "Silver": "/products/galaxy-watch-silver.jpg"}', 'wearables', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - GRAPHICS CARDS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('NVIDIA GeForce RTX 4080', 'High-performance graphics card with DLSS 3 and ray tracing support', 'Experience next-generation gaming with the NVIDIA GeForce RTX 4080. Features Ada Lovelace architecture, DLSS 3, and advanced ray tracing for stunning visuals and exceptional performance.', 119900, '{"16GB GDDR6X"}', '{"Black"}', '{"Black": "/products/rtx-4080-black.jpg"}', 'graphics-cards', NOW(), NOW()),
+
+('AMD Ryzen 9 7900X', '12-Core, 24-Thread Desktop Processor', 'High-performance desktop processor with 12 cores and 24 threads. Built on advanced 5nm process technology for exceptional gaming and productivity performance.', 42900, '{"Standard"}', '{"Silver"}', '{"Silver": "/products/ryzen-9-7900x.jpg"}', 'processors', NOW(), NOW()),
+
+('Corsair Vengeance DDR5-5600', '32GB (2x16GB) High-Speed Gaming Memory', 'Premium DDR5 memory optimized for gaming and high-performance computing. Features aluminum heat spreaders and Intel XMP 3.0 support.', 15900, '{"16GB", "32GB", "64GB"}', '{"Black", "White"}', '{"Black": "/products/corsair-vengeance-black.jpg", "White": "/products/corsair-vengeance-white.jpg"}', 'ram', NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - STORAGE
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('Samsung 980 PRO NVMe SSD', '2TB PCIe 4.0 Internal SSD with Heatsink', 'Ultra-fast NVMe SSD with PCIe 4.0 interface. Features sequential read speeds up to 7,000 MB/s and built-in heatsink for optimal thermal management.', 19900, '{"1TB", "2TB", "4TB"}', '{"Black"}', '{"Black": "/products/samsung-980-pro.jpg"}', 'ssds', NOW(), NOW()),
+
+('Western Digital Black 4TB HDD', 'High-Performance Desktop Hard Drive', 'Reliable desktop hard drive designed for gaming and high-performance computing. Features 7200 RPM speed and 256MB cache for fast data access.', 12900, '{"1TB", "2TB", "4TB", "6TB"}', '{"Black"}', '{"Black": "/products/wd-black-hdd.jpg"}', 'hard-drives', NOW(), NOW());
+
+-- ======================================
+-- COMPLETION MESSAGE
+-- ======================================
+-- Database setup complete! All categories and products have been inserted with Tanzanian Shilling pricing.
+-- You can now query your products and categories from the Neon PostgreSQL database.
\ No newline at end of file
diff --git a/neuraltale-database-setup.sql b/neuraltale-database-setup.sql
new file mode 100644
index 00000000..6187b55e
--- /dev/null
+++ b/neuraltale-database-setup.sql
@@ -0,0 +1,223 @@
+-- ======================================
+-- NEURALTALE E-COMMERCE DATABASE SETUP
+-- Comprehensive SQL Script for Neon PostgreSQL
+-- =INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+('iPad Pro 12.9"', 'M2 chip, 128GB, Wi-Fi + Cellular', 'Ultimate iPad experience with M2 chip. Features Liquid Retina XDR display and support for Apple Pencil (2nd generation).', 109900, '{"128GB", "256GB", "512GB", "1TB"}', '{"Space Gray", "Silver"}', '{"Space Gray": "/products/ipad-pro-gray.jpg", "Silver": "/products/ipad-pro-silver.jpg"}', 'tablets', NOW(), NOW()),
+
+('Samsung Galaxy Tab S9', 'Snapdragon 8 Gen 2, 128GB, 11 inch', 'Premium Android tablet with Snapdragon processor. Includes S Pen and features a stunning AMOLED display.', 79900, '{"128GB", "256GB"}', '{"Graphite", "Beige", "Mint"}', '{"Graphite": "/products/galaxy-tab-graphite.jpg", "Beige": "/products/galaxy-tab-beige.jpg", "Mint": "/products/galaxy-tab-mint.jpg"}', 'tablets', NOW(), NOW());=================================
+
+-- Clear existing data (optional - uncomment if you want to start fresh)
+-- DELETE FROM "Product";
+-- DELETE FROM "Category";
+
+-- ======================================
+-- INSERT CATEGORIES
+-- ======================================
+
+-- Main Categories
+INSERT INTO "Category" (name, slug) VALUES
+("`Laptops", "`laptops"),
+("`Desktops", "`desktops"),
+("`Computer Monitors", "`monitors"),
+("`Storage", "`storage"),
+("`Components", "`components"),
+("`Peripherals", "`peripherals"),
+("`Networking", "`networking"),
+("`Gadgets", "`gadgets"),
+("`Gaming", "`gaming"),
+("`Software & Digital", "`software"),
+
+-- Subcategories for Laptops
+("`Gaming Laptops", "`gaming-laptops"),
+("`Business Laptops", "`business-laptops"),
+("`Ultrabooks", "`ultrabooks"),
+("`MacBooks", "`macbooks"),
+
+-- Subcategories for Desktops
+("`Gaming PCs", "`gaming-pcs"),
+("`Workstations", "`workstations"),
+("`All-in-One PCs", "`all-in-one"),
+("`Mini PCs", "`mini-pcs"),
+
+-- Subcategories for Monitors
+("`Gaming Monitors", "`gaming-monitors"),
+("`4K Monitors", "`4k-monitors"),
+("`Ultrawide Monitors", "`ultrawide-monitors"),
+("`Professional Monitors", "`professional-monitors"),
+
+-- Subcategories for Storage
+("`SSDs", "`ssds"),
+("`Hard Drives", "`hard-drives"),
+("`External Storage", "`external-storage"),
+("`NAS", "`nas"),
+
+-- Subcategories for Components
+("`Processors", "`processors"),
+("`Graphics Cards", "`graphics-cards"),
+("`Motherboards", "`motherboards"),
+("`RAM", "`ram"),
+
+-- Subcategories for Peripherals
+("`Keyboards", "`keyboards"),
+("`Mice", "`mice"),
+("`Headsets", "`headsets"),
+("`Webcams", "`webcams"),
+
+-- Subcategories for Networking
+("`Routers", "`routers"),
+("`WiFi Adapters", "`wifi-adapters"),
+("`Switches", "`switches"),
+("`Access Points", "`access-points"),
+
+-- Subcategories for Gadgets
+("`Smartphones", "`smartphones"),
+("`Tablets", "`tablets"),
+("`Smartwatches", "`smartwatches"),
+("`Audio", "`audio"),
+("`Wearables", "`wearables"),
+("`Accessories", "`accessories"),
+
+-- Subcategories for Gaming
+("`Gaming Chairs", "`gaming-chairs"),
+("`Controllers", "`controllers"),
+("`VR Headsets", "`vr-headsets"),
+("`Gaming Accessories", "`gaming-accessories"),
+
+-- Subcategories for Software
+("`Operating Systems", "`operating-systems"),
+("`Productivity Software", "`productivity-software"),
+("`Security Software", "`security-software"),
+("`Digital Games", "`digital-games");
+
+-- ======================================
+-- INSERT PRODUCTS - SMARTPHONES
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+("`iPhone 15 Pro Max", "`The ultimate iPhone with titanium design, Action Button, and powerful A17 Pro chip.", "`Experience the pinnacle of iPhone innovation with the iPhone 15 Pro Max. Featuring a lightweight titanium design, the revolutionary Action Button for quick access to your favorite features, and the industry-leading A17 Pro chip with 6-core GPU. The advanced camera system captures stunning detail with 5x Telephoto zoom and next-generation portraits with Focus and Depth Control.", 119999, "`{"128GB", "256GB", "512GB", "1TB"}", "`{"Natural Titanium", "Blue Titanium", "White Titanium", "Black Titanium"}", "`{"Natural Titanium": "/products/iphone-15-pro-natural.jpg", "Blue Titanium": "/products/iphone-15-pro-blue.jpg", "White Titanium": "/products/iphone-15-pro-white.jpg", "Black Titanium": "/products/iphone-15-pro-black.jpg"}", "`smartphones", NOW(), NOW()),
+
+("`Samsung Galaxy S24 Ultra", "`AI-powered smartphone with S Pen, 200MP camera, and brilliant 6.8" Dynamic AMOLED display.", "`Discover the power of Galaxy AI with the Samsung Galaxy S24 Ultra. This premium smartphone features a built-in S Pen for precision control, a pro-grade 200MP camera system with AI-enhanced photography, and a stunning 6.8-inch Dynamic AMOLED 2X display. The Snapdragon 8 Gen 3 processor delivers exceptional performance for gaming, productivity, and creative tasks.", 129999, "`{"256GB", "512GB", "1TB"}", "`{"Titanium Gray", "Titanium Black", "Titanium Violet", "Titanium Yellow"}", "`{"Titanium Gray": "/products/galaxy-s24-ultra-gray.jpg", "Titanium Black": "/products/galaxy-s24-ultra-black.jpg", "Titanium Violet": "/products/galaxy-s24-ultra-violet.jpg", "Titanium Yellow": "/products/galaxy-s24-ultra-yellow.jpg"}", "`smartphones", NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - LAPTOPS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+("`MacBook Pro 16-inch M4 Pro", "`Professional laptop with M4 Pro chip, Liquid Retina XDR display, and up to 22-hour battery life.", "`Unleash your creativity with the MacBook Pro 16-inch powered by the revolutionary M4 Pro chip. Features a stunning Liquid Retina XDR display with 1000 nits sustained brightness, advanced thermal design for sustained pro performance, and an impressive battery life of up to 22 hours. Perfect for video editing, 3D rendering, and software development.", 249999, "`{"512GB", "1TB", "2TB", "4TB"}", "`{"Space Black", "Silver"}", "`{"Space Black": "/products/macbook-pro-16-space-black.jpg", "Silver": "/products/macbook-pro-16-silver.jpg"}", "`laptops", NOW(), NOW()),
+
+("`Dell XPS 15 OLED", "`Premium Windows laptop with 4K OLED InfinityEdge display and 13th Gen Intel processors.", "`Experience premium performance with the Dell XPS 15 featuring a breathtaking 4K OLED InfinityEdge display with 100% DCI-P3 color accuracy. Powered by 13th Gen Intel Core processors and NVIDIA GeForce RTX graphics, this laptop delivers exceptional performance for creative professionals and power users. The precision-crafted aluminum chassis ensures durability and style.", 189999, "`{"512GB", "1TB", "2TB"}", "`{"Platinum Silver", "Graphite"}", "`{"Platinum Silver": "/products/dell-xps-15-silver.jpg", "Graphite": "/products/dell-xps-15-graphite.jpg"}", "`laptops", NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - GAMING LAPTOPS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+("`ASUS ROG Strix G15", "`AMD Ryzen 7 5800H, RTX 3060, 144Hz FHD", "`High-performance gaming laptop with AMD Ryzen 7 processor and NVIDIA GeForce RTX 3060 graphics. Features a 144Hz Full HD display for smooth gaming.", 129900, "`{"15.6in", "17.3in"}", "`{"Eclipse Gray", "Electro Punk"}", "`{"Eclipse Gray": "/products/asus-rog-gray.jpg", "Electro Punk": "/products/asus-rog-pink.jpg"}", "`gaming-laptops", NOW(), NOW()),
+
+("`MSI Katana 15", "`Intel Core i7-12650H, RTX 4060, 144Hz", "`Gaming laptop with Intel 12th Gen processor and RTX 4060 graphics. Perfect for gaming and content creation with high refresh rate display.", 149900, "`{"15.6in"}", "`{"Black", "Blue"}", "`{"Black": "/products/msi-katana-black.jpg", "Blue": "/products/msi-katana-blue.jpg"}", "`gaming-laptops", NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - AUDIO
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+("`Sony WH-1000XM5", "`Industry-leading noise canceling headphones with 30-hour battery and crystal-clear calls.", "`Immerse yourself in premium sound with the Sony WH-1000XM5 wireless headphones. Featuring industry-leading noise cancellation, exceptional sound quality with LDAC codec support, and an impressive 30-hour battery life. The lightweight design with soft leather cushioning ensures all-day comfort, while Speak-to-Chat technology automatically pauses music when you start talking.", 39999, "`{"Standard"}", "`{"Black", "Silver"}", "`{"Black": "/products/sony-wh1000xm5-black.jpg", "Silver": "/products/sony-wh1000xm5-silver.jpg"}", "`audio", NOW(), NOW()),
+
+("`AirPods Pro (3rd Generation)", "`Premium wireless earbuds with Active Noise Cancellation and Spatial Audio support.", "`Experience premium wireless audio with AirPods Pro featuring Active Noise Cancellation, Transparency mode, and Personalized Spatial Audio. The H2 chip delivers smarter noise cancellation and superior three-dimensional sound. With up to 6 hours of listening time and the MagSafe Charging Case providing multiple additional charges.", 24999, "`{"Standard"}", "`{"White"}", "`{"White": "/products/airpods-pro-3rd-gen.jpg"}", "`audio", NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - ACCESSORIES
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug", "createdAt", "updatedAt") VALUES
+("`Logitech MX Master 3S", "`Advanced wireless mouse with 8K DPI sensor, quiet clicks, and 70-day battery life.", "`Achieve precision and comfort with the Logitech MX Master 3S, featuring an 8000 DPI sensor for ultimate tracking accuracy. The 90% quieter clicks provide a premium experience without disturbing others. With 70-day battery life, USB-C fast charging, and seamless connectivity across multiple devices, it is perfect for professionals and creatives.", 9999, "`{"Standard"}", "`{"Graphite", "Pale Gray"}", "`{"Graphite": "/products/mx-master-3s-graphite.jpg", "Pale Gray": "/products/mx-master-3s-pale-gray.jpg"}", "`accessories", NOW(), NOW()),
+
+("`Logitech K380 Multi-Device Keyboard", "`Compact wireless keyboard with Easy-Switch technology for seamless multi-device typing.", "`Type comfortably on the Logitech K380, a compact wireless keyboard designed for multi-device use. Easy-Switch technology lets you connect up to three devices and switch between them with the press of a button. The round concave keys provide a comfortable, familiar typing experience, while the 2-year battery life ensures long-lasting performance.", 3999, "`{"Compact"}", "`{"Dark Grey", "Off-White", "Blue"}", "`{"Dark Grey": "/products/k380-dark-grey.jpg", "Off-White": "/products/k380-off-white.jpg", "Blue": "/products/k380-blue.jpg"}", "`accessories", NOW(), NOW());
+
+-- ======================================
+-- INSERT PRODUCTS - TABLETS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug") VALUES
+("`iPad Pro 12.9"", "`M2 chip, 128GB, Wi-Fi + Cellular", "`Ultimate iPad experience with M2 chip. Features Liquid Retina XDR display and support for Apple Pencil (2nd generation).", 109900, {"`128GB", "`256GB", "`512GB", "`1TB"}, {"`Space Gray", "`Silver"}, "`{"Space Gray": "/products/ipad-pro-gray.jpg", "Silver": "/products/ipad-pro-silver.jpg"}", "`tablets"),
+
+("`Samsung Galaxy Tab S9", "`Snapdragon 8 Gen 2, 128GB, 11 inch", "`Premium Android tablet with Snapdragon processor. Includes S Pen and features a stunning AMOLED display.", 79900, {"`128GB", "`256GB"}, {"`Graphite", "`Beige", "`Mint"}, "`{"Graphite": "/products/galaxy-tab-graphite.jpg", "Beige": "/products/galaxy-tab-beige.jpg", "Mint": "/products/galaxy-tab-mint.jpg"}", "`tablets");
+
+-- ======================================
+-- INSERT PRODUCTS - MONITORS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug") VALUES
+("`LG UltraGear 27GL850", "`27" QHD IPS, 144Hz, 1ms, G-Sync Compatible", "`High-performance gaming monitor with Nano IPS technology. Features 144Hz refresh rate and 1ms response time for competitive gaming.", 44900, "{`27in}", "{`Black}", "`{"Black": "/products/lg-ultragear-black.jpg"}", "`monitors"),
+
+("`Samsung Odyssey G7", "`32" Curved QLED, 240Hz, 1ms, G-Sync", "`Curved gaming monitor with QLED technology and 1000R curvature. Features 240Hz refresh rate for ultimate gaming performance.", 69900, {"`27in", "`32in"}, "{`Black}", "`{"Black": "/products/samsung-odyssey-black.jpg"}", "`monitors");
+
+-- ======================================
+-- INSERT PRODUCTS - WEARABLES
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug") VALUES
+("`Apple Watch Series 9", "`GPS + Cellular, 45mm, Titanium", "`Advanced smartwatch with S9 SiP and Double Tap gesture. Features Always-On Retina display and comprehensive health tracking.", 74900, {"`41mm", "`45mm"}, {"`Natural Titanium", "`Blue Titanium", "`Silver"}, "`{"Natural Titanium": "/products/apple-watch-titanium.jpg", "Blue Titanium": "/products/apple-watch-blue.jpg", "Silver": "/products/apple-watch-silver.jpg"}", "`wearables"),
+
+("`Samsung Galaxy Watch6", "`40mm, Bluetooth, Health Monitoring", "`Advanced smartwatch with comprehensive health monitoring. Features sleep tracking, heart rate monitoring, and long battery life.", 32900, {"`40mm", "`44mm"}, {"`Graphite", "`Gold", "`Silver"}, "`{"Graphite": "/products/galaxy-watch-graphite.jpg", "Gold": "/products/galaxy-watch-gold.jpg", "Silver": "/products/galaxy-watch-silver.jpg"}", "`wearables");
+
+-- ======================================
+-- INSERT PRODUCTS - COMPONENTS
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug") VALUES
+("`NVIDIA GeForce RTX 4080", "`High-performance graphics card with DLSS 3 and ray tracing support", "`Experience next-generation gaming with the NVIDIA GeForce RTX 4080. Features Ada Lovelace architecture, DLSS 3, and advanced ray tracing for stunning visuals and exceptional performance.", 119900, "{`16GB GDDR6X}", "{`Black}", "`{"Black": "/products/rtx-4080-black.jpg"}", "`graphics-cards"),
+
+("`AMD Ryzen 9 7900X", "`12-Core, 24-Thread Desktop Processor", "`High-performance desktop processor with 12 cores and 24 threads. Built on advanced 5nm process technology for exceptional gaming and productivity performance.", 42900, "{`Standard}", "{`Silver}", "`{"Silver": "/products/ryzen-9-7900x.jpg"}", "`processors"),
+
+("`Corsair Vengeance DDR5-5600", "`32GB (2x16GB) High-Speed Gaming Memory", "`Premium DDR5 memory optimized for gaming and high-performance computing. Features aluminum heat spreaders and Intel XMP 3.0 support.", 15900, {"`16GB", "`32GB", "`64GB"}, {"`Black", "`White"}, "`{"Black": "/products/corsair-vengeance-black.jpg", "White": "/products/corsair-vengeance-white.jpg"}", "`ram");
+
+-- ======================================
+-- INSERT PRODUCTS - STORAGE
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug") VALUES
+("`Samsung 980 PRO NVMe SSD", "`2TB PCIe 4.0 Internal SSD with Heatsink", "`Ultra-fast NVMe SSD with PCIe 4.0 interface. Features sequential read speeds up to 7,000 MB/s and built-in heatsink for optimal thermal management.", 19900, {"`1TB", "`2TB", "`4TB"}, "{`Black}", "`{"Black": "/products/samsung-980-pro.jpg"}", "`ssds"),
+
+("`Western Digital Black 4TB HDD", "`High-Performance Desktop Hard Drive", "`Reliable desktop hard drive designed for gaming and high-performance computing. Features 7200 RPM speed and 256MB cache for fast data access.", 12900, {"`1TB", "`2TB", "`4TB", "`6TB"}, "{`Black}", "`{"Black": "/products/wd-black-hdd.jpg"}", "`hard-drives");
+
+-- ======================================
+-- INSERT PRODUCTS - NETWORKING
+-- ======================================
+
+INSERT INTO "Product" (name, "shortDescription", description, price, sizes, colors, images, "categorySlug") VALUES
+("`ASUS AX6000 WiFi 6 Router", "`Dual-Band Wireless Router with AiMesh Support", "`Next-generation WiFi 6 router with AX6000 speeds. Features MU-MIMO technology, adaptive QoS, and AiMesh support for whole-home coverage.", 29900, "{`Standard}", "{`Black}", "`{"Black": "/products/asus-ax6000-router.jpg"}", "`routers"),
+
+("`TP-Link AC1300 USB WiFi Adapter", "`Dual-Band USB 3.0 WiFi Adapter", "`High-speed USB WiFi adapter with AC1300 speeds. Features dual-band connectivity and USB 3.0 interface for maximum performance.", 3999, "{`Compact}", "{`Black}", "`{"Black": "/products/tp-link-ac1300-adapter.jpg"}", "`wifi-adapters");
+
+-- ======================================
+-- VERIFICATION QUERIES
+-- ======================================
+
+-- Check total counts
+SELECT "`Categories" as type, COUNT(*) as count FROM "Category"
+UNION ALL
+SELECT "`Products" as type, COUNT(*) as count FROM "Product";
+
+-- View categories with product counts
+SELECT
+ c.name as category_name,
+ c.slug as category_slug,
+ COUNT(p.id) as product_count
+FROM "Category" c
+LEFT JOIN "Product" p ON c.slug = p."categorySlug"
+GROUP BY c.id, c.name, c.slug
+ORDER BY product_count DESC, c.name;
+
+-- View sample products with pricing
+SELECT
+ p.name as product_name,
+ ROUND(p.price / 100.0, 2) as price_usd,
+ ROUND(p.price * 23.0, 0) as price_tzs,
+ c.name as category,
+ array_length(p.colors, 1) as color_options,
+ array_length(p.sizes, 1) as size_options
+FROM "Product" p
+JOIN "Category" c ON p."categorySlug" = c.slug
+ORDER BY p.price DESC
+LIMIT 15;
diff --git a/packages/kafka/docker-compose.yml b/packages/kafka/docker-compose.yml
index 3d2ebf8a..5ceca4f9 100644
--- a/packages/kafka/docker-compose.yml
+++ b/packages/kafka/docker-compose.yml
@@ -1,69 +1,83 @@
services:
kafka-broker-1:
- image: bitnami/kafka:latest
+ image: confluentinc/cp-kafka:7.4.0
container_name: kafka-broker-1
environment:
- KAFKA_ENABLE_KRAFT: "yes"
- KAFKA_CFG_NODE_ID: 1
- KAFKA_CFG_PROCESS_ROLES: broker,controller
- KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://0.0.0.0:9094
- KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka-broker-1:9092,EXTERNAL://localhost:9094
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@kafka-broker-1:9093,2@kafka-broker-2:9093,3@kafka-broker-3:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT
- KAFKA_KRAFT_CLUSTER_ID: 7Dvn0OLMQo-bg4qmCmflVg
- ALLOW_PLAINTEXT_LISTENER: "yes"
+ KAFKA_NODE_ID: 1
+ KAFKA_PROCESS_ROLES: 'broker,controller'
+ KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka-broker-1:29093,2@kafka-broker-2:29093,3@kafka-broker-3:29093'
+ KAFKA_LISTENERS: 'PLAINTEXT://kafka-broker-1:29092,CONTROLLER://kafka-broker-1:29093,PLAINTEXT_HOST://0.0.0.0:9094'
+ KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka-broker-1:29092,PLAINTEXT_HOST://localhost:9094'
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
+ KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
+ KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
+ CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk'
+ KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+ KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
+ KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
+ KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
ports:
- "9094:9094"
networks:
- kafka-network
+ restart: unless-stopped
+
kafka-broker-2:
- image: bitnami/kafka:latest
+ image: confluentinc/cp-kafka:7.4.0
container_name: kafka-broker-2
environment:
- KAFKA_ENABLE_KRAFT: "yes"
- KAFKA_CFG_NODE_ID: 2
- KAFKA_CFG_PROCESS_ROLES: broker,controller
- KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://0.0.0.0:9095
- KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka-broker-2:9092,EXTERNAL://localhost:9095
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@kafka-broker-1:9093,2@kafka-broker-2:9093,3@kafka-broker-3:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT
- KAFKA_KRAFT_CLUSTER_ID: 7Dvn0OLMQo-bg4qmCmflVg
- ALLOW_PLAINTEXT_LISTENER: "yes"
+ KAFKA_NODE_ID: 2
+ KAFKA_PROCESS_ROLES: 'broker,controller'
+ KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka-broker-1:29093,2@kafka-broker-2:29093,3@kafka-broker-3:29093'
+ KAFKA_LISTENERS: 'PLAINTEXT://kafka-broker-2:29092,CONTROLLER://kafka-broker-2:29093,PLAINTEXT_HOST://0.0.0.0:9095'
+ KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka-broker-2:29092,PLAINTEXT_HOST://localhost:9095'
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
+ KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
+ KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
+ CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk'
+ KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+ KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
+ KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
+ KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
ports:
- "9095:9095"
networks:
- kafka-network
+ restart: unless-stopped
+
kafka-broker-3:
- image: bitnami/kafka:latest
+ image: confluentinc/cp-kafka:7.4.0
container_name: kafka-broker-3
environment:
- KAFKA_ENABLE_KRAFT: "yes"
- KAFKA_CFG_NODE_ID: 3
- KAFKA_CFG_PROCESS_ROLES: broker,controller
- KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://0.0.0.0:9096
- KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka-broker-3:9092,EXTERNAL://localhost:9096
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@kafka-broker-1:9093,2@kafka-broker-2:9093,3@kafka-broker-3:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT
- KAFKA_KRAFT_CLUSTER_ID: 7Dvn0OLMQo-bg4qmCmflVg
- ALLOW_PLAINTEXT_LISTENER: "yes"
+ KAFKA_NODE_ID: 3
+ KAFKA_PROCESS_ROLES: 'broker,controller'
+ KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka-broker-1:29093,2@kafka-broker-2:29093,3@kafka-broker-3:29093'
+ KAFKA_LISTENERS: 'PLAINTEXT://kafka-broker-3:29092,CONTROLLER://kafka-broker-3:29093,PLAINTEXT_HOST://0.0.0.0:9096'
+ KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka-broker-3:29092,PLAINTEXT_HOST://localhost:9096'
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
+ KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
+ KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
+ CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk'
+ KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+ KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
+ KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
+ KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
ports:
- "9096:9096"
networks:
- kafka-network
+ restart: unless-stopped
+
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: kafka-ui
environment:
KAFKA_CLUSTERS_0_NAME: local-cluster
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka-broker-1:9092,kafka-broker-2:9092,kafka-broker-3:9092
+ KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka-broker-1:29092,kafka-broker-2:29092,kafka-broker-3:29092
KAFKA_CLUSTERS_0_READONLY: false
- KAFKA_CLUSTERS_0_TOPIC_AUTO_CREATE: true
ports:
- "8080:8080"
depends_on:
@@ -72,6 +86,7 @@ services:
- kafka-broker-3
networks:
- kafka-network
+ restart: unless-stopped
networks:
kafka-network:
diff --git a/packages/order-db/src/connection.ts b/packages/order-db/src/connection.ts
index ad20ec4d..b86f5ede 100644
--- a/packages/order-db/src/connection.ts
+++ b/packages/order-db/src/connection.ts
@@ -10,11 +10,22 @@ export const connectOrderDB = async () => {
}
try {
- await mongoose.connect(process.env.MONGO_URL);
+ // Optimized connection options for MongoDB Atlas Serverless
+ await mongoose.connect(process.env.MONGO_URL, {
+ // Connection pool settings optimized for serverless
+ maxPoolSize: 10, // Maintain up to 10 socket connections
+ serverSelectionTimeoutMS: 5000, // Keep trying to send operations for 5 seconds
+ socketTimeoutMS: 45000, // Close sockets after 45 seconds of inactivity
+ family: 4, // Use IPv4, skip trying IPv6
+ // Serverless-friendly options
+ retryWrites: true,
+ w: 'majority'
+ });
+
isConnected = true;
- console.log("Connected to MongoDB");
+ console.log("Connected to MongoDB Atlas Serverless");
} catch (error) {
- console.log(error);
+ console.log("MongoDB connection error:", error);
throw error;
}
};
diff --git a/packages/product-db/prisma/schema.prisma b/packages/product-db/prisma/schema.prisma
index 78daa622..bad2710f 100644
--- a/packages/product-db/prisma/schema.prisma
+++ b/packages/product-db/prisma/schema.prisma
@@ -4,8 +4,9 @@ generator client {
}
datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
+ provider = "postgresql"
+ url = env("DATABASE_URL")
+ directUrl = env("DIRECT_URL")
}
model Product {
diff --git a/packages/product-db/seed.js b/packages/product-db/seed.js
new file mode 100644
index 00000000..b549a1c6
--- /dev/null
+++ b/packages/product-db/seed.js
@@ -0,0 +1,121 @@
+import { PrismaClient } from './generated/prisma/index.js';
+
+const prisma = new PrismaClient();
+
+async function main() {
+ console.log('Creating categories...');
+
+ // Create categories first
+ await prisma.category.createMany({
+ data: [
+ { name: 'Shirts', slug: 'shirts' },
+ { name: 'Hoodies', slug: 'hoodies' },
+ { name: 'Sneakers', slug: 'sneakers' },
+ { name: 'Jackets', slug: 'jackets' },
+ { name: 'Accessories', slug: 'accessories' },
+ ],
+ skipDuplicates: true,
+ });
+
+ console.log('Creating products...');
+
+ // Create products
+ await prisma.product.createMany({
+ data: [
+ {
+ name: 'Adidas CoreFit T-Shirt',
+ shortDescription: 'Comfortable cotton t-shirt perfect for everyday wear and light workouts.',
+ description: 'The Adidas CoreFit T-Shirt combines style and comfort with its premium cotton blend fabric. Features the iconic Adidas logo and comes in multiple colors. Perfect for casual wear, gym sessions, or layering. Machine washable and designed to maintain its shape and color after multiple washes.',
+ price: 3990,
+ sizes: ['s', 'm', 'l', 'xl', 'xxl'],
+ colors: ['gray', 'purple', 'green'],
+ images: {
+ gray: '/products/1g.png',
+ purple: '/products/1p.png',
+ green: '/products/1gr.png',
+ },
+ categorySlug: 'shirts',
+ },
+ {
+ name: 'Puma Ultra Warm Zip',
+ shortDescription: 'Thermal zip-up hoodie designed for cold weather and active lifestyle.',
+ description: 'Stay warm and comfortable with the Puma Ultra Warm Zip hoodie. Features advanced thermal technology, moisture-wicking fabric, and a convenient full-zip design. Perfect for outdoor activities, running, or casual wear during colder months. Includes front pockets and adjustable hood.',
+ price: 5990,
+ sizes: ['s', 'm', 'l', 'xl'],
+ colors: ['gray', 'green'],
+ images: {
+ gray: '/products/2g.png',
+ green: '/products/2gr.png',
+ },
+ categorySlug: 'hoodies',
+ },
+ {
+ name: 'Nike Air Essentials Pullover',
+ shortDescription: 'Classic pullover hoodie with Nike Air branding and premium comfort.',
+ description: 'The Nike Air Essentials Pullover brings timeless style and modern comfort. Made with soft fleece fabric and featuring the classic Nike Air logo. Includes a spacious kangaroo pocket and adjustable drawstring hood. Perfect for layering or wearing solo.',
+ price: 6990,
+ sizes: ['s', 'm', 'l'],
+ colors: ['green', 'blue', 'black'],
+ images: {
+ green: '/products/3gr.png',
+ blue: '/products/3b.png',
+ black: '/products/3bl.png',
+ },
+ categorySlug: 'hoodies',
+ },
+ {
+ name: 'Nike Dri Flex T-Shirt',
+ shortDescription: 'Moisture-wicking performance t-shirt for active individuals.',
+ description: 'Experience superior comfort and performance with the Nike Dri Flex T-Shirt. Features Nike\'s advanced Dri-FIT technology to keep you dry and comfortable during intense workouts. Lightweight, breathable fabric with a modern athletic fit.',
+ price: 2990,
+ sizes: ['s', 'm', 'l'],
+ colors: ['white', 'pink'],
+ images: {
+ white: '/products/4w.png',
+ pink: '/products/4p.png',
+ },
+ categorySlug: 'shirts',
+ },
+ {
+ name: 'Under Armour StormFleece',
+ shortDescription: 'Weather-resistant fleece jacket for outdoor adventures.',
+ description: 'The Under Armour StormFleece jacket combines warmth with weather protection. Features UA Storm technology to repel water while maintaining breathability. Perfect for hiking, running, or any outdoor activity. Includes zippered pockets and adjustable cuffs.',
+ price: 4990,
+ sizes: ['s', 'm', 'l'],
+ colors: ['red', 'orange', 'black'],
+ images: {
+ red: '/products/5r.png',
+ orange: '/products/5o.png',
+ black: '/products/5bl.png',
+ },
+ categorySlug: 'jackets',
+ },
+ {
+ name: 'Nike Air Force Sneakers',
+ shortDescription: 'Classic basketball-inspired sneakers with modern comfort technology.',
+ description: 'Step into style with the iconic Nike Air Force sneakers. Features premium leather upper, Air-Sole unit for cushioning, and the timeless silhouette that\'s been a favorite for decades. Perfect for casual wear, streetwear, or light athletic activities.',
+ price: 8990,
+ sizes: ['37', '38', '39', '40', '41', '42', '43', '44'],
+ colors: ['white', 'black', 'gray'],
+ images: {
+ white: '/products/6w.png',
+ black: '/products/6bl.png',
+ gray: '/products/6g.png',
+ },
+ categorySlug: 'sneakers',
+ },
+ ],
+ skipDuplicates: true,
+ });
+
+ console.log('Sample data inserted successfully!');
+}
+
+main()
+ .catch((e) => {
+ console.error('Error inserting sample data:', e);
+ process.exit(1);
+ })
+ .finally(async () => {
+ await prisma.$disconnect();
+ });
\ No newline at end of file
diff --git a/packages/product-db/seed.sql b/packages/product-db/seed.sql
new file mode 100644
index 00000000..d720882c
--- /dev/null
+++ b/packages/product-db/seed.sql
@@ -0,0 +1,79 @@
+-- Insert Categories first (required for foreign key relationship)
+INSERT INTO "Category" (name, slug) VALUES
+('Shirts', 'shirts'),
+('Hoodies', 'hoodies'),
+('Sneakers', 'sneakers'),
+('Jackets', 'jackets'),
+('Accessories', 'accessories');
+
+-- Insert Products
+INSERT INTO "Product" (
+ name,
+ "shortDescription",
+ description,
+ price,
+ sizes,
+ colors,
+ images,
+ "categorySlug"
+) VALUES
+(
+ 'Adidas CoreFit T-Shirt',
+ 'Comfortable cotton t-shirt perfect for everyday wear and light workouts.',
+ 'The Adidas CoreFit T-Shirt combines style and comfort with its premium cotton blend fabric. Features the iconic Adidas logo and comes in multiple colors. Perfect for casual wear, gym sessions, or layering. Machine washable and designed to maintain its shape and color after multiple washes.',
+ 3990,
+ ARRAY['s', 'm', 'l', 'xl', 'xxl'],
+ ARRAY['gray', 'purple', 'green'],
+ '{"gray": "/products/1g.png", "purple": "/products/1p.png", "green": "/products/1gr.png"}',
+ 'shirts'
+),
+(
+ 'Puma Ultra Warm Zip',
+ 'Thermal zip-up hoodie designed for cold weather and active lifestyle.',
+ 'Stay warm and comfortable with the Puma Ultra Warm Zip hoodie. Features advanced thermal technology, moisture-wicking fabric, and a convenient full-zip design. Perfect for outdoor activities, running, or casual wear during colder months. Includes front pockets and adjustable hood.',
+ 5990,
+ ARRAY['s', 'm', 'l', 'xl'],
+ ARRAY['gray', 'green'],
+ '{"gray": "/products/2g.png", "green": "/products/2gr.png"}',
+ 'hoodies'
+),
+(
+ 'Nike Air Essentials Pullover',
+ 'Classic pullover hoodie with Nike Air branding and premium comfort.',
+ 'The Nike Air Essentials Pullover brings timeless style and modern comfort. Made with soft fleece fabric and featuring the classic Nike Air logo. Includes a spacious kangaroo pocket and adjustable drawstring hood. Perfect for layering or wearing solo.',
+ 6990,
+ ARRAY['s', 'm', 'l'],
+ ARRAY['green', 'blue', 'black'],
+ '{"green": "/products/3gr.png", "blue": "/products/3b.png", "black": "/products/3bl.png"}',
+ 'hoodies'
+),
+(
+ 'Nike Dri Flex T-Shirt',
+ 'Moisture-wicking performance t-shirt for active individuals.',
+ 'Experience superior comfort and performance with the Nike Dri Flex T-Shirt. Features Nike''s advanced Dri-FIT technology to keep you dry and comfortable during intense workouts. Lightweight, breathable fabric with a modern athletic fit.',
+ 2990,
+ ARRAY['s', 'm', 'l'],
+ ARRAY['white', 'pink'],
+ '{"white": "/products/4w.png", "pink": "/products/4p.png"}',
+ 'shirts'
+),
+(
+ 'Under Armour StormFleece',
+ 'Weather-resistant fleece jacket for outdoor adventures.',
+ 'The Under Armour StormFleece jacket combines warmth with weather protection. Features UA Storm technology to repel water while maintaining breathability. Perfect for hiking, running, or any outdoor activity. Includes zippered pockets and adjustable cuffs.',
+ 4990,
+ ARRAY['s', 'm', 'l'],
+ ARRAY['red', 'orange', 'black'],
+ '{"red": "/products/5r.png", "orange": "/products/5o.png", "black": "/products/5bl.png"}',
+ 'jackets'
+),
+(
+ 'Nike Air Force Sneakers',
+ 'Classic basketball-inspired sneakers with modern comfort technology.',
+ 'Step into style with the iconic Nike Air Force sneakers. Features premium leather upper, Air-Sole unit for cushioning, and the timeless silhouette that''s been a favorite for decades. Perfect for casual wear, streetwear, or light athletic activities.',
+ 8990,
+ ARRAY['37', '38', '39', '40', '41', '42', '43', '44'],
+ ARRAY['white', 'black', 'gray'],
+ '{"white": "/products/6w.png", "black": "/products/6bl.png", "gray": "/products/6g.png"}',
+ 'sneakers'
+);
\ No newline at end of file
diff --git a/packages/product-db/src/client.ts b/packages/product-db/src/client.ts
index 92cb5aa5..41063bfc 100644
--- a/packages/product-db/src/client.ts
+++ b/packages/product-db/src/client.ts
@@ -3,6 +3,10 @@ import { PrismaClient } from "../generated/prisma";
const globalForPrisma = global as unknown as { prisma: PrismaClient };
export const prisma =
- globalForPrisma.prisma || new PrismaClient();
+ globalForPrisma.prisma ||
+ new PrismaClient({
+ datasourceUrl: process.env.DATABASE_URL,
+ log: process.env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
+ });
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
\ No newline at end of file
diff --git a/packages/types/src/product.ts b/packages/types/src/product.ts
index 66362bda..6a7260d9 100644
--- a/packages/types/src/product.ts
+++ b/packages/types/src/product.ts
@@ -12,6 +12,7 @@ export type StripeProductType = {
};
export const colors = [
+ // Traditional colors
"blue",
"green",
"red",
@@ -23,30 +24,52 @@ export const colors = [
"gray",
"black",
"white",
+
+ // Tech product colors
+ "Natural Titanium",
+ "Blue Titanium",
+ "White Titanium",
+ "Black Titanium",
+ "Titanium Gray",
+ "Titanium Black",
+ "Titanium Violet",
+ "Titanium Yellow",
+ "Space Black",
+ "Silver",
+ "Platinum Silver",
+ "Graphite",
+ "Off Black",
+ "Storm Grey",
+ "White Smoke",
+ "Moonstone Blue",
+ "Pale Gray",
+ "Off-White",
+ "Dark Grey",
+ "Natural",
+ "Platinum",
+ "Sapphire",
+ "Dune",
+ "Black/Cyan",
+ "White/Black",
] as const;
export const sizes = [
+ // Traditional clothing sizes
"xs",
- "s",
+ "s",
"m",
"l",
"xl",
"xxl",
- "34",
- "35",
- "36",
- "37",
- "38",
- "39",
- "40",
- "41",
- "42",
- "43",
- "44",
- "45",
- "46",
- "47",
- "48",
+
+ // Shoe sizes
+ "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48",
+
+ // Tech product sizes/capacities
+ "128GB", "256GB", "512GB", "1TB", "2TB", "4TB",
+ "Standard", "Compact", "Tenkeyless",
+ "27-inch", "32-inch",
+ "43mm", "47mm", "49mm",
] as const;
export const ProductFormSchema = z
diff --git a/turbo.json b/turbo.json
index 2359d4f2..89455422 100644
--- a/turbo.json
+++ b/turbo.json
@@ -1,5 +1,6 @@
{
"$schema": "https://turborepo.com/schema.json",
+ "ui": "tui",
"tasks": {
"build": {
"dependsOn": ["^build"],