feat: add advanced analytics and territory management system
- Add comprehensive analytics components with export functionality - Implement territory management with manager performance tracking - Add seatmap components for venue layout management - Create customer management features with modal interface - Add advanced hooks for dashboard flags and territory data - Implement seat selection and venue management utilities - Add type definitions for ticketing and seatmap systems 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
255
reactrebuild0825/src/app/router.tsx
Normal file
255
reactrebuild0825/src/app/router.tsx
Normal file
@@ -0,0 +1,255 @@
|
||||
|
||||
import { Suspense } from 'react';
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
|
||||
import ProtectedRoute from '@/components/routing/ProtectedRoute';
|
||||
import { AppLayout } from '@/components/layout/AppLayout';
|
||||
import { OrganizationProvider } from '@/contexts/OrganizationContext';
|
||||
import { GlassShowcase } from '@/components/GlassShowcase';
|
||||
import { NardoGreyShowcase } from '@/components/NardoGreyShowcase';
|
||||
import { ThemeDocumentation } from '@/components/ThemeDocumentation';
|
||||
import { BrandingSettings } from '@/features/org/BrandingSettings';
|
||||
import { BrandingSettings as AdminBrandingSettings } from '../pages/admin/BrandingSettings';
|
||||
import { DomainSettings } from '@/features/org/DomainSettings';
|
||||
import { AdminPage } from '@/pages/AdminPage';
|
||||
import { AnalyticsPage } from '@/pages/AnalyticsPage';
|
||||
import { CheckoutCancelPage } from '@/pages/CheckoutCancelPage';
|
||||
import { CheckoutSuccessPage } from '@/pages/CheckoutSuccessPage';
|
||||
import { CustomersPage } from '@/pages/CustomersPage';
|
||||
import { DashboardPage } from '@/pages/DashboardPage';
|
||||
import {
|
||||
ErrorPage,
|
||||
NotFoundPage,
|
||||
UnauthorizedPage,
|
||||
ServerErrorPage,
|
||||
NetworkErrorPage
|
||||
} from '@/pages/ErrorPage';
|
||||
import { EventsIndexPage } from '@/pages/events/EventsIndexPage';
|
||||
import { HomePage } from '@/pages/HomePage';
|
||||
import LoginPage from '@/pages/LoginPage';
|
||||
import { SettingsPage } from '@/pages/SettingsPage';
|
||||
import { TicketsPage } from '@/pages/TicketsPage';
|
||||
|
||||
// Lazy-loaded components with their skeleton fallbacks
|
||||
import {
|
||||
EventDetailPage,
|
||||
GateOpsPage,
|
||||
PaymentSettings,
|
||||
ScannerPage,
|
||||
EventDetailPageSkeleton,
|
||||
GateOpsPageSkeleton,
|
||||
PaymentSettingsPageSkeleton,
|
||||
ScannerPageSkeleton
|
||||
} from './lazy-routes';
|
||||
|
||||
/**
|
||||
* Comprehensive routing configuration for Black Canyon Tickets
|
||||
* Implements role-based access control with protected routes
|
||||
*
|
||||
* Role hierarchy:
|
||||
* - superadmin: Full platform access
|
||||
* - orgAdmin: Organization-level administration
|
||||
* - territoryManager: Territory-specific management
|
||||
* - staff: Basic event and ticket access
|
||||
*/
|
||||
export function AppRoutes(): JSX.Element {
|
||||
return (
|
||||
<Routes>
|
||||
{/* Public routes - no authentication required */}
|
||||
<Route path="/login" element={<LoginPage />} />
|
||||
<Route path="/home" element={<HomePage />} />
|
||||
<Route path="/showcase" element={<GlassShowcase />} />
|
||||
<Route path="/nardo" element={<NardoGreyShowcase />} />
|
||||
<Route path="/docs" element={<ThemeDocumentation />} />
|
||||
|
||||
{/* Public checkout routes */}
|
||||
<Route path="/checkout/success" element={<CheckoutSuccessPage />} />
|
||||
<Route path="/checkout/cancel" element={<CheckoutCancelPage />} />
|
||||
|
||||
{/* Main public route - no authentication required */}
|
||||
<Route path="/" element={<HomePage />} />
|
||||
|
||||
{/* Protected dashboard routes */}
|
||||
<Route
|
||||
path="/dashboard"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout title="Dashboard" subtitle="Overview of your events and performance">
|
||||
<DashboardPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Events management routes */}
|
||||
<Route
|
||||
path="/events"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout title="Events" subtitle="Manage your upcoming events">
|
||||
<EventsIndexPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Event detail page - requires staff+ roles */}
|
||||
<Route
|
||||
path="/events/:eventId"
|
||||
element={
|
||||
<ProtectedRoute roles={['staff', 'territoryManager', 'orgAdmin', 'superadmin']}>
|
||||
<AppLayout title="Event Details" subtitle="View and manage event details">
|
||||
<Suspense fallback={<EventDetailPageSkeleton />}>
|
||||
<EventDetailPage />
|
||||
</Suspense>
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Gate operations - staff+ roles only */}
|
||||
<Route
|
||||
path="/events/:eventId/gate-ops"
|
||||
element={
|
||||
<ProtectedRoute roles={['staff', 'territoryManager', 'orgAdmin', 'superadmin']}>
|
||||
<AppLayout title="Gate Operations" subtitle="Live scanning monitoring and control">
|
||||
<Suspense fallback={<GateOpsPageSkeleton />}>
|
||||
<GateOpsPage />
|
||||
</Suspense>
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Organization payment settings - orgAdmin+ only */}
|
||||
<Route
|
||||
path="/org/:orgId/payments"
|
||||
element={
|
||||
<ProtectedRoute roles={['orgAdmin', 'superadmin']}>
|
||||
<AppLayout title="Payment Settings" subtitle="Connect your Stripe account to accept payments">
|
||||
<Suspense fallback={<PaymentSettingsPageSkeleton />}>
|
||||
<PaymentSettings />
|
||||
</Suspense>
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Additional organization routes */}
|
||||
<Route
|
||||
path="/org/:orgId/branding"
|
||||
element={
|
||||
<ProtectedRoute roles={['orgAdmin', 'superadmin']}>
|
||||
<AppLayout title="Branding Settings" subtitle="Customize your organization's visual identity">
|
||||
<BrandingSettings />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Admin branding settings - simplified route */}
|
||||
<Route
|
||||
path="/admin/branding"
|
||||
element={
|
||||
<ProtectedRoute roles={['superadmin']}>
|
||||
<AdminBrandingSettings />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/org/:orgId/domains"
|
||||
element={
|
||||
<ProtectedRoute roles={['orgAdmin', 'superadmin']}>
|
||||
<AppLayout title="Domain Settings" subtitle="Manage custom domains for your platform">
|
||||
<DomainSettings />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Scanner route - staff+ roles only */}
|
||||
<Route
|
||||
path="/scan"
|
||||
element={
|
||||
<ProtectedRoute roles={['staff', 'territoryManager', 'orgAdmin', 'superadmin']}>
|
||||
<Suspense fallback={<ScannerPageSkeleton />}>
|
||||
<ScannerPage />
|
||||
</Suspense>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Ticket management */}
|
||||
<Route
|
||||
path="/tickets"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout title="Tickets" subtitle="Track ticket sales and manage inventory">
|
||||
<TicketsPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Customer management */}
|
||||
<Route
|
||||
path="/customers"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout title="Customers" subtitle="View and manage customer information">
|
||||
<CustomersPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Analytics */}
|
||||
<Route
|
||||
path="/analytics"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout title="Analytics" subtitle="View detailed performance metrics">
|
||||
<AnalyticsPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* User settings */}
|
||||
<Route
|
||||
path="/settings"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout title="Settings" subtitle="Configure your account and preferences">
|
||||
<SettingsPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Admin routes - admin role required */}
|
||||
<Route
|
||||
path="/admin/*"
|
||||
element={
|
||||
<ProtectedRoute roles={['superadmin']}>
|
||||
<AppLayout title="Admin" subtitle="Platform administration">
|
||||
<AdminPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Error routes */}
|
||||
<Route path="/unauthorized" element={<UnauthorizedPage />} />
|
||||
<Route path="/error/network" element={<NetworkErrorPage />} />
|
||||
<Route path="/error/server" element={<ServerErrorPage />} />
|
||||
<Route path="/error/timeout" element={<NetworkErrorPage />} />
|
||||
<Route path="/error" element={<ErrorPage />} />
|
||||
|
||||
{/* 404 catch-all route - must be last */}
|
||||
<Route path="*" element={<NotFoundPage />} />
|
||||
</Routes>
|
||||
);
|
||||
}
|
||||
|
||||
export default AppRoutes;
|
||||
Reference in New Issue
Block a user