diff --git a/QatarPOS/.gitignore b/QatarPOS/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..f9ba7f8b4901d059a522d76272612aa2a8321bc3
--- /dev/null
+++ b/QatarPOS/.gitignore
@@ -0,0 +1,6 @@
+node_modules
+dist
+.DS_Store
+server/public
+vite.config.ts.*
+*.tar.gz
\ No newline at end of file
diff --git a/QatarPOS/.replit b/QatarPOS/.replit
new file mode 100644
index 0000000000000000000000000000000000000000..51f344ffac11f3c19cd01f940721e073a6ab4c1d
--- /dev/null
+++ b/QatarPOS/.replit
@@ -0,0 +1,36 @@
+modules = ["nodejs-20", "web", "postgresql-16"]
+run = "npm run dev"
+hidden = [".config", ".git", "generated-icon.png", "node_modules", "dist"]
+
+[nix]
+channel = "stable-24_05"
+
+[deployment]
+deploymentTarget = "autoscale"
+build = ["npm", "run", "build"]
+run = ["npm", "run", "start"]
+
+[[ports]]
+localPort = 5000
+externalPort = 80
+
+[workflows]
+runButton = "Project"
+
+[[workflows.workflow]]
+name = "Project"
+mode = "parallel"
+author = "agent"
+
+[[workflows.workflow.tasks]]
+task = "workflow.run"
+args = "Start application"
+
+[[workflows.workflow]]
+name = "Start application"
+author = "agent"
+
+[[workflows.workflow.tasks]]
+task = "shell.exec"
+args = "npm run dev"
+waitForPort = 5000
diff --git a/QatarPOS/attached_assets/Pasted-You-are-a-senior-full-stack-developer-Generate-a-multi-tenant-cloud-native-Point-of-Sale-POS-mic-1752578171314_1752578171315.txt b/QatarPOS/attached_assets/Pasted-You-are-a-senior-full-stack-developer-Generate-a-multi-tenant-cloud-native-Point-of-Sale-POS-mic-1752578171314_1752578171315.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e0027dc18343b9ee3f854d59f2a8827262b6f423
--- /dev/null
+++ b/QatarPOS/attached_assets/Pasted-You-are-a-senior-full-stack-developer-Generate-a-multi-tenant-cloud-native-Point-of-Sale-POS-mic-1752578171314_1752578171315.txt
@@ -0,0 +1,36 @@
+You are a senior full‐stack developer. Generate a multi‐tenant, cloud‐native Point-of-Sale (POS) microservice that integrates seamlessly into a GCC-focused ERP system (initial focus: Qatar).
+
+Functional Requirements:
+- Order Management: quick-serve and table-service workflows, table mapping, split/bill transfers
+- Inventory Control: real-time stock tracking, barcode/QR scanning, low-stock alerts
+- Pricing & Promotions: tiered pricing, time-based discounts (e.g., happy hour), bundle offers, coupon codes
+- Payments & Receipts: cash, card, mobile wallet; fiscal receipt formats compliant with Qatari regulations; email/SMS e-receipts
+- Offline Mode & Sync: local cache via IndexedDB, automatic two-way data reconciliation when back online
+- Multi-store & Terminal: centralized dashboard, individual terminal login with RBAC (cashier, manager)
+
+Non-Functional Requirements:
+- Microservices architecture (Docker, Kubernetes) with API-first design (OpenAPI/Swagger)
+- Domain-Driven Design and clear module boundaries
+- Multi-tenant support (separate schemas per tenant or tenant_id isolation)
+- High availability and horizontal scalability on AWS/Azure/GCP
+- JWT authentication, encryption at rest and in transit, OWASP security best practices
+- Logging & Monitoring (ELK stack, Prometheus/Grafana)
+
+Tech Stack:
+- Front-end: React + Next.js, TypeScript, react-i18next for bilingual (RTL/LTR) UI, IndexedDB for offline
+- Back-end: NestJS (TypeScript) or Django + DRF (Python), PostgreSQL with partitioned tables, Redis for caching & job queuing
+- DevOps: Docker & Helm charts, Kubernetes (EKS/AKS/GKE), Terraform for IaC, GitHub Actions CI/CD
+- Testing: Jest for unit tests, Cypress for e2e, Supertest for API integration tests
+
+Deliverables:
+1. Project scaffold with folder structure, package manifests, Dockerfiles, Helm charts
+2. Database schema (SQL migrations and ER diagrams for stores, terminals, products, orders, payments, promotions)
+3. RESTful API endpoints with full Swagger/OpenAPI docs
+4. Responsive React/Next.js UI components for desktop/tablet POS screens
+5. Offline sync logic with IndexedDB caching and conflict resolution
+6. Role-based RBAC middleware and JWT auth flows
+7. Automated test suites with coverage reports
+8. CI/CD pipeline configurations (build, test, deploy)
+9. Deployment guides for cloud environments
+
+Ensure production-ready code, clear inline comments, and comprehensive README with setup instructions, environment variables, and architectural overview. Localize all UI text and date/number formats for Arabic/English support.
\ No newline at end of file
diff --git a/QatarPOS/client/index.html b/QatarPOS/client/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..4b4d09e3151713b7af7e8d38dd2bac2a27d5a7ee
--- /dev/null
+++ b/QatarPOS/client/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/butter-chicken.svg b/QatarPOS/client/public/images/butter-chicken.svg
new file mode 100644
index 0000000000000000000000000000000000000000..ac29c491a18f3712b050d16df36941365746ddf5
--- /dev/null
+++ b/QatarPOS/client/public/images/butter-chicken.svg
@@ -0,0 +1,33 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/chicken-biryani.svg b/QatarPOS/client/public/images/chicken-biryani.svg
new file mode 100644
index 0000000000000000000000000000000000000000..0cefae982346435e5e8e1f08ba737e07beb408e1
--- /dev/null
+++ b/QatarPOS/client/public/images/chicken-biryani.svg
@@ -0,0 +1,46 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/dal-makhani.svg b/QatarPOS/client/public/images/dal-makhani.svg
new file mode 100644
index 0000000000000000000000000000000000000000..56212219b2649e399d88b01d53a2d4d18018ef50
--- /dev/null
+++ b/QatarPOS/client/public/images/dal-makhani.svg
@@ -0,0 +1,43 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/garlic-naan.svg b/QatarPOS/client/public/images/garlic-naan.svg
new file mode 100644
index 0000000000000000000000000000000000000000..7c58245f764416c56306511067c73162a45ee513
--- /dev/null
+++ b/QatarPOS/client/public/images/garlic-naan.svg
@@ -0,0 +1,44 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/gulab-jamun.svg b/QatarPOS/client/public/images/gulab-jamun.svg
new file mode 100644
index 0000000000000000000000000000000000000000..f30b632f6f1abb416b6b2215c2261a0688f8f8a1
--- /dev/null
+++ b/QatarPOS/client/public/images/gulab-jamun.svg
@@ -0,0 +1,44 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/lamb-rogan-josh.svg b/QatarPOS/client/public/images/lamb-rogan-josh.svg
new file mode 100644
index 0000000000000000000000000000000000000000..8705899f12f45ecded3ba23013bfacb54177459b
--- /dev/null
+++ b/QatarPOS/client/public/images/lamb-rogan-josh.svg
@@ -0,0 +1,37 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/mango-lassi.svg b/QatarPOS/client/public/images/mango-lassi.svg
new file mode 100644
index 0000000000000000000000000000000000000000..f26bcfa189bee17617f3f4cb7ab01f52c4217b22
--- /dev/null
+++ b/QatarPOS/client/public/images/mango-lassi.svg
@@ -0,0 +1,43 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/masala-tea.svg b/QatarPOS/client/public/images/masala-tea.svg
new file mode 100644
index 0000000000000000000000000000000000000000..a60462b9fbe6a100e4b7112304fb50d99ff0f4f6
--- /dev/null
+++ b/QatarPOS/client/public/images/masala-tea.svg
@@ -0,0 +1,49 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/pakora.svg b/QatarPOS/client/public/images/pakora.svg
new file mode 100644
index 0000000000000000000000000000000000000000..a061eea01a955fc9cd4402a2df2ba0ce7ac0cd84
--- /dev/null
+++ b/QatarPOS/client/public/images/pakora.svg
@@ -0,0 +1,47 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/paneer-tikka.svg b/QatarPOS/client/public/images/paneer-tikka.svg
new file mode 100644
index 0000000000000000000000000000000000000000..5348073f8c5253aec030473c91b90e757a5d33ca
--- /dev/null
+++ b/QatarPOS/client/public/images/paneer-tikka.svg
@@ -0,0 +1,54 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/plain-naan.svg b/QatarPOS/client/public/images/plain-naan.svg
new file mode 100644
index 0000000000000000000000000000000000000000..205fc27b97142b10c86397eaecad014a93ad0c5e
--- /dev/null
+++ b/QatarPOS/client/public/images/plain-naan.svg
@@ -0,0 +1,37 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/public/images/samosa.svg b/QatarPOS/client/public/images/samosa.svg
new file mode 100644
index 0000000000000000000000000000000000000000..609312a27082da41863c7340e7a719081a140d0d
--- /dev/null
+++ b/QatarPOS/client/public/images/samosa.svg
@@ -0,0 +1,42 @@
+
\ No newline at end of file
diff --git a/QatarPOS/client/src/App.tsx b/QatarPOS/client/src/App.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..17e538222b2a68862a6bb52dec40373552699d0a
--- /dev/null
+++ b/QatarPOS/client/src/App.tsx
@@ -0,0 +1,54 @@
+import { Switch, Route } from "wouter";
+import { queryClient } from "./lib/queryClient";
+import { QueryClientProvider } from "@tanstack/react-query";
+import { Toaster } from "@/components/ui/toaster";
+import { TooltipProvider } from "@/components/ui/tooltip";
+import { useAuth } from "@/hooks/useAuth";
+import { POSProvider } from "@/contexts/POSContext";
+import NotFound from "@/pages/not-found";
+import Landing from "@/pages/Landing";
+import POS from "@/pages/POS";
+import TableService from "@/pages/TableService";
+import Inventory from "@/pages/Inventory";
+import Reports from "@/pages/Reports";
+import { useEffect } from "react";
+import { offlineStore } from "@/lib/offlineStore";
+
+function Router() {
+ const { isAuthenticated, isLoading } = useAuth();
+
+ return (
+
+ {isLoading || !isAuthenticated ? (
+
+ ) : (
+
+
+
+
+
+
+
+ )}
+
+
+ );
+}
+
+function App() {
+ useEffect(() => {
+ // Initialize offline store on app start
+ offlineStore.init().catch(console.error);
+ }, []);
+
+ return (
+
+
+
+
+
+
+ );
+}
+
+export default App;
diff --git a/QatarPOS/client/src/components/BarcodeScanner.tsx b/QatarPOS/client/src/components/BarcodeScanner.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..2b5dd3aa612a4d2796c36947969d97032d500590
--- /dev/null
+++ b/QatarPOS/client/src/components/BarcodeScanner.tsx
@@ -0,0 +1,196 @@
+import { useState, useEffect, useRef } from "react";
+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { useTranslation } from "@/lib/i18n";
+import { Camera, X, Type } from "lucide-react";
+
+interface BarcodeScannerProps {
+ onScan: (barcode: string) => void;
+ onClose: () => void;
+}
+
+export function BarcodeScanner({ onScan, onClose }: BarcodeScannerProps) {
+ const { t, direction } = useTranslation();
+ const [manualEntry, setManualEntry] = useState("");
+ const [isManualMode, setIsManualMode] = useState(false);
+ const [hasCamera, setHasCamera] = useState(true);
+ const videoRef = useRef(null);
+ const streamRef = useRef(null);
+
+ useEffect(() => {
+ if (!isManualMode) {
+ startCamera();
+ }
+
+ return () => {
+ stopCamera();
+ };
+ }, [isManualMode]);
+
+ const startCamera = async () => {
+ try {
+ const stream = await navigator.mediaDevices.getUserMedia({
+ video: {
+ facingMode: 'environment',
+ width: { ideal: 1280 },
+ height: { ideal: 720 }
+ }
+ });
+
+ streamRef.current = stream;
+ if (videoRef.current) {
+ videoRef.current.srcObject = stream;
+ }
+ } catch (error) {
+ console.error('Error accessing camera:', error);
+ setHasCamera(false);
+ setIsManualMode(true);
+ }
+ };
+
+ const stopCamera = () => {
+ if (streamRef.current) {
+ streamRef.current.getTracks().forEach(track => track.stop());
+ streamRef.current = null;
+ }
+ };
+
+ const handleManualSubmit = () => {
+ if (manualEntry.trim()) {
+ onScan(manualEntry.trim());
+ }
+ };
+
+ const handleKeyPress = (e: React.KeyboardEvent) => {
+ if (e.key === 'Enter') {
+ handleManualSubmit();
+ }
+ };
+
+ // Simulate barcode detection (in a real app, you'd use a barcode scanning library)
+ const simulateBarcodeDetection = () => {
+ // This is a placeholder for actual barcode scanning
+ // In production, you would integrate with a library like @zxing/browser
+ const mockBarcode = "1234567890123";
+ onScan(mockBarcode);
+ };
+
+ return (
+
+ );
+}
diff --git a/QatarPOS/client/src/components/OrderSummary.tsx b/QatarPOS/client/src/components/OrderSummary.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..b9b8112c1112262b93e2c0a8c0c35864f93f77c4
--- /dev/null
+++ b/QatarPOS/client/src/components/OrderSummary.tsx
@@ -0,0 +1,374 @@
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Badge } from "@/components/ui/badge";
+import { Input } from "@/components/ui/input";
+import { Textarea } from "@/components/ui/textarea";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
+import { ReceiptModal } from "@/components/ReceiptModal";
+import { usePOS } from "@/contexts/POSContext";
+import { useTranslation } from "@/lib/i18n";
+import { useToast } from "@/hooks/use-toast";
+import {
+ Trash2,
+ Edit,
+ Minus,
+ Plus,
+ CreditCard,
+ Banknote,
+ Smartphone,
+ Scissors,
+ Check,
+ Pause,
+ User
+} from "lucide-react";
+
+export function OrderSummary() {
+ const { state, actions } = usePOS();
+ const { t, direction, formatCurrency } = useTranslation();
+ const { toast } = useToast();
+ const [showReceipt, setShowReceipt] = useState(false);
+ const [customerInfo, setCustomerInfo] = useState({
+ name: "",
+ phone: "",
+ email: ""
+ });
+ const [orderNotes, setOrderNotes] = useState("");
+ const [paymentMethod, setPaymentMethod] = useState("cash");
+
+ const { currentOrder } = state;
+
+ const handleQuantityChange = (itemId: string, newQuantity: number) => {
+ if (newQuantity <= 0) {
+ actions.removeFromCart(itemId);
+ } else {
+ actions.updateCartItem(itemId, newQuantity);
+ }
+ };
+
+ const handleOrderTypeChange = (type: 'dine_in' | 'takeaway' | 'delivery') => {
+ actions.setOrderType(type);
+ };
+
+ const handleCustomerInfoChange = (field: string, value: string) => {
+ const updated = { ...customerInfo, [field]: value };
+ setCustomerInfo(updated);
+ actions.setCustomerInfo(updated);
+ };
+
+ const handleNotesChange = (notes: string) => {
+ setOrderNotes(notes);
+ actions.setOrderNotes(notes);
+ };
+
+ const handleCompleteOrder = async () => {
+ if (!currentOrder || currentOrder.items.length === 0) {
+ toast({
+ title: t('message.error'),
+ description: direction === 'rtl' ? 'لا توجد عناصر في الطلب' : 'No items in order',
+ variant: "destructive",
+ });
+ return;
+ }
+
+ try {
+ await actions.completeOrder();
+ setShowReceipt(true);
+ // Reset form
+ setCustomerInfo({ name: "", phone: "", email: "" });
+ setOrderNotes("");
+ setPaymentMethod("cash");
+ } catch (error) {
+ console.error('Error completing order:', error);
+ }
+ };
+
+ const handleHoldOrder = async () => {
+ if (!currentOrder || currentOrder.items.length === 0) {
+ toast({
+ title: t('message.error'),
+ description: direction === 'rtl' ? 'لا توجد عناصر في الطلب' : 'No items in order',
+ variant: "destructive",
+ });
+ return;
+ }
+
+ await actions.holdOrder();
+ // Reset form
+ setCustomerInfo({ name: "", phone: "", email: "" });
+ setOrderNotes("");
+ };
+
+ const getOrderTypeLabel = (type: string) => {
+ switch (type) {
+ case 'dine_in':
+ return direction === 'rtl' ? 'تناول في المكان' : 'Dine In';
+ case 'takeaway':
+ return direction === 'rtl' ? 'طلبات خارجية' : 'Takeaway';
+ case 'delivery':
+ return direction === 'rtl' ? 'توصيل' : 'Delivery';
+ default:
+ return direction === 'rtl' ? 'تناول في المكان' : 'Dine In';
+ }
+ };
+
+ if (!currentOrder) {
+ return (
+
+
+
+ {direction === 'rtl' ? 'لا يوجد طلب نشط' : 'No active order'}
+
+
+ {direction === 'rtl'
+ ? 'أضف منتجات لبدء طلب جديد'
+ : 'Add products to start a new order'
+ }
+
+
+
+ );
+ }
+
+ return (
+
+ {/* Order Header */}
+
+
+
+ {t('order.current_order')}
+
+
+
+
+
+
+
+
+ {state.selectedTable ? `${t('order.table')} ${state.selectedTable.name}` : getOrderTypeLabel(currentOrder.type)}
+
+
+
+
+
+
+ {/* Order Type Selection */}
+
+
+
+
+ {/* Order Items */}
+
+ {currentOrder.items.length > 0 ? (
+
+ {currentOrder.items.map((item) => (
+
+
+
+ {direction === 'rtl' && item.nameAr ? item.nameAr : item.name}
+
+
+ {formatCurrency(parseFloat(item.price))}
+
+ {item.notes && (
+
{item.notes}
+ )}
+
+
+
+
{item.quantity}
+
+
+
+ ))}
+
+ ) : (
+
+ {direction === 'rtl' ? 'لا توجد عناصر في الطلب' : 'No items in order'}
+
+ )}
+
+ {/* Promotions */}
+ {parseFloat(currentOrder.discountAmount) > 0 && (
+
+
+
+ {t('promo.discount_applied')}
+
+
+ -{formatCurrency(parseFloat(currentOrder.discountAmount))}
+
+
+
+ )}
+
+ {/* Customer Information */}
+
+
+ {direction === 'rtl' ? 'معلومات العميل' : 'Customer Information'}
+
+ handleCustomerInfoChange('name', e.target.value)}
+ />
+ handleCustomerInfoChange('phone', e.target.value)}
+ />
+ handleCustomerInfoChange('email', e.target.value)}
+ />
+
+
+
+ {/* Order Total */}
+
+
+ {t('order.subtotal')}:
+ {formatCurrency(parseFloat(currentOrder.subtotal))}
+
+
+ {parseFloat(currentOrder.discountAmount) > 0 && (
+
+ {t('order.discount')}:
+ -{formatCurrency(parseFloat(currentOrder.discountAmount))}
+
+ )}
+
+
+ {t('order.tax')} (5%):
+ {formatCurrency(parseFloat(currentOrder.taxAmount))}
+
+
+
+ {t('order.total')}:
+ {formatCurrency(parseFloat(currentOrder.total))}
+
+
+
+ {/* Payment Methods */}
+
+
+ {t('payment.method')}
+
+
+
+
+
+
+
+
+ {/* Action Buttons */}
+
+
+
+
+
+
+ {/* Receipt Modal */}
+ {showReceipt && currentOrder && (
+
setShowReceipt(false)}
+ />
+ )}
+
+ );
+}
diff --git a/QatarPOS/client/src/components/POSHeader.tsx b/QatarPOS/client/src/components/POSHeader.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..d9e4463adbd07a4ccbc34c91a31b9d05b8184f98
--- /dev/null
+++ b/QatarPOS/client/src/components/POSHeader.tsx
@@ -0,0 +1,131 @@
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
+import { Badge } from "@/components/ui/badge";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger
+} from "@/components/ui/dropdown-menu";
+import { Globe, Wifi, WifiOff, ChevronDown, ScanBarcode } from "lucide-react";
+import { useAuth } from "@/hooks/useAuth";
+import { useTranslation } from "@/lib/i18n";
+import { usePOS } from "@/contexts/POSContext";
+import { useQuery } from "@tanstack/react-query";
+
+export function POSHeader() {
+ const { user } = useAuth();
+ const { t, language, toggleLanguage } = useTranslation();
+ const { state } = usePOS();
+ const [selectedStoreId, setSelectedStoreId] = useState("");
+
+ const { data: stores } = useQuery({
+ queryKey: ["/api/stores"],
+ enabled: !!user,
+ });
+
+ const selectedStore = stores?.find((store: any) => store.id === selectedStoreId);
+
+ return (
+
+
+
+
+
+
+ {t('app.title')}
+
+
+ v2.1
+
+
+
+ {/* Store Selector */}
+ {stores && stores.length > 0 && (
+
+ )}
+
+
+
+ {/* Language Toggle */}
+
+
+ {/* Connection Status */}
+
+ {state.isOnline ? (
+ <>
+
+ {t('header.online')}
+ >
+ ) : (
+ <>
+
+ {t('header.offline')}
+ >
+ )}
+
+
+ {/* Terminal Info */}
+ {state.selectedTerminal && (
+
+ {t('header.terminal')}: {state.selectedTerminal.name} |
+ {t('header.cashier')}: {user?.firstName} {user?.lastName}
+
+ )}
+
+ {/* User Profile */}
+
+
+
+
+
+
+
+
{user?.firstName} {user?.lastName}
+
{user?.email}
+
{user?.role}
+
+
+
+
+
+ {t('auth.logout')}
+
+
+
+
+
+
+
+ );
+}
diff --git a/QatarPOS/client/src/components/ProductCatalog.tsx b/QatarPOS/client/src/components/ProductCatalog.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..d14e276e9d0652b5cedd94076d323498a84a7e37
--- /dev/null
+++ b/QatarPOS/client/src/components/ProductCatalog.tsx
@@ -0,0 +1,296 @@
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Card, CardContent } from "@/components/ui/card";
+import { Badge } from "@/components/ui/badge";
+import { BarcodeScanner } from "@/components/BarcodeScanner";
+import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
+import { useAuth } from "@/hooks/useAuth";
+import { useTranslation } from "@/lib/i18n";
+import { usePOS } from "@/contexts/POSContext";
+import { useToast } from "@/hooks/use-toast";
+import { isUnauthorizedError } from "@/lib/authUtils";
+import { apiRequest } from "@/lib/queryClient";
+import { Search, Barcode, Clock, Star } from "lucide-react";
+
+export function ProductCatalog() {
+ const { user } = useAuth();
+ const { t, direction } = useTranslation();
+ const { state, actions } = usePOS();
+ const { toast } = useToast();
+ const queryClient = useQueryClient();
+ const [searchQuery, setSearchQuery] = useState("");
+ const [selectedCategory, setSelectedCategory] = useState("all");
+ const [showScanner, setShowScanner] = useState(false);
+
+ // Fetch products
+ const { data: products, isLoading: productsLoading } = useQuery({
+ queryKey: ["/api/products", selectedCategory !== "all" ? { category: selectedCategory } : {}],
+ enabled: !!user,
+ onError: (error: Error) => {
+ if (isUnauthorizedError(error)) {
+ toast({
+ title: t('message.unauthorized'),
+ description: t('message.logged_out'),
+ variant: "destructive",
+ });
+ setTimeout(() => {
+ window.location.href = "/api/login";
+ }, 500);
+ return;
+ }
+ },
+ });
+
+ // Fetch categories
+ const { data: categories } = useQuery({
+ queryKey: ["/api/categories"],
+ enabled: !!user,
+ });
+
+ // Search products mutation
+ const searchMutation = useMutation({
+ mutationFn: async (query: string) => {
+ const response = await apiRequest('GET', `/api/products/search?q=${encodeURIComponent(query)}`);
+ return response.json();
+ },
+ onError: (error: Error) => {
+ if (isUnauthorizedError(error)) {
+ toast({
+ title: t('message.unauthorized'),
+ description: t('message.logged_out'),
+ variant: "destructive",
+ });
+ setTimeout(() => {
+ window.location.href = "/api/login";
+ }, 500);
+ return;
+ }
+ },
+ });
+
+ // Barcode scan mutation
+ const barcodeMutation = useMutation({
+ mutationFn: async (barcode: string) => {
+ const response = await apiRequest('GET', `/api/products/barcode/${barcode}`);
+ return response.json();
+ },
+ onSuccess: (product) => {
+ actions.addToCart(product);
+ setShowScanner(false);
+ toast({
+ title: t('message.product_added'),
+ description: `${product.name} ${t('message.product_added')}`,
+ });
+ },
+ onError: (error: Error) => {
+ if (isUnauthorizedError(error)) {
+ toast({
+ title: t('message.unauthorized'),
+ description: t('message.logged_out'),
+ variant: "destructive",
+ });
+ setTimeout(() => {
+ window.location.href = "/api/login";
+ }, 500);
+ return;
+ }
+ toast({
+ title: t('message.error'),
+ description: "Product not found",
+ variant: "destructive",
+ });
+ },
+ });
+
+ const handleSearch = (query: string) => {
+ setSearchQuery(query);
+ if (query.trim()) {
+ searchMutation.mutate(query);
+ }
+ };
+
+ const handleBarcodeScanned = (barcode: string) => {
+ barcodeMutation.mutate(barcode);
+ };
+
+ const handleProductClick = (product: any) => {
+ if (product.stockQuantity <= 0 && product.trackInventory) {
+ toast({
+ title: t('message.error'),
+ description: t('products.out_of_stock'),
+ variant: "destructive",
+ });
+ return;
+ }
+ actions.addToCart(product);
+ };
+
+ const filteredProducts = searchQuery && searchMutation.data
+ ? searchMutation.data
+ : products?.filter((product: any) => {
+ if (!product.isActive) return false;
+ return true;
+ }) || [];
+
+ const getStockBadge = (product: any) => {
+ if (!product.trackInventory) return null;
+
+ if (product.stockQuantity <= 0) {
+ return (
+
+ {t('products.out_of_stock')}
+
+ );
+ }
+
+ if (product.stockQuantity <= product.minStockLevel) {
+ return (
+
+ {t('products.low_stock')}
+
+ );
+ }
+
+ return (
+
+ {t('products.in_stock')}
+
+ );
+ };
+
+ return (
+
+ {/* Search and Filters */}
+
+
+
+
+ handleSearch(e.target.value)}
+ className="pl-10"
+ />
+
+
+
+
+ {/* Category Filters */}
+
+
+ {categories?.map((category: any) => (
+
+ ))}
+
+
+
+ {/* Products Grid */}
+
+ {productsLoading || searchMutation.isPending ? (
+
+ ) : filteredProducts.length > 0 ? (
+
+ {filteredProducts.map((product: any) => (
+
handleProductClick(product)}
+ >
+ {product.imageUrl && (
+
+ )}
+
+
+
+ {direction === 'rtl' && product.nameAr ? product.nameAr : product.name}
+
+ {getStockBadge(product)}
+
+
+ {product.description && (
+
+ {direction === 'rtl' && product.descriptionAr ? product.descriptionAr : product.description}
+
+ )}
+
+
+
+ {t('currency.format', { amount: product.price })}
+
+ {product.trackInventory && (
+
+ {t('products.stock')}: {product.stockQuantity}
+
+ )}
+
+
+
+ ))}
+
+ ) : (
+
+ {searchQuery
+ ? (direction === 'rtl' ? 'لا توجد منتجات تطابق البحث' : 'No products match your search')
+ : (direction === 'rtl' ? 'لا توجد منتجات' : 'No products available')
+ }
+
+ )}
+
+
+ {/* Quick Action Buttons */}
+
+
+
+
+
+ {/* Barcode Scanner Modal */}
+ {showScanner && (
+
setShowScanner(false)}
+ />
+ )}
+
+ );
+}
diff --git a/QatarPOS/client/src/components/ReceiptModal.tsx b/QatarPOS/client/src/components/ReceiptModal.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..fbc2b0756bffba462a690d4b5b2390e0dc293310
--- /dev/null
+++ b/QatarPOS/client/src/components/ReceiptModal.tsx
@@ -0,0 +1,241 @@
+import { useState } from "react";
+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
+import { Button } from "@/components/ui/button";
+import { useTranslation } from "@/lib/i18n";
+import { useToast } from "@/hooks/use-toast";
+import { usePOS } from "@/contexts/POSContext";
+import { Printer, Mail, MessageSquare, X } from "lucide-react";
+
+interface ReceiptModalProps {
+ order: any;
+ onClose: () => void;
+}
+
+export function ReceiptModal({ order, onClose }: ReceiptModalProps) {
+ const { t, direction, formatCurrency, formatDate } = useTranslation();
+ const { state } = usePOS();
+ const { toast } = useToast();
+ const [isPrinting, setIsPrinting] = useState(false);
+ const [isSendingEmail, setIsSendingEmail] = useState(false);
+ const [isSendingSMS, setIsSendingSMS] = useState(false);
+
+ const handlePrint = async () => {
+ setIsPrinting(true);
+ try {
+ // In a real implementation, this would send to thermal printer
+ window.print();
+ toast({
+ title: t('message.success'),
+ description: direction === 'rtl' ? 'تم إرسال الإيصال للطباعة' : 'Receipt sent to printer',
+ });
+ } catch (error) {
+ toast({
+ title: t('message.error'),
+ description: direction === 'rtl' ? 'فشل في طباعة الإيصال' : 'Failed to print receipt',
+ variant: "destructive",
+ });
+ } finally {
+ setIsPrinting(false);
+ }
+ };
+
+ const handleEmailReceipt = async () => {
+ if (!order.customerEmail) {
+ toast({
+ title: t('message.error'),
+ description: direction === 'rtl' ? 'لا يوجد بريد إلكتروني للعميل' : 'No customer email provided',
+ variant: "destructive",
+ });
+ return;
+ }
+
+ setIsSendingEmail(true);
+ try {
+ // In a real implementation, this would call the email API
+ await new Promise(resolve => setTimeout(resolve, 2000)); // Simulate API call
+ toast({
+ title: t('message.success'),
+ description: direction === 'rtl' ? 'تم إرسال الإيصال بالبريد الإلكتروني' : 'Receipt sent via email',
+ });
+ } catch (error) {
+ toast({
+ title: t('message.error'),
+ description: direction === 'rtl' ? 'فشل في إرسال الإيصال' : 'Failed to send receipt',
+ variant: "destructive",
+ });
+ } finally {
+ setIsSendingEmail(false);
+ }
+ };
+
+ const handleSMSReceipt = async () => {
+ if (!order.customerPhone) {
+ toast({
+ title: t('message.error'),
+ description: direction === 'rtl' ? 'لا يوجد رقم هاتف للعميل' : 'No customer phone provided',
+ variant: "destructive",
+ });
+ return;
+ }
+
+ setIsSendingSMS(true);
+ try {
+ // In a real implementation, this would call the SMS API
+ await new Promise(resolve => setTimeout(resolve, 2000)); // Simulate API call
+ toast({
+ title: t('message.success'),
+ description: direction === 'rtl' ? 'تم إرسال الإيصال برسالة نصية' : 'Receipt sent via SMS',
+ });
+ } catch (error) {
+ toast({
+ title: t('message.error'),
+ description: direction === 'rtl' ? 'فشل في إرسال الإيصال' : 'Failed to send receipt',
+ variant: "destructive",
+ });
+ } finally {
+ setIsSendingSMS(false);
+ }
+ };
+
+ return (
+
+ );
+}
diff --git a/QatarPOS/client/src/components/Sidebar.tsx b/QatarPOS/client/src/components/Sidebar.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..f13f97b49152baef8b7559f12cbb296b34749a61
--- /dev/null
+++ b/QatarPOS/client/src/components/Sidebar.tsx
@@ -0,0 +1,142 @@
+import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
+import { Badge } from "@/components/ui/badge";
+import { useAuth } from "@/hooks/useAuth";
+import { useTranslation } from "@/lib/i18n";
+import { usePOS } from "@/contexts/POSContext";
+import {
+ ShoppingCart,
+ Utensils,
+ Package,
+ Receipt,
+ Tag,
+ BarChart,
+ Users,
+ Settings
+} from "lucide-react";
+import { Link, useLocation } from "wouter";
+
+interface SidebarProps {
+ className?: string;
+}
+
+export function Sidebar({ className }: SidebarProps) {
+ const { user } = useAuth();
+ const { t } = useTranslation();
+ const { state } = usePOS();
+ const [location] = useLocation();
+
+ const navigation = [
+ {
+ name: t('nav.pos'),
+ href: "/pos",
+ icon: ShoppingCart,
+ current: location === "/pos" || location === "/",
+ },
+ {
+ name: t('nav.table_service'),
+ href: "/table-service",
+ icon: Utensils,
+ current: location === "/table-service",
+ },
+ {
+ name: t('nav.inventory'),
+ href: "/inventory",
+ icon: Package,
+ current: location === "/inventory",
+ badge: state.lowStockProducts.length > 0 ? state.lowStockProducts.length : undefined,
+ },
+ {
+ name: t('nav.transactions'),
+ href: "/transactions",
+ icon: Receipt,
+ current: location === "/transactions",
+ },
+ {
+ name: t('nav.promotions'),
+ href: "/promotions",
+ icon: Tag,
+ current: location === "/promotions",
+ },
+ {
+ name: t('nav.reports'),
+ href: "/reports",
+ icon: BarChart,
+ current: location === "/reports",
+ },
+ ];
+
+ const managerNavigation = [
+ {
+ name: t('nav.staff_management'),
+ href: "/staff",
+ icon: Users,
+ current: location === "/staff",
+ },
+ {
+ name: t('nav.settings'),
+ href: "/settings",
+ icon: Settings,
+ current: location === "/settings",
+ },
+ ];
+
+ const isManager = user?.role === "manager" || user?.role === "admin";
+
+ return (
+
+ );
+}
diff --git a/QatarPOS/client/src/components/ui/accordion.tsx b/QatarPOS/client/src/components/ui/accordion.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..e6a723d06574ee5cec8b00759b98f3fbe1ac7cc9
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/accordion.tsx
@@ -0,0 +1,56 @@
+import * as React from "react"
+import * as AccordionPrimitive from "@radix-ui/react-accordion"
+import { ChevronDown } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Accordion = AccordionPrimitive.Root
+
+const AccordionItem = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AccordionItem.displayName = "AccordionItem"
+
+const AccordionTrigger = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+ svg]:rotate-180",
+ className
+ )}
+ {...props}
+ >
+ {children}
+
+
+
+))
+AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
+
+const AccordionContent = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+ {children}
+
+))
+
+AccordionContent.displayName = AccordionPrimitive.Content.displayName
+
+export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
diff --git a/QatarPOS/client/src/components/ui/alert-dialog.tsx b/QatarPOS/client/src/components/ui/alert-dialog.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..8722561cf6bda62d62f9a0c67730aefda971873a
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/alert-dialog.tsx
@@ -0,0 +1,139 @@
+import * as React from "react"
+import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
+
+import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
+
+const AlertDialog = AlertDialogPrimitive.Root
+
+const AlertDialogTrigger = AlertDialogPrimitive.Trigger
+
+const AlertDialogPortal = AlertDialogPrimitive.Portal
+
+const AlertDialogOverlay = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
+
+const AlertDialogContent = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+
+
+
+))
+AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
+
+const AlertDialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes) => (
+
+)
+AlertDialogHeader.displayName = "AlertDialogHeader"
+
+const AlertDialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes) => (
+
+)
+AlertDialogFooter.displayName = "AlertDialogFooter"
+
+const AlertDialogTitle = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
+
+const AlertDialogDescription = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AlertDialogDescription.displayName =
+ AlertDialogPrimitive.Description.displayName
+
+const AlertDialogAction = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
+
+const AlertDialogCancel = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
+
+export {
+ AlertDialog,
+ AlertDialogPortal,
+ AlertDialogOverlay,
+ AlertDialogTrigger,
+ AlertDialogContent,
+ AlertDialogHeader,
+ AlertDialogFooter,
+ AlertDialogTitle,
+ AlertDialogDescription,
+ AlertDialogAction,
+ AlertDialogCancel,
+}
diff --git a/QatarPOS/client/src/components/ui/alert.tsx b/QatarPOS/client/src/components/ui/alert.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..41fa7e0561a3fdb5f986c1213a35e563de740e96
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/alert.tsx
@@ -0,0 +1,59 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const alertVariants = cva(
+ "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
+ {
+ variants: {
+ variant: {
+ default: "bg-background text-foreground",
+ destructive:
+ "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+const Alert = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes & VariantProps
+>(({ className, variant, ...props }, ref) => (
+
+))
+Alert.displayName = "Alert"
+
+const AlertTitle = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+AlertTitle.displayName = "AlertTitle"
+
+const AlertDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+AlertDescription.displayName = "AlertDescription"
+
+export { Alert, AlertTitle, AlertDescription }
diff --git a/QatarPOS/client/src/components/ui/aspect-ratio.tsx b/QatarPOS/client/src/components/ui/aspect-ratio.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..c4abbf37f217c715a0eaade7f45ac78600df419f
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/aspect-ratio.tsx
@@ -0,0 +1,5 @@
+import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
+
+const AspectRatio = AspectRatioPrimitive.Root
+
+export { AspectRatio }
diff --git a/QatarPOS/client/src/components/ui/avatar.tsx b/QatarPOS/client/src/components/ui/avatar.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..51e507ba9d08bcdbb1fb630498f1cbdf2bf50093
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/avatar.tsx
@@ -0,0 +1,50 @@
+"use client"
+
+import * as React from "react"
+import * as AvatarPrimitive from "@radix-ui/react-avatar"
+
+import { cn } from "@/lib/utils"
+
+const Avatar = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+Avatar.displayName = AvatarPrimitive.Root.displayName
+
+const AvatarImage = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AvatarImage.displayName = AvatarPrimitive.Image.displayName
+
+const AvatarFallback = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
+
+export { Avatar, AvatarImage, AvatarFallback }
diff --git a/QatarPOS/client/src/components/ui/badge.tsx b/QatarPOS/client/src/components/ui/badge.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..f000e3ef5176395b067dfc3f3e1256a80c450015
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/badge.tsx
@@ -0,0 +1,36 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const badgeVariants = cva(
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ {
+ variants: {
+ variant: {
+ default:
+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
+ secondary:
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ destructive:
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
+ outline: "text-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+export interface BadgeProps
+ extends React.HTMLAttributes,
+ VariantProps {}
+
+function Badge({ className, variant, ...props }: BadgeProps) {
+ return (
+
+ )
+}
+
+export { Badge, badgeVariants }
diff --git a/QatarPOS/client/src/components/ui/breadcrumb.tsx b/QatarPOS/client/src/components/ui/breadcrumb.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..60e6c96f72f0350d08b47e4730cab8f3975dc853
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/breadcrumb.tsx
@@ -0,0 +1,115 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { ChevronRight, MoreHorizontal } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Breadcrumb = React.forwardRef<
+ HTMLElement,
+ React.ComponentPropsWithoutRef<"nav"> & {
+ separator?: React.ReactNode
+ }
+>(({ ...props }, ref) => )
+Breadcrumb.displayName = "Breadcrumb"
+
+const BreadcrumbList = React.forwardRef<
+ HTMLOListElement,
+ React.ComponentPropsWithoutRef<"ol">
+>(({ className, ...props }, ref) => (
+
+))
+BreadcrumbList.displayName = "BreadcrumbList"
+
+const BreadcrumbItem = React.forwardRef<
+ HTMLLIElement,
+ React.ComponentPropsWithoutRef<"li">
+>(({ className, ...props }, ref) => (
+
+))
+BreadcrumbItem.displayName = "BreadcrumbItem"
+
+const BreadcrumbLink = React.forwardRef<
+ HTMLAnchorElement,
+ React.ComponentPropsWithoutRef<"a"> & {
+ asChild?: boolean
+ }
+>(({ asChild, className, ...props }, ref) => {
+ const Comp = asChild ? Slot : "a"
+
+ return (
+
+ )
+})
+BreadcrumbLink.displayName = "BreadcrumbLink"
+
+const BreadcrumbPage = React.forwardRef<
+ HTMLSpanElement,
+ React.ComponentPropsWithoutRef<"span">
+>(({ className, ...props }, ref) => (
+
+))
+BreadcrumbPage.displayName = "BreadcrumbPage"
+
+const BreadcrumbSeparator = ({
+ children,
+ className,
+ ...props
+}: React.ComponentProps<"li">) => (
+ svg]:w-3.5 [&>svg]:h-3.5", className)}
+ {...props}
+ >
+ {children ?? }
+
+)
+BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
+
+const BreadcrumbEllipsis = ({
+ className,
+ ...props
+}: React.ComponentProps<"span">) => (
+
+
+ More
+
+)
+BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
+
+export {
+ Breadcrumb,
+ BreadcrumbList,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+ BreadcrumbEllipsis,
+}
diff --git a/QatarPOS/client/src/components/ui/button.tsx b/QatarPOS/client/src/components/ui/button.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..36496a28727a3643b4212a14225d4f6cbd50bda5
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/button.tsx
@@ -0,0 +1,56 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ {
+ variants: {
+ variant: {
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
+ destructive:
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
+ outline:
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
+ secondary:
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default: "h-10 px-4 py-2",
+ sm: "h-9 rounded-md px-3",
+ lg: "h-11 rounded-md px-8",
+ icon: "h-10 w-10",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes,
+ VariantProps {
+ asChild?: boolean
+}
+
+const Button = React.forwardRef(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button"
+ return (
+
+ )
+ }
+)
+Button.displayName = "Button"
+
+export { Button, buttonVariants }
diff --git a/QatarPOS/client/src/components/ui/calendar.tsx b/QatarPOS/client/src/components/ui/calendar.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..2174f7101ba18ec1385eed03f69dbd619feb98aa
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/calendar.tsx
@@ -0,0 +1,68 @@
+import * as React from "react"
+import { ChevronLeft, ChevronRight } from "lucide-react"
+import { DayPicker } from "react-day-picker"
+
+import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
+
+export type CalendarProps = React.ComponentProps
+
+function Calendar({
+ className,
+ classNames,
+ showOutsideDays = true,
+ ...props
+}: CalendarProps) {
+ return (
+ (
+
+ ),
+ IconRight: ({ className, ...props }) => (
+
+ ),
+ }}
+ {...props}
+ />
+ )
+}
+Calendar.displayName = "Calendar"
+
+export { Calendar }
diff --git a/QatarPOS/client/src/components/ui/card.tsx b/QatarPOS/client/src/components/ui/card.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..f62edea578d50058bef5e6bcc178b88d145564e9
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/card.tsx
@@ -0,0 +1,79 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+const Card = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+Card.displayName = "Card"
+
+const CardHeader = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardHeader.displayName = "CardHeader"
+
+const CardTitle = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardTitle.displayName = "CardTitle"
+
+const CardDescription = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardDescription.displayName = "CardDescription"
+
+const CardContent = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardContent.displayName = "CardContent"
+
+const CardFooter = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardFooter.displayName = "CardFooter"
+
+export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
diff --git a/QatarPOS/client/src/components/ui/carousel.tsx b/QatarPOS/client/src/components/ui/carousel.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..9c2b9bf3705d8421bef00704c0c52e83d371ca11
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/carousel.tsx
@@ -0,0 +1,260 @@
+import * as React from "react"
+import useEmblaCarousel, {
+ type UseEmblaCarouselType,
+} from "embla-carousel-react"
+import { ArrowLeft, ArrowRight } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+import { Button } from "@/components/ui/button"
+
+type CarouselApi = UseEmblaCarouselType[1]
+type UseCarouselParameters = Parameters
+type CarouselOptions = UseCarouselParameters[0]
+type CarouselPlugin = UseCarouselParameters[1]
+
+type CarouselProps = {
+ opts?: CarouselOptions
+ plugins?: CarouselPlugin
+ orientation?: "horizontal" | "vertical"
+ setApi?: (api: CarouselApi) => void
+}
+
+type CarouselContextProps = {
+ carouselRef: ReturnType[0]
+ api: ReturnType[1]
+ scrollPrev: () => void
+ scrollNext: () => void
+ canScrollPrev: boolean
+ canScrollNext: boolean
+} & CarouselProps
+
+const CarouselContext = React.createContext(null)
+
+function useCarousel() {
+ const context = React.useContext(CarouselContext)
+
+ if (!context) {
+ throw new Error("useCarousel must be used within a ")
+ }
+
+ return context
+}
+
+const Carousel = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes & CarouselProps
+>(
+ (
+ {
+ orientation = "horizontal",
+ opts,
+ setApi,
+ plugins,
+ className,
+ children,
+ ...props
+ },
+ ref
+ ) => {
+ const [carouselRef, api] = useEmblaCarousel(
+ {
+ ...opts,
+ axis: orientation === "horizontal" ? "x" : "y",
+ },
+ plugins
+ )
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false)
+ const [canScrollNext, setCanScrollNext] = React.useState(false)
+
+ const onSelect = React.useCallback((api: CarouselApi) => {
+ if (!api) {
+ return
+ }
+
+ setCanScrollPrev(api.canScrollPrev())
+ setCanScrollNext(api.canScrollNext())
+ }, [])
+
+ const scrollPrev = React.useCallback(() => {
+ api?.scrollPrev()
+ }, [api])
+
+ const scrollNext = React.useCallback(() => {
+ api?.scrollNext()
+ }, [api])
+
+ const handleKeyDown = React.useCallback(
+ (event: React.KeyboardEvent) => {
+ if (event.key === "ArrowLeft") {
+ event.preventDefault()
+ scrollPrev()
+ } else if (event.key === "ArrowRight") {
+ event.preventDefault()
+ scrollNext()
+ }
+ },
+ [scrollPrev, scrollNext]
+ )
+
+ React.useEffect(() => {
+ if (!api || !setApi) {
+ return
+ }
+
+ setApi(api)
+ }, [api, setApi])
+
+ React.useEffect(() => {
+ if (!api) {
+ return
+ }
+
+ onSelect(api)
+ api.on("reInit", onSelect)
+ api.on("select", onSelect)
+
+ return () => {
+ api?.off("select", onSelect)
+ }
+ }, [api, onSelect])
+
+ return (
+
+
+ {children}
+
+
+ )
+ }
+)
+Carousel.displayName = "Carousel"
+
+const CarouselContent = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => {
+ const { carouselRef, orientation } = useCarousel()
+
+ return (
+
+ )
+})
+CarouselContent.displayName = "CarouselContent"
+
+const CarouselItem = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => {
+ const { orientation } = useCarousel()
+
+ return (
+
+ )
+})
+CarouselItem.displayName = "CarouselItem"
+
+const CarouselPrevious = React.forwardRef<
+ HTMLButtonElement,
+ React.ComponentProps
+>(({ className, variant = "outline", size = "icon", ...props }, ref) => {
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel()
+
+ return (
+
+ )
+})
+CarouselPrevious.displayName = "CarouselPrevious"
+
+const CarouselNext = React.forwardRef<
+ HTMLButtonElement,
+ React.ComponentProps
+>(({ className, variant = "outline", size = "icon", ...props }, ref) => {
+ const { orientation, scrollNext, canScrollNext } = useCarousel()
+
+ return (
+
+ )
+})
+CarouselNext.displayName = "CarouselNext"
+
+export {
+ type CarouselApi,
+ Carousel,
+ CarouselContent,
+ CarouselItem,
+ CarouselPrevious,
+ CarouselNext,
+}
diff --git a/QatarPOS/client/src/components/ui/chart.tsx b/QatarPOS/client/src/components/ui/chart.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..39fba6d6fc8509b968824b5076a8791c46650294
--- /dev/null
+++ b/QatarPOS/client/src/components/ui/chart.tsx
@@ -0,0 +1,365 @@
+"use client"
+
+import * as React from "react"
+import * as RechartsPrimitive from "recharts"
+
+import { cn } from "@/lib/utils"
+
+// Format: { THEME_NAME: CSS_SELECTOR }
+const THEMES = { light: "", dark: ".dark" } as const
+
+export type ChartConfig = {
+ [k in string]: {
+ label?: React.ReactNode
+ icon?: React.ComponentType
+ } & (
+ | { color?: string; theme?: never }
+ | { color?: never; theme: Record }
+ )
+}
+
+type ChartContextProps = {
+ config: ChartConfig
+}
+
+const ChartContext = React.createContext(null)
+
+function useChart() {
+ const context = React.useContext(ChartContext)
+
+ if (!context) {
+ throw new Error("useChart must be used within a ")
+ }
+
+ return context
+}
+
+const ChartContainer = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div"> & {
+ config: ChartConfig
+ children: React.ComponentProps<
+ typeof RechartsPrimitive.ResponsiveContainer
+ >["children"]
+ }
+>(({ id, className, children, config, ...props }, ref) => {
+ const uniqueId = React.useId()
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
+
+ return (
+
+
+
+
+ {children}
+
+
+
+ )
+})
+ChartContainer.displayName = "Chart"
+
+const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
+ const colorConfig = Object.entries(config).filter(
+ ([, config]) => config.theme || config.color
+ )
+
+ if (!colorConfig.length) {
+ return null
+ }
+
+ return (
+