How tandah-marcelle/gps_tracker_front works
Camtrack is a React frontend for GPS tracker inventory and installation management, with separate stock-manager and technician workflows. Users authenticate through login or registration with OTP verification; role-guarded routing then presents managers with dashboard and resource-management screens, while technicians view and complete assigned interventions. The screens call a separate REST backend through typed resource APIs and a shared Axios client; this frontend does not access a database. The graph follows explicit imports and documented behavior; unsampled vehicle, dashboard, and auth API details are summarized at their source paths.
Main entry points: App.tsx Role-based routes · axios.ts Shared Axios client · Interventions.tsx Intervention scheduling · AuthContext.tsx Auth state & OTP
Components 31
Access & routing
- Login
src/pages/Login.tsx - Register
src/pages/Register.tsx - Auth state & OTP
src/context/AuthContext.tsx - Role-based routes
src/App.tsx - Auth & role guard
src/components/ProtectedRoute.tsx - App shell
src/components/AppLayout.tsx
Inventory management
- Stock dashboard
src/pages/Dashboard.tsx - Tracker inventory
src/pages/Trackers.tsx - Tracker actions & history
src/components/trackers - Status transitions
src/lib/trackers.ts - Client management
src/pages/Clients.tsx - Client form
src/components/clients/ClientFormModal.tsx - Vehicle management
src/pages/Vehicles.tsx - Vehicle form
src/components/vehicles/VehicleFormModal.tsx
Installation workflow
- Intervention scheduling
src/pages/Interventions.tsx - Intervention form
src/components/interventions/InterventionFormModal.tsx - Assigned interventions
src/pages/MyInterventions.tsx - Intervention completion
src/components/interventions/CompleteInterventionModal.tsx
REST integration
- Auth API
src/api/auth.ts - Dashboard API
src/api/dashboard.ts - Clients API
src/api/clients.ts - Vehicles API
src/api/vehicles.ts - Trackers API
src/api/trackers.ts - Interventions API
src/api/interventions.ts - Shared Axios client
src/api/axios.ts
Shared presentation
- Status badge
src/components/StatusBadge.tsx - Debounced search
src/hooks/useDebouncedValue.ts - UI primitives
src/components/ui - Auth page shell
src/components/auth/AuthShell.tsx
Other components
- Manager or technician
- Camtrack REST backend
Connections 48
- Manager or technician → Login: enters credentials
README.md - Manager or technician → Register: creates account
README.md - Login → Auth state & OTP: requests login and verifies OTP
src/pages/Login.tsx - Register → Auth state & OTP: registers and verifies OTP
src/pages/Register.tsx - Auth state & OTP → Auth API: calls auth methods
src/context/AuthContext.tsx - Role-based routes → Auth state & OTP: reads auth state
src/App.tsx - Role-based routes → Auth & role guard: wraps protected screens
src/App.tsx - Auth & role guard → Auth state & OTP: checks user and role
src/components/ProtectedRoute.tsx - Role-based routes → Login: routes to
src/App.tsx - Role-based routes → Register: routes to
src/App.tsx - Role-based routes → Stock dashboard: routes managers to
src/App.tsx - Role-based routes → Tracker inventory: routes managers to
src/App.tsx - Role-based routes → Client management: routes managers to
src/App.tsx - Role-based routes → Vehicle management: routes managers to
src/App.tsx - Role-based routes → Intervention scheduling: routes managers to
src/App.tsx - Role-based routes → Assigned interventions: routes technicians to
src/App.tsx - Role-based routes → App shell: wraps protected screens
src/App.tsx - Login → Auth page shell: renders
src/pages/Login.tsx - Register → Auth page shell: renders
src/pages/Register.tsx - Stock dashboard → Dashboard API: fetches metrics
src/pages/Dashboard.tsx - Tracker inventory → Trackers API: loads and mutates trackers
src/pages/Trackers.tsx - Tracker inventory → Tracker actions & history: opens tracker actions
src/pages/Trackers.tsx - Tracker actions & history → Trackers API: reads and updates trackers
src/components/trackers/ChangeStatusModal.tsx - Tracker actions & history → Status transitions: checks allowed transitions
src/components/trackers/ChangeStatusModal.tsx - Tracker actions & history → Status badge: renders status
src/components/trackers/ChangeStatusModal.tsx - Client management → Clients API: loads and deletes clients
src/pages/Clients.tsx - Client management → Client form: opens create or edit
src/pages/Clients.tsx - Client form → Clients API: creates or updates
src/components/clients/ClientFormModal.tsx - Vehicle management → Vehicles API: manages vehicles
src/pages/Vehicles.tsx - Vehicle management → Clients API: loads client choices
src/pages/Vehicles.tsx - Vehicle management → Vehicle form: opens vehicle form
src/pages/Vehicles.tsx - Vehicle form → Vehicles API: creates or updates
src/components/vehicles/VehicleFormModal.tsx - Intervention scheduling → Interventions API: loads and schedules
src/pages/Interventions.tsx - Intervention scheduling → Clients API: loads client choices
src/pages/Interventions.tsx - Intervention scheduling → Vehicles API: loads vehicle choices
src/pages/Interventions.tsx - Intervention scheduling → Intervention form: opens scheduler
src/pages/Interventions.tsx - Intervention form → Interventions API: creates intervention
src/components/interventions/InterventionFormModal.tsx - Assigned interventions → Interventions API: loads assignments
src/pages/MyInterventions.tsx - Assigned interventions → Intervention completion: opens completion flow
src/pages/MyInterventions.tsx - Intervention completion → Interventions API: completes intervention
src/components/interventions/CompleteInterventionModal.tsx - Intervention completion → Trackers API: loads available trackers
src/components/interventions/CompleteInterventionModal.tsx - Auth API → Shared Axios client: sends requests through
src/api/auth.ts - Dashboard API → Shared Axios client: sends requests through
src/api/dashboard.ts - Clients API → Shared Axios client: sends requests through
src/api/clients.ts - Vehicles API → Shared Axios client: sends requests through
src/api/vehicles.ts - Trackers API → Shared Axios client: sends requests through
src/api/trackers.ts - Interventions API → Shared Axios client: sends requests through
src/api/interventions.ts - Shared Axios client → Camtrack REST backend: calls REST endpoints
README.md