How cfscell2026-maker/cargo-tracker-v4 works
Cargo Tracker is a React/Supabase application for tracking cargo and customs operations at a dry port. Agents sign in, navigate role-specific screens, and use RPC actions to record and advance cargo through operational stages; supervisors and administrators also manage stock, warehouses, parking, users, settings, and reports. The server validates sessions and permissions before dispatching actions that operate on Supabase data. The README is empty, and excerpts are partial, so the graph keeps uncertain internal wiring out while retaining major capabilities evidenced by the source tree and sampled code.
Main entry points: registry.ts Action registry · rpc.ts RPC client · App.tsx App shell · index.ts RPC endpoint
Components 25
Web application
- Web entry
apps/web/src/main.tsx - App shell
apps/web/src/App.tsx - Operational screens
apps/web/src/screens.tsx - Cargo detail
apps/web/src/detail.tsx - Parking screen
apps/web/src/parking.tsx - UI primitives
apps/web/src/lib/ui.tsx - RPC client
apps/web/src/lib/rpc.ts - Supabase client
apps/web/src/lib/supabase.ts
RPC backend
- RPC endpoint
supabase/functions/rpc/index.ts - Session and audit
supabase/functions/rpc/supa.ts - Action registry
supabase/functions/rpc/actions/registry.ts
Business domain
- Workflow rules
supabase/functions/_shared/domaine/src/workflow.ts - Normalization rules
supabase/functions/_shared/domaine/src/normalisation.ts - Domain constants
supabase/functions/_shared/domaine/src/constantes.ts
Operational services
- Cargo operations
supabase/functions/rpc/actions/ecriture.ts - Cargo and stock reads
supabase/functions/rpc/actions/lecture.ts - Reports
supabase/functions/rpc/actions/rapports.ts - Stock operations
supabase/functions/rpc/actions/stock.ts - Warehouse operations
supabase/functions/rpc/actions/entrepots.ts - Parking operations
supabase/functions/rpc/actions/parking.ts - Accounts and settings
supabase/functions/rpc/actions/utilisateurs.ts - Parameter actions
supabase/functions/rpc/actions/parametres.ts
Persistence
- Supabase data
Other components
- Agent
- Supabase Auth
Connections 35
- Agent → Web entry: uses
- Web entry → App shell: renders
- App shell → Operational screens: renders
- App shell → UI primitives: uses
- Operational screens → UI primitives: uses
- Operational screens → RPC client: requests
- Cargo detail → RPC client: requests
- Parking screen → RPC client: requests
- App shell → RPC client: requests
- RPC client → Supabase client: uses
- RPC client → RPC endpoint: sends RPC
- RPC endpoint → Session and audit: validates session
- Session and audit → Supabase Auth: validates JWT
- Session and audit → Supabase data: reads profiles, writes audit
- RPC endpoint → Action registry: dispatches action
- RPC endpoint → Workflow rules: checks permission
- Action registry → Cargo operations: dispatches
- Action registry → Cargo and stock reads: dispatches
- Action registry → Reports: dispatches
- Action registry → Stock operations: dispatches
- Action registry → Warehouse operations: dispatches
- Action registry → Parking operations: dispatches
- Action registry → Accounts and settings: dispatches
- Action registry → Parameter actions: dispatches
- Cargo operations → Supabase data: reads and writes
- Cargo and stock reads → Supabase data: reads
- Reports → Supabase data: reads
- Stock operations → Supabase data: reads and writes
- Warehouse operations → Supabase data: reads and writes
- Parking operations → Supabase data: reads and writes
- Accounts and settings → Supabase data: reads and writes
- Parameter actions → Supabase data: reads and writes
- Cargo operations → Normalization rules: validates input
- Cargo operations → Workflow rules: applies workflow
- Reports → Domain constants: uses domain rules