How enochblake/autocare works
AutoCare is a multi-tenant service-management product connecting vehicle owners with garages. Customers register, maintain vehicles, request visits, and follow approved repairs through quotes, work, and invoices; garage staff manage bookings, scheduling, jobs, inventory, and billing according to role. History, photos, reminders, and payment integrations extend that core workflow. The map uses README capabilities plus indexed source references; unsampled route internals are represented at their exact route paths, and uncertain runtime links are omitted.
Main entry points: dashboard/route.ts Workspace dashboard · context.ts Identity and roles · staff/route.ts Staff and invitations · scope.ts Garage access scope
Components 26
Access and tenancy
- Workspace dashboard
src/app/api/dashboard/route.ts - Identity and roles
src/server/auth/context.ts - Garage access scope
src/server/garage/scope.ts - Supabase Auth
Service operations
- Visit requests
src/app/api/bookings/route.ts - Booking creation
src/server/bookings/service.ts - Workshop calendar
src/app/api/schedule/route.ts - Repair jobs
src/app/api/jobs/route.ts - Workshop workflows
src/server/workshop.ts - Parts inventory
src/app/api/inventory/route.ts - Staff and invitations
src/app/api/staff/route.ts
Customer records
- Vehicles
src/app/api/vehicles/route.ts - Service history
src/app/api/history/route.ts - History access
src/server/history.ts - Repair photos
src/app/api/repair-photos/route.ts - Garage settings
src/app/api/garage-settings/route.ts
Billing and payments
- Invoices
src/app/api/invoices/route.ts - Invoice payments
src/app/api/payments/paystack/route.ts - Paystack integration
src/server/payments/paystack.ts - M-Pesa payments
src/server/payments/mpesa.ts - Garage subscriptions
src/app/api/billing/subscribe/route.ts
Other components
- Customer
- Garage staff
- Supabase database
- Paystack service
- M-Pesa Daraja
Connections 42
- Customer → Workspace dashboard: opens workspace
- Garage staff → Workspace dashboard: opens workspace
- Workspace dashboard → Identity and roles: loads workspace
src/app/api/dashboard/route.ts - Workspace dashboard → Supabase database: reads metrics
src/app/api/dashboard/route.ts - Identity and roles → Supabase Auth: checks user
src/server/auth/context.ts - Identity and roles → Supabase database: reads profile
src/server/auth/context.ts - Garage access scope → Identity and roles: authenticates user
src/server/garage/scope.ts - Garage access scope → Supabase database: reads memberships
src/server/garage/scope.ts - Customer → Visit requests: requests visit
- Visit requests → Booking creation: creates booking
src/app/api/bookings/route.ts - Booking creation → Supabase database: creates booking
src/server/bookings/service.ts - Garage staff → Workshop calendar: schedules visit
- Workshop calendar → Workshop workflows: saves slot
src/app/api/schedule/route.ts - Workshop workflows → Supabase database: calls workflow RPC
- Garage staff → Repair jobs: manages repairs
- Repair jobs → Supabase database: reads and updates jobs
- Garage staff → Parts inventory: manages stock
- Parts inventory → Supabase database: reads and writes stock
src/app/api/inventory/route.ts - Garage staff → Staff and invitations: manages access
src/app/api/staff/route.ts - Staff and invitations → Garage access scope: checks staff scope
src/app/api/staff/route.ts - Staff and invitations → Supabase database: manages memberships
src/app/api/staff/route.ts - Customer → Vehicles: manages vehicles
- Vehicles → Supabase database: reads and writes vehicles
- Customer → Service history: views service history
- Service history → History access: loads vehicle history
src/app/api/history/route.ts - History access → Supabase database: reads history
src/server/history.ts - Customer → Service history: updates mileage and reminders
src/app/api/history/route.ts - Garage staff → Repair photos: shares repair photos
- Customer → Repair photos: shares repair photos
- Repair photos → Supabase database: checks booking access
src/app/api/repair-photos/route.ts - Garage staff → Garage settings: customizes garage
- Garage settings → Supabase database: reads and writes settings
src/app/api/garage-settings/route.ts - Customer → Invoices: views invoices
- Garage staff → Invoices: issues invoices
- Invoices → Supabase database: reads invoices
src/app/api/invoices/route.ts - Customer → Invoice payments: pays invoice
- Invoice payments → Paystack integration: starts checkout
src/app/api/payments/paystack/route.ts - Paystack integration → Paystack service: creates transaction
- Customer → M-Pesa payments: pays by M-Pesa
- M-Pesa payments → M-Pesa Daraja: initiates payment
- Garage staff → Garage subscriptions: starts subscription
- Garage subscriptions → Paystack integration: starts subscription checkout
src/app/api/billing/subscribe/route.ts