How diegobrlive0904/fabrica-integrada works
Fábrica Integrada is a factory-operations application spanning customer and supplier management, inventory, orders, finance, shipping, alerts, integrations, and audit. Users enter through a tabbed React interface; the backend exposes REST routes over shared operational data, with services for inventory imports, shipping, and rules/automation. The server also runs periodic automation. Source evidence is partial, so the graph omits unverified UI-to-API links and other inferred flows.
Main entry points: App.tsx Application shell · api.ts REST routes · db.ts Operational database · rule-engine.ts Rules and automation
Components 32
Operations interface
- Application shell
src/App.tsx - Dashboard
src/components/DashboardView.tsx - Factory floor
src/components/FactoryFloor.tsx - Inventory
src/components/InventoryView.tsx - Inventory import
src/components/ExcelInventoryImportModal.tsx - Customers
src/components/CustomersView.tsx - Customer registration
src/components/CustomerRegistrationModal.tsx - Suppliers
src/components/SuppliersView.tsx - Orders
src/components/OrdersView.tsx - Financials
src/components/FinancialView.tsx - Shipping
src/components/ShippingView.tsx - Alerts
src/components/AlertsView.tsx - Integrations
src/components/IntegrationsView.tsx - WhatsApp test
src/components/WhatsAppTestModal.tsx - Audit
src/components/AuditView.tsx - Public trace
src/components/PublicTraceModal.tsx - Backup controls
src/components/SaveBackupModal.tsx - Schema viewer
src/components/DatabaseSchemaModal.tsx
Operational services
- Workbook parser
src/server/services/excel-inventory-service.ts - Shipping and tracking
src/server/services/shipping-service.ts - Rules and automation
src/server/services/rule-engine.ts
API and persistence
- HTTP server
server.ts - API handler
src/server/api-handler.ts - REST routes
src/server/routes/api.ts - Operational database
src/server/database/db.ts - JSON data file
data/fabrica_integrada_db.json
External integrations
- Tray adapter
src/server/integrations/tray/tray-adapter.ts - ERP adapter
src/server/integrations/sink-erp/sink-erp-adapter.ts - ERP provider
src/server/integrations/sink-erp/erp-provider.ts - WhatsApp provider
src/server/integrations/whatsapp/whatsapp-provider.ts - Messaging contract
src/server/integrations/whatsapp/messaging-provider.ts
Other components
- Staff user
Connections 39
- Staff user → Application shell: uses
- Application shell → Dashboard: renders
src/App.tsx - Application shell → Inventory: renders
src/App.tsx - Application shell → Customers: renders
src/App.tsx - Application shell → Suppliers: renders
src/App.tsx - Application shell → Orders: renders
src/App.tsx - Application shell → Financials: renders
src/App.tsx - Application shell → Shipping: renders
src/App.tsx - Application shell → Alerts: renders
src/App.tsx - Application shell → Integrations: renders
src/App.tsx - Application shell → Audit: renders
src/App.tsx - Application shell → Public trace: renders
src/App.tsx - Application shell → Backup controls: renders
src/App.tsx - Application shell → Schema viewer: renders
src/App.tsx - Dashboard → Factory floor: renders
src/components/DashboardView.tsx - Inventory → Inventory import: opens
src/components/InventoryView.tsx - Customers → Customer registration: opens
src/components/CustomersView.tsx - Integrations → WhatsApp test: opens
src/components/IntegrationsView.tsx - Shipping → Shipping and tracking: calls
src/components/ShippingView.tsx - HTTP server → REST routes: mounts
server.ts - API handler → REST routes: delegates
src/server/api-handler.ts - REST routes → Operational database: reads/writes
src/server/routes/api.ts - REST routes → Workbook parser: parses workbook
src/server/routes/api.ts - REST routes → Shipping and tracking: calls
src/server/routes/api.ts - REST routes → Rules and automation: validates rules
src/server/routes/api.ts - REST routes → Tray adapter: dispatches
src/server/routes/api.ts - REST routes → ERP adapter: dispatches
src/server/routes/api.ts - REST routes → WhatsApp provider: dispatches
src/server/routes/api.ts - HTTP server → Rules and automation: runs periodically
server.ts - HTTP server → Operational database: runs automation
server.ts - Rules and automation → Operational database: reads/writes
src/server/services/rule-engine.ts - Rules and automation → WhatsApp provider: sends reminders
src/server/services/rule-engine.ts - Shipping and tracking → Operational database: reads/writes
src/server/services/shipping-service.ts - Tray adapter → Operational database: reads/writes
src/server/integrations/tray/tray-adapter.ts - ERP adapter → Operational database: reads/writes
src/server/integrations/sink-erp/sink-erp-adapter.ts - ERP adapter → ERP provider: uses
src/server/integrations/sink-erp/sink-erp-adapter.ts - WhatsApp provider → Operational database: logs messages
src/server/integrations/whatsapp/whatsapp-provider.ts - WhatsApp provider → Messaging contract: implements contract
src/server/integrations/whatsapp/whatsapp-provider.ts - Operational database → JSON data file: loads/persists
src/server/database/db.ts