2025-08-28 10:41:04 +02:00
|
|
|
import React, { Suspense } from 'react';
|
|
|
|
|
import { Routes, Route, Navigate } from 'react-router-dom';
|
|
|
|
|
import { ProtectedRoute } from './ProtectedRoute';
|
2025-09-26 07:46:25 +02:00
|
|
|
import { LoadingSpinner } from '../components/ui';
|
2025-08-28 10:41:04 +02:00
|
|
|
import { AppShell } from '../components/layout';
|
|
|
|
|
|
|
|
|
|
// Lazy load the pages we actually have
|
|
|
|
|
const LandingPage = React.lazy(() => import('../pages/public/LandingPage'));
|
2025-11-07 12:00:01 +01:00
|
|
|
const FeaturesPage = React.lazy(() => import('../pages/public/FeaturesPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
const LoginPage = React.lazy(() => import('../pages/public/LoginPage'));
|
|
|
|
|
const RegisterPage = React.lazy(() => import('../pages/public/RegisterPage'));
|
2025-10-03 14:09:34 +02:00
|
|
|
const DemoPage = React.lazy(() => import('../pages/public/DemoPage'));
|
2025-10-16 07:28:04 +02:00
|
|
|
const PrivacyPolicyPage = React.lazy(() => import('../pages/public/PrivacyPolicyPage'));
|
|
|
|
|
const TermsOfServicePage = React.lazy(() => import('../pages/public/TermsOfServicePage'));
|
|
|
|
|
const CookiePolicyPage = React.lazy(() => import('../pages/public/CookiePolicyPage'));
|
|
|
|
|
const CookiePreferencesPage = React.lazy(() => import('../pages/public/CookiePreferencesPage'));
|
2025-10-17 18:14:28 +02:00
|
|
|
const BlogPage = React.lazy(() => import('../pages/public/BlogPage'));
|
|
|
|
|
const AboutPage = React.lazy(() => import('../pages/public/AboutPage'));
|
|
|
|
|
const CareersPage = React.lazy(() => import('../pages/public/CareersPage'));
|
|
|
|
|
const HelpCenterPage = React.lazy(() => import('../pages/public/HelpCenterPage'));
|
|
|
|
|
const DocumentationPage = React.lazy(() => import('../pages/public/DocumentationPage'));
|
|
|
|
|
const ContactPage = React.lazy(() => import('../pages/public/ContactPage'));
|
|
|
|
|
const FeedbackPage = React.lazy(() => import('../pages/public/FeedbackPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
const DashboardPage = React.lazy(() => import('../pages/app/DashboardPage'));
|
|
|
|
|
|
|
|
|
|
// Operations pages
|
|
|
|
|
const InventoryPage = React.lazy(() => import('../pages/app/operations/inventory/InventoryPage'));
|
|
|
|
|
const ProductionPage = React.lazy(() => import('../pages/app/operations/production/ProductionPage'));
|
|
|
|
|
const RecipesPage = React.lazy(() => import('../pages/app/operations/recipes/RecipesPage'));
|
|
|
|
|
const ProcurementPage = React.lazy(() => import('../pages/app/operations/procurement/ProcurementPage'));
|
2025-09-09 21:39:12 +02:00
|
|
|
const SuppliersPage = React.lazy(() => import('../pages/app/operations/suppliers/SuppliersPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
const OrdersPage = React.lazy(() => import('../pages/app/operations/orders/OrdersPage'));
|
|
|
|
|
const POSPage = React.lazy(() => import('../pages/app/operations/pos/POSPage'));
|
2025-09-23 19:24:22 +02:00
|
|
|
const MaquinariaPage = React.lazy(() => import('../pages/app/operations/maquinaria/MaquinariaPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
|
|
|
|
|
// Analytics pages
|
2025-09-23 19:24:22 +02:00
|
|
|
const ProductionAnalyticsPage = React.lazy(() => import('../pages/app/analytics/ProductionAnalyticsPage'));
|
2025-10-02 13:20:30 +02:00
|
|
|
const ProcurementAnalyticsPage = React.lazy(() => import('../pages/app/analytics/ProcurementAnalyticsPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
const ForecastingPage = React.lazy(() => import('../pages/app/analytics/forecasting/ForecastingPage'));
|
|
|
|
|
const SalesAnalyticsPage = React.lazy(() => import('../pages/app/analytics/sales-analytics/SalesAnalyticsPage'));
|
2025-10-07 07:15:07 +02:00
|
|
|
const ScenarioSimulationPage = React.lazy(() => import('../pages/app/analytics/scenario-simulation/ScenarioSimulationPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
const AIInsightsPage = React.lazy(() => import('../pages/app/analytics/ai-insights/AIInsightsPage'));
|
|
|
|
|
const PerformanceAnalyticsPage = React.lazy(() => import('../pages/app/analytics/performance/PerformanceAnalyticsPage'));
|
2025-11-02 20:24:44 +01:00
|
|
|
const EventRegistryPage = React.lazy(() => import('../pages/app/analytics/events/EventRegistryPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
|
|
|
|
|
|
2025-10-24 13:05:04 +02:00
|
|
|
// Settings pages - Unified
|
|
|
|
|
const BakerySettingsPage = React.lazy(() => import('../pages/app/settings/bakery/BakerySettingsPage'));
|
|
|
|
|
const NewProfileSettingsPage = React.lazy(() => import('../pages/app/settings/profile/NewProfileSettingsPage'));
|
2025-09-24 22:22:01 +02:00
|
|
|
const SubscriptionPage = React.lazy(() => import('../pages/app/settings/subscription/SubscriptionPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
const TeamPage = React.lazy(() => import('../pages/app/settings/team/TeamPage'));
|
2025-09-22 11:04:03 +02:00
|
|
|
const OrganizationsPage = React.lazy(() => import('../pages/app/settings/organizations/OrganizationsPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
|
2025-09-19 12:06:26 +02:00
|
|
|
// Database pages
|
|
|
|
|
const DatabasePage = React.lazy(() => import('../pages/app/database/DatabasePage'));
|
2025-09-20 22:11:05 +02:00
|
|
|
const ModelsConfigPage = React.lazy(() => import('../pages/app/database/models/ModelsConfigPage'));
|
2025-09-24 16:42:23 +02:00
|
|
|
const QualityTemplatesPage = React.lazy(() => import('../pages/app/database/quality-templates/QualityTemplatesPage'));
|
2025-10-27 16:33:26 +01:00
|
|
|
const SustainabilityPage = React.lazy(() => import('../pages/app/database/sustainability/SustainabilityPage'));
|
2025-09-19 12:06:26 +02:00
|
|
|
|
2025-11-09 09:22:08 +01:00
|
|
|
// Onboarding page (Setup is now integrated into UnifiedOnboardingWizard)
|
2025-09-08 17:19:00 +02:00
|
|
|
const OnboardingPage = React.lazy(() => import('../pages/onboarding/OnboardingPage'));
|
2025-08-28 10:41:04 +02:00
|
|
|
|
|
|
|
|
export const AppRouter: React.FC = () => {
|
|
|
|
|
return (
|
|
|
|
|
<Suspense fallback={<LoadingSpinner overlay text="Cargando aplicación..." />}>
|
|
|
|
|
<Routes>
|
|
|
|
|
{/* Public Routes */}
|
|
|
|
|
<Route path="/" element={<LandingPage />} />
|
2025-11-07 12:00:01 +01:00
|
|
|
<Route path="/features" element={<FeaturesPage />} />
|
2025-08-28 10:41:04 +02:00
|
|
|
<Route path="/login" element={<LoginPage />} />
|
|
|
|
|
<Route path="/register" element={<RegisterPage />} />
|
2025-10-03 14:09:34 +02:00
|
|
|
<Route path="/demo" element={<DemoPage />} />
|
2025-10-17 18:14:28 +02:00
|
|
|
|
|
|
|
|
{/* Company Routes - Public */}
|
|
|
|
|
<Route path="/blog" element={<BlogPage />} />
|
|
|
|
|
<Route path="/about" element={<AboutPage />} />
|
|
|
|
|
<Route path="/careers" element={<CareersPage />} />
|
|
|
|
|
|
|
|
|
|
{/* Help & Support Routes - Public */}
|
|
|
|
|
<Route path="/help" element={<HelpCenterPage />} />
|
|
|
|
|
<Route path="/help/docs" element={<DocumentationPage />} />
|
|
|
|
|
<Route path="/help/support" element={<ContactPage />} />
|
|
|
|
|
<Route path="/help/feedback" element={<FeedbackPage />} />
|
2025-10-16 07:28:04 +02:00
|
|
|
|
|
|
|
|
{/* Legal & Privacy Routes - Public */}
|
|
|
|
|
<Route path="/privacy" element={<PrivacyPolicyPage />} />
|
|
|
|
|
<Route path="/terms" element={<TermsOfServicePage />} />
|
|
|
|
|
<Route path="/cookies" element={<CookiePolicyPage />} />
|
|
|
|
|
<Route path="/cookie-preferences" element={<CookiePreferencesPage />} />
|
2025-08-28 10:41:04 +02:00
|
|
|
|
|
|
|
|
{/* Protected Routes with AppShell Layout */}
|
|
|
|
|
<Route
|
|
|
|
|
path="/app"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<DashboardPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/app/dashboard"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<DashboardPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
|
2025-09-19 12:06:26 +02:00
|
|
|
{/* Operations Routes - Business Operations Only */}
|
|
|
|
|
<Route
|
|
|
|
|
path="/app/operations/procurement"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<ProcurementPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/operations/production"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<ProductionPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/operations/pos"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<POSPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
|
|
|
|
|
{/* Database Routes - Current Bakery Status */}
|
|
|
|
|
<Route
|
|
|
|
|
path="/app/database"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<DatabasePage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-09-09 21:39:12 +02:00
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/recipes"
|
2025-09-09 21:39:12 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<RecipesPage />
|
2025-09-09 21:39:12 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/orders"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<OrdersPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/suppliers"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<SuppliersPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/inventory"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<InventoryPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-10-24 13:05:04 +02:00
|
|
|
{/* NEW: Unified Bakery Settings Route */}
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
2025-10-24 13:05:04 +02:00
|
|
|
path="/app/settings/bakery"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-10-24 13:05:04 +02:00
|
|
|
<BakerySettingsPage />
|
2025-10-23 07:44:54 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-10-24 13:05:04 +02:00
|
|
|
{/* Legacy routes redirect to new unified page */}
|
|
|
|
|
<Route path="/app/database/information" element={<Navigate to="/app/settings/bakery" replace />} />
|
|
|
|
|
<Route path="/app/database/ajustes" element={<Navigate to="/app/settings/bakery" replace />} />
|
2025-09-19 12:06:26 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/team"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<TeamPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-19 12:06:26 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-09-20 22:11:05 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/models"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<ModelsConfigPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-09-24 16:42:23 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/quality-templates"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<QualityTemplatesPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-10-27 16:33:26 +01:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/sustainability"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<SustainabilityPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-09-23 19:24:22 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/database/maquinaria"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<MaquinariaPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
|
|
|
|
|
{/* Analytics Routes */}
|
2025-09-23 19:24:22 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/analytics/production"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<ProductionAnalyticsPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-10-02 13:20:30 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/analytics/procurement"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<ProcurementAnalyticsPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-09-23 19:24:22 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/analytics/forecasting"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<ForecastingPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-23 19:24:22 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
|
|
|
|
<Route
|
2025-09-19 12:06:26 +02:00
|
|
|
path="/app/analytics/sales"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<SalesAnalyticsPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-10-07 07:15:07 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/analytics/scenario-simulation"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<ScenarioSimulationPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/app/analytics/ai-insights"
|
2025-08-28 23:40:44 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<AIInsightsPage />
|
2025-08-28 23:40:44 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-10-07 07:15:07 +02:00
|
|
|
}
|
2025-08-28 23:40:44 +02:00
|
|
|
/>
|
2025-10-07 07:15:07 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/analytics/performance"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-09-19 12:06:26 +02:00
|
|
|
<PerformanceAnalyticsPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-10-07 07:15:07 +02:00
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
2025-11-02 20:24:44 +01:00
|
|
|
<Route
|
|
|
|
|
path="/app/analytics/events"
|
|
|
|
|
element={
|
2025-11-06 18:39:20 +00:00
|
|
|
<ProtectedRoute>
|
2025-11-02 20:24:44 +01:00
|
|
|
<AppShell>
|
|
|
|
|
<EventRegistryPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-09-19 12:06:26 +02:00
|
|
|
|
2025-10-24 13:05:04 +02:00
|
|
|
|
2025-09-19 12:06:26 +02:00
|
|
|
{/* Settings Routes */}
|
2025-10-24 13:05:04 +02:00
|
|
|
{/* NEW: Unified Profile Settings Route */}
|
2025-09-22 11:04:03 +02:00
|
|
|
<Route
|
2025-10-24 13:05:04 +02:00
|
|
|
path="/app/settings/profile"
|
2025-09-24 22:22:01 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
2025-10-24 13:05:04 +02:00
|
|
|
<NewProfileSettingsPage />
|
2025-09-24 22:22:01 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-10-24 13:05:04 +02:00
|
|
|
{/* Legacy routes redirect to new unified profile page */}
|
|
|
|
|
<Route path="/app/settings/personal-info" element={<Navigate to="/app/settings/profile" replace />} />
|
|
|
|
|
<Route path="/app/settings/communication-preferences" element={<Navigate to="/app/settings/profile" replace />} />
|
|
|
|
|
<Route path="/app/settings/privacy" element={<Navigate to="/app/settings/profile" replace />} />
|
2025-09-24 22:22:01 +02:00
|
|
|
<Route
|
|
|
|
|
path="/app/settings/subscription"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<SubscriptionPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
2025-09-22 11:04:03 +02:00
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/app/settings/organizations"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<AppShell>
|
|
|
|
|
<OrganizationsPage />
|
|
|
|
|
</AppShell>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
2025-08-28 10:41:04 +02:00
|
|
|
/>
|
|
|
|
|
|
2025-09-08 17:19:00 +02:00
|
|
|
{/* Onboarding Route - Protected but without AppShell */}
|
Implement Phase 1: Setup Wizard Foundation (Foundation & Architecture)
Created complete foundation for the bakery operations setup wizard that guides
users through post-onboarding configuration of suppliers, inventory, recipes,
quality standards, and team members.
**Core Components Created:**
1. SetupWizard.tsx - Main wizard orchestrator
- 7-step configuration (Welcome → Suppliers → Inventory → Recipes → Quality → Team → Completion)
- Weighted progress tracking (complex steps count more)
- Step state management with backend synchronization
- Auto-save and resume functionality
- Skip logic for optional steps
2. StepProgress.tsx - Progress visualization
- Responsive progress bar with weighted calculation
- Desktop: Full step indicators with descriptions
- Mobile: Horizontal scrolling step indicators
- Visual completion status (checkmarks for completed steps)
- Shows optional vs required steps
3. StepNavigation.tsx - Navigation controls
- Back/Skip/Continue buttons with smart enabling
- Conditional skip button (only for optional steps)
- Loading states during saves
- Contextual button text based on step
4. Placeholder Step Components (7 steps):
- WelcomeStep: Introduction with feature preview
- SuppliersSetupStep: Placeholder for Phase 2
- InventorySetupStep: Placeholder for Phase 2
- RecipesSetupStep: Placeholder for Phase 2
- QualitySetupStep: Placeholder for Phase 3
- TeamSetupStep: Placeholder for Phase 3
- CompletionStep: Success celebration
**Routing & Integration:**
- Added /app/setup route to routes.config.ts and AppRouter.tsx
- Created SetupPage wrapper component
- Integrated with OnboardingWizard CompletionStep
- Added "One More Thing" CTA after onboarding
- Choice: "Configurar Ahora (15 min)" or "Lo haré después"
- Smooth transition from onboarding to setup
**Key Features:**
✅ Weighted progress calculation (steps weighted by complexity/time)
✅ Mobile and desktop responsive design
✅ Step state persistence (save & resume)
✅ Skip logic for optional steps (Quality, Team)
✅ Backend integration ready (uses existing useUserProgress hooks)
✅ Consistent with existing OnboardingWizard patterns
✅ Loading and error states
✅ Accessibility support (ARIA labels, keyboard navigation ready)
**Architecture Decisions:**
- Reuses OnboardingWizard patterns (StepConfig interface, progress tracking)
- Integrates with existing backend (user_progress table, step completion API)
- AppShell layout (shows header & sidebar for context)
- Modular step components (easy to implement individually in Phases 2-3)
**Progress:**
Phase 1 (Foundation): ✅ COMPLETE
- Component structure ✅
- Navigation & progress ✅
- Routing & integration ✅
- Placeholder steps ✅
Phase 2 (Core Steps): 🔜 NEXT
- Suppliers setup implementation
- Inventory items setup implementation
- Recipes setup implementation
Phase 3 (Advanced Features): 🔜 FUTURE
- Quality standards implementation
- Team setup implementation
- Templates & smart defaults
**Files Changed:**
- 17 new files created
- 3 existing files modified (CompletionStep.tsx, AppRouter.tsx, routes.config.ts)
**Testing Status:**
- Components compile successfully
- No TypeScript errors
- Ready for Phase 2 implementation
Based on comprehensive design specification in:
- docs/wizard-flow-specification.md (2,144 lines)
- docs/jtbd-analysis-inventory-setup.md (461 lines)
Total implementation time: ~4 hours (Phase 1 of 6 phases)
Estimated total project: 11 weeks (Phase 1: Week 1-2 foundation ✅)
2025-11-06 11:14:09 +00:00
|
|
|
<Route
|
|
|
|
|
path="/app/onboarding"
|
2025-08-28 10:41:04 +02:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
2025-09-03 14:06:38 +02:00
|
|
|
<OnboardingPage />
|
2025-08-28 10:41:04 +02:00
|
|
|
</ProtectedRoute>
|
Implement Phase 1: Setup Wizard Foundation (Foundation & Architecture)
Created complete foundation for the bakery operations setup wizard that guides
users through post-onboarding configuration of suppliers, inventory, recipes,
quality standards, and team members.
**Core Components Created:**
1. SetupWizard.tsx - Main wizard orchestrator
- 7-step configuration (Welcome → Suppliers → Inventory → Recipes → Quality → Team → Completion)
- Weighted progress tracking (complex steps count more)
- Step state management with backend synchronization
- Auto-save and resume functionality
- Skip logic for optional steps
2. StepProgress.tsx - Progress visualization
- Responsive progress bar with weighted calculation
- Desktop: Full step indicators with descriptions
- Mobile: Horizontal scrolling step indicators
- Visual completion status (checkmarks for completed steps)
- Shows optional vs required steps
3. StepNavigation.tsx - Navigation controls
- Back/Skip/Continue buttons with smart enabling
- Conditional skip button (only for optional steps)
- Loading states during saves
- Contextual button text based on step
4. Placeholder Step Components (7 steps):
- WelcomeStep: Introduction with feature preview
- SuppliersSetupStep: Placeholder for Phase 2
- InventorySetupStep: Placeholder for Phase 2
- RecipesSetupStep: Placeholder for Phase 2
- QualitySetupStep: Placeholder for Phase 3
- TeamSetupStep: Placeholder for Phase 3
- CompletionStep: Success celebration
**Routing & Integration:**
- Added /app/setup route to routes.config.ts and AppRouter.tsx
- Created SetupPage wrapper component
- Integrated with OnboardingWizard CompletionStep
- Added "One More Thing" CTA after onboarding
- Choice: "Configurar Ahora (15 min)" or "Lo haré después"
- Smooth transition from onboarding to setup
**Key Features:**
✅ Weighted progress calculation (steps weighted by complexity/time)
✅ Mobile and desktop responsive design
✅ Step state persistence (save & resume)
✅ Skip logic for optional steps (Quality, Team)
✅ Backend integration ready (uses existing useUserProgress hooks)
✅ Consistent with existing OnboardingWizard patterns
✅ Loading and error states
✅ Accessibility support (ARIA labels, keyboard navigation ready)
**Architecture Decisions:**
- Reuses OnboardingWizard patterns (StepConfig interface, progress tracking)
- Integrates with existing backend (user_progress table, step completion API)
- AppShell layout (shows header & sidebar for context)
- Modular step components (easy to implement individually in Phases 2-3)
**Progress:**
Phase 1 (Foundation): ✅ COMPLETE
- Component structure ✅
- Navigation & progress ✅
- Routing & integration ✅
- Placeholder steps ✅
Phase 2 (Core Steps): 🔜 NEXT
- Suppliers setup implementation
- Inventory items setup implementation
- Recipes setup implementation
Phase 3 (Advanced Features): 🔜 FUTURE
- Quality standards implementation
- Team setup implementation
- Templates & smart defaults
**Files Changed:**
- 17 new files created
- 3 existing files modified (CompletionStep.tsx, AppRouter.tsx, routes.config.ts)
**Testing Status:**
- Components compile successfully
- No TypeScript errors
- Ready for Phase 2 implementation
Based on comprehensive design specification in:
- docs/wizard-flow-specification.md (2,144 lines)
- docs/jtbd-analysis-inventory-setup.md (461 lines)
Total implementation time: ~4 hours (Phase 1 of 6 phases)
Estimated total project: 11 weeks (Phase 1: Week 1-2 foundation ✅)
2025-11-06 11:14:09 +00:00
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
|
2025-11-09 09:22:08 +01:00
|
|
|
{/* Setup is now integrated into UnifiedOnboardingWizard */}
|
2025-08-28 10:41:04 +02:00
|
|
|
|
|
|
|
|
{/* Default redirects */}
|
|
|
|
|
<Route path="/app/*" element={<Navigate to="/app/dashboard" replace />} />
|
|
|
|
|
<Route path="*" element={<Navigate to="/" replace />} />
|
|
|
|
|
</Routes>
|
|
|
|
|
</Suspense>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default AppRouter;
|