How andareomondi/jambodrive works
Cosmara is a car-rental application: customers browse vehicles, book a rental or test drive, and pay through M-Pesa; staff manage bookings, vehicles, returns, and gallery content. The graph separates customer workflows, authentication, operations, and shared data/payment infrastructure. The README describes a generic Next.js/Supabase starter and does not document these rental capabilities; several source excerpts are partial, so uncertain connections are omitted.
Main entry points: page.tsx Fleet Browse · booking-client.tsx Booking and Payment UI · route.ts M-Pesa STK Push · facilitator-client.tsx Return Handling
Components 28
Fleet Discovery
- Fleet Browse
app/cars/page.tsx - Category Browse
app/cars/category/[type]/page.tsx - Vehicle Details
components/cars/car-details-client.tsx - Fleet Gallery
components/gallery/gallery-client.tsx
Rental and Payments
- Rental Booking
app/booking/[carId]/page.tsx - Booking and Payment UI
components/booking/booking-client.tsx - Test Drive
components/booking/testdrive-client.tsx - M-Pesa STK Push
app/api/mpesa/stkpush/route.ts - Payment Callback
app/api/mpesa/callback/route.ts - Customer Dashboard
components/dashboard/dashboard-client.tsx - Booking Actions
lib/actions/bookings.ts
Identity
- Sign In and Sign Up
app/auth/login/page.tsx - Session Provider
components/auth/auth-provider.tsx - Email Confirmation
app/auth/confirm/route.ts
Fleet Operations
- Admin Dashboard
components/admin/admin-dashboard-client.tsx - Return Handling
components/facilitator/facilitator-client.tsx - Gallery Management
components/admin/admin-gallery-section.tsx - Admin Actions
lib/actions/admin.ts - Facilitator Actions
lib/actions/facilitator.ts
Data and Integrations
- Car Data Service
lib/services/cars.ts - Gallery Data Service
lib/services/gallery.ts - Server Client
lib/supabase/server.ts - Browser Client
lib/supabase/client.ts - Supabase Bookings
Other components
- Customer
- Staff
- Supabase
- M-Pesa Daraja
Connections 32
- Customer → Fleet Browse: browses
- Fleet Browse → Vehicle Details: opens vehicle
- Customer → Category Browse: filters fleet
- Customer → Fleet Gallery: views photos
- Vehicle Details → Rental Booking: starts rental
- Rental Booking → Booking and Payment UI: renders booking
- Booking and Payment UI → M-Pesa STK Push: requests payment
- M-Pesa STK Push → M-Pesa Daraja: requests STK
- M-Pesa Daraja → Payment Callback: sends result
- M-Pesa STK Push → Supabase Bookings: stores checkout ID
- Payment Callback → Supabase Bookings: updates payment
- Customer → Test Drive: requests test drive
- Customer → Customer Dashboard: manages rentals
- Customer → Sign In and Sign Up: authenticates
- Sign In and Sign Up → Email Confirmation: confirms email
- Email Confirmation → Server Client: verifies OTP
- Session Provider → Browser Client: uses session
- Server Client → Supabase: creates session client
- Browser Client → Supabase: connects
- Fleet Browse → Car Data Service: loads fleet
- Fleet Gallery → Gallery Data Service: loads images
- Staff → Admin Dashboard: manages fleet
- Staff → Return Handling: processes returns
- Staff → Gallery Management: manages gallery
- Admin Dashboard → Admin Actions: fetches fleet and bookings
- Admin Actions → Supabase: reads data
- Return Handling → Facilitator Actions: processes return
- Return Handling → Facilitator Actions: initiates fee charge
- Booking and Payment UI → Browser Client: uses realtime client
- Booking Actions → Supabase: accesses booking data
- Car Data Service → Supabase: accesses fleet data
- Gallery Data Service → Supabase: accesses gallery data