How mkaiyr/ai-auto works
AI Auto is a car-ownership web app, with a Capacitor mobile shell. The main workflow is landing page or direct entry → authentication for private routes → car, service-history, expense, or assistant features. Account data repositories use Supabase; the product also documents car details, maintenance history, expense summaries, reminders, and AI guidance. Some feature implementations were not sampled, so their internal calls are omitted rather than inferred.
Main entry points: App.tsx App routing · AppShell.tsx Account shell · repositories.ts Repository selection · AuthProvider.tsx Session and auth
Components 22
Entry and account
- App routing
src/App.tsx - History router
src/router.tsx - Sign-in screens
src/auth/AuthPage.tsx - Session and auth
src/auth/AuthProvider.tsx - Landing content
src/data/content.ts
Car ownership
- Account shell
src/app/AppShell.tsx - Car pages and form
src/app/pages/CarPage.tsx - Car state
src/app/car/useCar.ts - Vehicle catalog
src/app/car/catalog/generations.ts - History and service forms
src/app/pages/ServiceForm.tsx - Service records
src/app/service/useServiceRecords.ts - Expense summaries
src/app/pages/ExpensesPage.tsx - Maintenance reminders
src/app/pages/SoonPage.tsx
AI assistant
- Assistant page
src/ai/AssistantPage.tsx - Chat interfaces
src/ai/AssistantChat.tsx - Mobile chat
src/ai/AssistantChatMobile.tsx
Data services
- Repository selection
src/app/repositories.ts - Car data access
src/app/car/carRemote.ts - Service data access
src/app/service/serviceRemote.ts - Supabase client
src/lib/supabase.ts - Supabase data and auth
Other components
- Driver
Connections 27
- Driver → App routing: opens
src/App.tsx - App routing → History router: tracks routes
src/App.tsx - App routing → Sign-in screens: shows sign-in
src/App.tsx - App routing → Session and auth: checks session
src/App.tsx - App routing → Account shell: opens cabinet
src/App.tsx - App routing → Assistant page: opens assistant
src/App.tsx - App routing → Landing content: renders landing
- Sign-in screens → Session and auth: submits credentials
src/auth/AuthPage.tsx - Session and auth → Supabase client: authenticates
src/auth/AuthProvider.tsx - Account shell → Car pages and form: renders
src/app/AppShell.tsx - Account shell → Expense summaries: renders
src/app/AppShell.tsx - Account shell → Assistant page: renders assistant section
src/app/AppShell.tsx - Car pages and form → Car state: uses car state
- Car pages and form → Vehicle catalog: selects vehicle
- Account shell → History and service forms: renders history
src/app/AppShell.tsx - History and service forms → Service records: uses records
src/app/pages/ServiceForm.tsx - Assistant page → Chat interfaces: selects chat
src/ai/AssistantPage.tsx - Assistant page → Mobile chat: selects mobile chat
src/ai/AssistantPage.tsx - Car state → Repository selection: loads car data
src/app/car/useCar.ts - Service records → Repository selection: loads service data
src/app/service/useServiceRecords.ts - Repository selection → Car data access: creates remote repository
src/app/repositories.ts - Repository selection → Service data access: creates remote repository
src/app/repositories.ts - Repository selection → Supabase client: gets client
src/app/repositories.ts - Supabase client → Supabase data and auth: connects to
- Session and auth → Supabase data and auth: uses auth service
- Expense summaries → Service records: summarizes records
- Maintenance reminders → Driver: offers reminders