How rogeraosilva32-debug/system works
ServiçoApp is a B2B field-team management platform licensed per company. The principal workflow is company setup and service registration, followed by assigning a service visit to a collaborator, who views the task, shares location while it is in progress, and completes it. Company and platform administration, messaging, reporting, and CRM/API integrations are distinct capabilities. The graph follows documented workflows and visible routing; unsampled implementation details are represented only where the README supports them.
Main entry points: App.jsx Role-based app routes · CompanyAdmin.jsx Company admin · CollaboratorTasks.jsx Collaborator tasks · PlatformAdmin.jsx Platform console
Components 26
App and access
- Company admin
src/pages/CompanyAdmin.jsx - Role-based app routes
src/App.jsx - Authentication and roles
src/context/AuthContext.jsx
Company operations
- Company settings
src/hooks/useCompanySettings.js - Collaborators and services
src/pages/company/CollaboratorsAndServices.jsx - Visit assignments
src/pages/company/AssignmentsTab.jsx - Company live map
src/pages/company/LiveMapTab.jsx - Company messaging
src/pages/company/MessagesTab.jsx - Company reports
src/pages/company/ReportsTab.jsx
Field work
- Collaborator tasks
src/pages/CollaboratorTasks.jsx - Route mapping
src/components/RouteMap.jsx - Address geocoding
src/utils/geocoding.js - Location sharing
src/context/CourierGps.jsx - GPS transport
src/utils/gps.js
Platform administration
- Platform console
src/pages/PlatformAdmin.jsx - System event log
src/services/eventLog.js
Integrations and data
- Supabase client
src/services/supabase.js - CRM import function
supabase/functions/crm-import/index.ts - Outbound data API
supabase/functions/api-data/index.ts - Push delivery function
supabase/functions/send-push/index.ts - Supabase backend
Other components
- Collaborator
- Platform admin
- External CRM
- External API consumer
- Mapping services
Connections 26
- Company admin → Role-based app routes: uses company portal
src/App.jsx - Collaborator → Role-based app routes: uses task portal
- Platform admin → Role-based app routes: uses admin portal
- Role-based app routes → Authentication and roles: loads auth state
src/App.jsx - Role-based app routes → Collaborator tasks: routes tasks
src/App.jsx - Role-based app routes → Platform console: routes platform admin
src/App.jsx - Collaborator tasks → Supabase client: reads and updates tasks
src/pages/CollaboratorTasks.jsx - Company admin → Collaborators and services: manages team and services
- Company admin → Visit assignments: creates assignments
- Visit assignments → Address geocoding: geocodes addresses
- Address geocoding → Mapping services: queries geocoders
src/utils/geocoding.js - Collaborator tasks → Route mapping: shows visit route
src/pages/CollaboratorTasks.jsx - Collaborator tasks → Location sharing: starts visit tracking
- Location sharing → GPS transport: uses GPS transport
src/context/CourierGps.jsx - GPS transport → Supabase client: writes location updates
src/utils/gps.js - Company live map → Supabase backend: receives live location
- Company admin → Company messaging: manages messages
- Company admin → Company reports: views reports
- Platform admin → Platform console: manages companies
- Platform console → System event log: views system log
src/pages/PlatformAdmin.jsx - System event log → Supabase client: records events
src/services/eventLog.js - External CRM → CRM import function: provides CRM records
- CRM import function → Supabase backend: creates imported records
- Supabase backend → Outbound data API: serves authorized data
- Outbound data API → External API consumer: returns company data
- Push delivery function → Supabase backend: uses backend services