How dev-aylton/controle-app works
Controle-App is a multi-company inventory-management PWA. Its main workflow configures environments and products, records stock movements or inventory counts, then supports replenishment and sales-based stock reduction, with reports and audit for review. Authentication, company membership, role-based access, and Supabase-backed persistence underpin that workflow; offline movement queuing is a separate operational branch. The graph uses README capability descriptions and the supplied source excerpts/index; several feature implementations were not sampled, so their internal links are omitted where evidence is limited.
Main entry points: App.tsx Application routes · supabase.ts Supabase client · movements.ts Movement operations · MovementsPage.tsx Movement entry and history
Components 23
Identity and companies
- Authentication
src/features/auth/AuthContext.tsx - Company context
src/features/company/CompanyContext.tsx - Role permissions
src/lib/uiPermissions.ts
Inventory operations
- Environments
src/features/environments/environmentService.ts - Product catalog
src/features/products/productCatalog.ts - Product management
src/pages/ProductsPage.tsx - Movement entry and history
src/pages/MovementsPage.tsx - Movement form
src/features/movements/MovementLaunchForm.tsx - Movement operations
src/services/movements.ts - Inventory counts
src/pages/InventoryPage.tsx - Offline synchronization
src/features/offline/sync.ts - Offline queue and cache
src/features/offline/db.ts
Purchasing and sales
- Purchase planning
src/pages/PurchaseListPage.tsx - Purchasing rules and services
src/features/management - Sales import and pricing
src/pages/SalesImportPage.tsx - Sales operations
src/features/sales/salesService.ts - Reports and audit
src/pages
Shared platform
- Application routes
src/app/App.tsx - Supabase client
src/lib/supabase.ts - PostgreSQL and RLS
- Private support
src/features/support/supportService.ts - Privacy and account data
src/features/privacy
Other components
- Company user
Connections 30
- Company user → Application routes: uses
README.md - Application routes → Authentication: provides
src/app/App.tsx - Application routes → Company context: provides
src/app/App.tsx - Application routes → Product management: routes to
src/app/App.tsx - Application routes → Movement entry and history: routes to
src/app/App.tsx - Application routes → Inventory counts: routes to
src/app/App.tsx - Application routes → Purchase planning: routes to
src/app/App.tsx - Application routes → Sales import and pricing: routes to
src/app/App.tsx - Application routes → Reports and audit: routes to
src/app/App.tsx - Company context → Authentication: reads session
src/features/company/CompanyContext.tsx - Company context → Supabase client: loads company data
src/features/company/CompanyContext.tsx - Authentication → Supabase client: uses
src/features/auth/AuthContext.tsx - Role permissions → Company context: checks role
README.md - Product management → Product catalog: uses catalog
src/pages/ProductsPage.tsx - Product management → Movement operations: reads stock
src/pages/ProductsPage.tsx - Movement entry and history → Movement form: renders
src/pages/MovementsPage.tsx - Movement entry and history → Movement operations: records movements
src/pages/MovementsPage.tsx - Inventory counts → Movement operations: applies counts
src/pages/InventoryPage.tsx - Movement entry and history → Offline synchronization: queues offline
src/pages/MovementsPage.tsx - Offline synchronization → Offline queue and cache: reads and writes
src/features/offline/sync.ts - Offline synchronization → Movement operations: syncs movements
src/features/offline/sync.ts - Purchase planning → Purchasing rules and services: plans replenishment
src/pages/PurchaseListPage.tsx - Sales import and pricing → Sales operations: imports sales
src/pages/SalesImportPage.tsx - Sales import and pricing → Movement operations: reduces stock
src/pages/SalesImportPage.tsx - Movement operations → Supabase client: calls RPCs
src/services/movements.ts - Sales operations → Supabase client: calls RPCs
src/features/sales/salesService.ts - Supabase client → PostgreSQL and RLS: persists data
README.md - Environments → Supabase client: loads environments
src/features/environments/environmentService.ts - Private support → Supabase client: stores conversations
src/features/support/supportService.ts - Privacy and account data → Company user: supports data rights
README.md