Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 19 additions & 30 deletions ApexPOS Restaurent/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@ import Layout from './components/layout/Layout';
import Dashboard from './pages/Dashboard';
import Login from './pages/Login';
import { useStore } from './store/useStore';
import Inventory from './pages/Inventory';

// Protected Route Component
const ProtectedRoute = () => {
const isAuthenticated = useStore(state => state.isAuthenticated);
return isAuthenticated ? <Outlet /> : <Navigate to="/login" replace />;
};

// ─── Restaurant POS Pages ────────────────────────────────────────────────────
import RetailPOS from './pages/RetailPOS';
import Inventory from './pages/Inventory';
import CategoryManagement from './pages/CategoryManagement';
import SalesHistory from './pages/SalesHistory';
import Delivery from './pages/Delivery';
import RepairManagement from './pages/RepairManagement';
import AddJob from './pages/AddJob';
import Reload from './pages/Reload';
import Registration from './pages/Registration';
import Reports from './pages/Reports';
import HirePurchase from './pages/HirePurchase';
import Expenses from './pages/Expenses';
import Notifications from './pages/Notifications';
import StaffManagement from './pages/StaffManagement';
Expand All @@ -30,47 +26,40 @@ import TableManagement from './pages/TableManagement';
import QROrder from './pages/QROrder';
import KDS from './pages/KDS';



// Placeholder components for other routes
const Placeholder = ({ title }: { title: string }) => (
<div className="p-10 flex items-center justify-center flex-col glass-card min-h-[400px]">
<h2 className="text-3xl font-bold text-gray-200 mb-4">{title}</h2>
<p className="text-gray-400">Component under construction</p>
</div>
);

function App() {
return (
<BrowserRouter>
<Routes>
{/* Public Routes */}
<Route path="/login" element={<Login />} />
<Route path="/qrmenu/:tableId" element={<QROrder />} />
<Route path="/kds" element={<KDS />} />

{/* Protected Restaurant POS Routes */}
<Route element={<ProtectedRoute />}>
<Route path="/" element={<Layout />}>
<Route index element={<Dashboard />} />
<Route path="inventory" element={<Inventory />} />

{/* 🍽️ Operations */}
<Route path="retail-pos" element={<RetailPOS />} />
<Route path="retail" element={<Navigate to="/retail-pos" replace />} />
<Route path="delivery" element={<Delivery />} />
<Route path="sales" element={<SalesHistory />} />
<Route path="hospitality" element={<TableManagement />} />
<Route path="kds" element={<KDS />} />

{/* 📋 Management */}
<Route path="inventory" element={<Inventory />} />
<Route path="categories" element={<CategoryManagement />} />
<Route path="repairs" element={<RepairManagement />} />
<Route path="reload" element={<Reload />} />
<Route path="registration" element={<Registration />} />
<Route path="add-job" element={<AddJob />} />
<Route path="reports" element={<Reports />} />
<Route path="notifications" element={<Notifications />} />
<Route path="hp" element={<HirePurchase />} />
<Route path="sales" element={<SalesHistory />} />

{/* 💰 Finance */}
<Route path="expenses" element={<Expenses />} />
<Route path="reports" element={<Reports />} />

{/* ⚙️ Admin */}
<Route path="registration" element={<Registration />} />
<Route path="staff" element={<StaffManagement />} />
<Route path="notifications" element={<Notifications />} />
<Route path="settings" element={<Settings />} />
<Route path="hospitality" element={<TableManagement />} />
</Route>


</Route>
</Routes>
</BrowserRouter>
Expand Down
41 changes: 21 additions & 20 deletions ApexPOS Restaurent/client/src/components/layout/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import { NavLink, useNavigate } from 'react-router-dom';
import {
LayoutDashboard, ShoppingCart, Package, Truck, History,
Tags, Wrench, Smartphone, Users, PlusCircle, FileText,
Bell, CreditCard, DollarSign, LogOut, ChevronLeft, ChevronRight,
ShieldCheck, Settings, UtensilsCrossed
LayoutDashboard, ShoppingCart, Package, History,
Tags, Users, FileText,
Bell, DollarSign, LogOut, ChevronLeft, ChevronRight,
ShieldCheck, Settings, UtensilsCrossed, MonitorPlay,
ChefHat, Heart
} from 'lucide-react';


Expand All @@ -13,30 +14,30 @@ import { useStore } from '../../store/useStore';
import { motion } from 'framer-motion';

const menuItems = [
{ path: '/', icon: LayoutDashboard, label: 'Dashboard', animation: 'hover-rotate' as const, group: 'Core' },
{ path: '/retail-pos', icon: ShoppingCart, label: 'Retail POS', animation: 'hover-scale' as const, group: 'Core' },
{ path: '/hospitality', icon: UtensilsCrossed, label: 'Hospitality', animation: 'hover-rotate' as const, group: 'Core' },
{ path: '/inventory', icon: Package, label: 'Inventory', animation: 'hover-scale' as const, group: 'Core' },

{ path: '/categories', icon: Tags, label: 'Categories', animation: 'hover-scale' as const, group: 'Core' },
{ path: '/sales', icon: History, label: 'Sales History', animation: 'hover-rotate' as const, group: 'Core' },
{ path: '/delivery', icon: Truck, label: 'Delivery', animation: 'hover-scale' as const, group: 'Service' },
{ path: '/repairs', icon: Wrench, label: 'Repairs', animation: 'hover-rotate' as const, group: 'Service' },
{ path: '/add-job', icon: PlusCircle, label: 'Add Job', animation: 'hover-rotate' as const, group: 'Service' },
{ path: '/reload', icon: Smartphone, label: 'Reload', animation: 'pulse' as const, group: 'Service' },
{ path: '/hp', icon: CreditCard, label: 'Hire Purchase', animation: 'hover-scale' as const, group: 'Finance' },
{ path: '/', icon: LayoutDashboard, label: 'Dashboard', animation: 'hover-rotate' as const, group: 'Overview' },

{ path: '/retail-pos', icon: ShoppingCart, label: 'Order POS', animation: 'hover-scale' as const, group: 'Operations' },
{ path: '/hospitality', icon: UtensilsCrossed, label: 'Tables', animation: 'hover-rotate' as const, group: 'Operations' },
{ path: '/kds', icon: MonitorPlay, label: 'Kitchen Display', animation: 'hover-scale' as const, group: 'Operations' },

{ path: '/inventory', icon: ChefHat, label: 'Menu Items', animation: 'hover-scale' as const, group: 'Management' },
{ path: '/categories', icon: Tags, label: 'Categories', animation: 'hover-scale' as const, group: 'Management' },
{ path: '/sales', icon: History, label: 'Sales History', animation: 'hover-rotate' as const, group: 'Management' },

{ path: '/expenses', icon: DollarSign, label: 'Expenses', animation: 'bounce' as const, group: 'Finance' },
{ path: '/reports', icon: FileText, label: 'Reports', animation: 'hover-scale' as const, group: 'Finance' },
{ path: '/registration', icon: Users, label: 'Registration', animation: 'hover-scale' as const, group: 'Admin' },

{ path: '/registration', icon: Heart, label: 'Customers', animation: 'hover-scale' as const, group: 'Admin' },
{ path: '/staff', icon: ShieldCheck, label: 'Staff & Auth', animation: 'hover-scale' as const, group: 'Admin' },
{ path: '/notifications', icon: Bell, label: 'Notifications', animation: 'pulse' as const, group: 'Admin' },
{ path: '/settings', icon: Settings, label: 'Settings', animation: 'hover-rotate' as const, group: 'Admin' },
];


const groupLabels: Record<string, string> = {
Core: '🏪 Core',
Service: '🔧 Service',
Overview: '📊 Overview',
Operations: '🍽️ Operations',
Management: '📋 Management',
Finance: '💰 Finance',
Admin: '⚙️ Admin',
};
Expand All @@ -49,7 +50,7 @@ const Sidebar = () => {
const initials = user?.name?.split(' ').map(n => n[0]).join('').slice(0, 2).toUpperCase() || 'A';

// Group menu items
const groups = ['Core', 'Service', 'Finance', 'Admin'];
const groups = ['Overview', 'Operations', 'Management', 'Finance', 'Admin'];

return (
<motion.div
Expand Down
Loading
Loading