How sam-make/trade-in-pro works
Trade-In Pro is a multi-shop SaaS for phone trade-ins and repair-shop operations. The main workflow is a seller diagnosing a device, applying shop-configured pricing rules, and retaining the resulting estimate; the repository also exposes repair, customer, invoice, administration, and tracking capabilities. The graph combines excerpted calls and SOURCE INDEX references with README-described capabilities. Several routes and subsystems were not sampled, so their internal wiring is intentionally omitted or marked unverified.
Main entry points: repairs.functions.ts Repair operations · useWorkspace.ts Workspace context · index.tsx Landing page · AppShell.tsx App shell
Components 26
Entry and identity
- Landing page
src/routes/index.tsx - Auth state
src/hooks/useAuth.tsx - Sign-in and signup
src/routes/connexion.tsx - Authenticated routes
src/routes/_authenticated/route.tsx - App shell
src/components/app/AppShell.tsx
Trade-in workflow
- Device estimation
src/routes/_authenticated/estimation.tsx - Pricing rules
src/lib/pricing.ts - Market analysis
src/components/estimation/MarketAnalysisPanel.tsx - Estimate history
src/routes/_authenticated/historique.tsx - Shop dashboard
src/routes/_authenticated/tableau-de-bord.tsx
Repairs and customers
- Repair intake
src/routes/_authenticated/reparations.nouvelle.tsx - Repair records
src/routes/_authenticated/reparations.$id.tsx - Repair operations
src/lib/repairs.functions.ts - Repair persistence
src/lib/repairs.server.ts - Repair domain
src/lib/repairs.ts - Client records
src/routes/_authenticated/clients.index.tsx - Client details
src/routes/_authenticated/clients.$id.tsx - Public repair tracking
src/routes/suivi.$token.tsx
Shop administration
- Shop settings
src/routes/_authenticated/administration.tsx - Platform admin
src/routes/_authenticated/admin.tsx - Workspace context
src/hooks/useWorkspace.ts - Workspace services
src/lib/workspace.functions.ts - Owner analytics
src/lib/owner-analytics.functions.ts
Data and services
- Supabase client
src/integrations/supabase/client.ts - Admin client
src/integrations/supabase/client.server.ts
Other components
- Shop user
Connections 26
- Shop user → Landing page: opens
src/routes/index.tsx - Landing page → Sign-in and signup: links to
src/routes/index.tsx - Landing page → Shop dashboard: links to
src/routes/index.tsx - Auth state → Supabase client: reads session
src/hooks/useAuth.tsx - Authenticated routes → Supabase client: checks user
src/routes/_authenticated/route.tsx - Authenticated routes → App shell: renders
src/routes/_authenticated/route.tsx - App shell → Workspace context: loads context
src/components/app/AppShell.tsx - Workspace context → Workspace services: invokes
src/hooks/useWorkspace.ts - Workspace context → Auth state: uses identity
src/hooks/useWorkspace.ts - Device estimation → Pricing rules: uses pricing
- Device estimation → Estimate history: archives estimate
- Market analysis → Pricing rules: uses pricing
src/components/estimation/MarketAnalysisPanel.tsx - Shop settings → Pricing rules: configures rules
src/routes/_authenticated/administration.tsx - Shop dashboard → Owner analytics: loads metrics
- Repair intake → Repair operations: submits repair
- Repair operations → Repair persistence: delegates to
src/lib/repairs.functions.ts - Repair operations → Repair domain: uses domain
src/lib/repairs.functions.ts - Repair persistence → Repair domain: uses domain
src/lib/repairs.server.ts - Repair persistence → Public repair tracking: supports status
- Client records → Client details: links to
src/routes/_authenticated/clients.$id.tsx - Client details → Repair domain: formats records
src/routes/_authenticated/clients.$id.tsx - Client details → Repair operations: saves customer
- Shop settings → Workspace context: uses context
src/routes/_authenticated/administration.tsx - Platform admin → Admin client: uses admin access
- App shell → Platform admin: loads admin data
src/components/app/AppShell.tsx - Supabase client → Shop user: authenticates