From 7c55b3916cc8083c423209101d2b8fabdc88fe29 Mon Sep 17 00:00:00 2001 From: "hamed@B" Date: Wed, 16 Sep 2026 09:06:48 +0330 Subject: [PATCH] feat: add customer authentication and order dashboard --- .idea/workspace.xml | 43 +- app/cart/page.tsx | 3 +- app/context/AuthContext.tsx | 102 ++ app/dashboard/layout.tsx | 7 + app/dashboard/orders/[id]/page.tsx | 79 ++ app/dashboard/orders/page.tsx | 23 + app/dashboard/page.tsx | 42 + app/dashboard/profile/page.tsx | 48 + app/globals.css | 43 + app/login/page.tsx | 22 + app/products/[id]/page.tsx | 3 +- app/providers.tsx | 9 +- components/Header.tsx | 41 +- components/HeroSection.tsx | 18 +- components/QuantityControl.tsx | 11 +- components/VendingCard.tsx | 6 +- components/auth/AuthModal.tsx | 85 ++ components/auth/ProtectedLink.tsx | 19 + components/auth/ProtectedPage.tsx | 36 + components/dashboard/DashboardShell.tsx | 44 + components/dashboard/InvoiceDocument.tsx | 43 + components/dashboard/OrderCard.tsx | 26 + components/dashboard/OrderStatusTag.tsx | 12 + data/account.ts | 62 ++ lib/invoice.ts | 56 ++ package-lock.json | 1173 +++++++++++++++++++++- package.json | 3 + services/auth.ts | 50 + services/orders.ts | 49 + services/profile.ts | 13 + types/account.ts | 75 ++ 31 files changed, 2193 insertions(+), 53 deletions(-) create mode 100644 app/context/AuthContext.tsx create mode 100644 app/dashboard/layout.tsx create mode 100644 app/dashboard/orders/[id]/page.tsx create mode 100644 app/dashboard/orders/page.tsx create mode 100644 app/dashboard/page.tsx create mode 100644 app/dashboard/profile/page.tsx create mode 100644 app/login/page.tsx create mode 100644 components/auth/AuthModal.tsx create mode 100644 components/auth/ProtectedLink.tsx create mode 100644 components/auth/ProtectedPage.tsx create mode 100644 components/dashboard/DashboardShell.tsx create mode 100644 components/dashboard/InvoiceDocument.tsx create mode 100644 components/dashboard/OrderCard.tsx create mode 100644 components/dashboard/OrderStatusTag.tsx create mode 100644 data/account.ts create mode 100644 lib/invoice.ts create mode 100644 services/auth.ts create mode 100644 services/orders.ts create mode 100644 services/profile.ts create mode 100644 types/account.ts diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4297d43..b4ad16e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,20 +4,38 @@