How thornywinner/sistema-erp works
This is a React ERP for an industrial-uniforms business. Staff sign in, work through role-specific inventory, sales, production, finance, and workforce modules, while customers can use public order-tracking and sizing pages. The principal flow is order creation and payment, followed by workshop progress and delivery; the shared data context and Supabase form the internal data layer. README capabilities guide the unsampled branches; their internal calls are not asserted where source evidence was unavailable.
Main entry points: supabase.ts Supabase services · routes.tsx Route map · NuevaOrdenMultiProducto.tsx Orders and sales · ErpDataContext.tsx ERP data context
Components 25
Access and navigation
- Route map
src/app/routes.tsx - Authentication
src/app/context/AuthContext.tsx - Role permissions
src/app/utils/permissions.ts - ERP workspace
src/app/layouts/RootLayout.tsx - Role dashboards
src/app/components/dashboard - ERP data context
src/app/context/ErpDataContext.tsx - Supabase services
src/app/lib/supabase.ts
Sales and inventory
- Materials and products
src/app/pages/InventarioMateriales.tsx - Orders and sales
src/app/components/NuevaOrdenMultiProducto.tsx - Customer CRM
src/app/lib/clientesCrm.ts - Quotes and pricing
src/app/pages/Cotizaciones.tsx - Payments and collections
src/app/pages/Cobranza.tsx - Returns
src/app/pages/Devoluciones.tsx
Production operations
- Workshop Kanban
src/app/pages/talleres - Production tracking
src/app/pages/AvancePedidos.tsx - Public order tracking
src/app/pages/publico/SeguimientoPedido.tsx - Customer sizing
src/app/pages/publico/CapturaTallas.tsx - Supplier management
src/app/pages/Proveedores.tsx
Finance and workforce
- Invoicing and CFDI
src/app/pages/facturacion - Reports and commissions
src/app/pages/Reportes.tsx - Attendance and leave
src/app/pages/Vacaciones.tsx - Fixed assets
src/app/pages/ActivoFijo.tsx - Notifications
src/app/components/notificaciones
Other components
- Staff user
- Customer
Connections 26
- Staff user → Route map: opens app
src/app/routes.tsx - Customer → Route map: opens public pages
src/app/routes.tsx - Route map → ERP workspace: renders workspace
src/app/routes.tsx - Route map → Public order tracking: routes to
src/app/routes.tsx - Route map → Customer sizing: routes to
src/app/routes.tsx - Route map → Role dashboards: routes to
src/app/routes.tsx - Authentication → Supabase services: authenticates with
src/app/context/AuthContext.tsx - ERP workspace → Role permissions: checks access
- ERP workspace → Role dashboards: hosts pages
- ERP data context → Supabase services: loads and writes
src/app/context/ErpDataContext.tsx - Orders and sales → ERP data context: reads and updates
src/app/components/NuevaOrdenMultiProducto.tsx - Orders and sales → Customer CRM: uses customer history
src/app/lib/clientesCrm.ts - Orders and sales → Payments and collections: records payments
- Orders and sales → Workshop Kanban: queues production
- Materials and products → ERP data context: uses shared data
- Workshop Kanban → Production tracking: reports progress
- Public order tracking → Supabase services: reads public status
- Customer sizing → Supabase services: saves sizing
- Supplier management → Materials and products: supports replenishment
- Returns → Payments and collections: affects balances
- Invoicing and CFDI → Supabase services: uses backend
src/app/pages/facturacion/FacturaForm.tsx - Attendance and leave → Supabase services: uses backend
- Fixed assets → Supabase services: uses backend
- Notifications → Supabase services: uses backend
- Quotes and pricing → Orders and sales: supports order sales
- Reports and commissions → ERP data context: uses business data