How christiancl92/rental_escrow works
El Solar is a vacation-rental dApp: guests browse property listings, choose dates, and create USDC-backed bookings; guests can review or cancel reservations, while the owner releases escrow after check-in. The Next.js client coordinates API-backed booking records in Supabase with client-signed Solana transactions; the Anchor program enforces escrow rules. The README also documents a separate, wallet-free marketing-copy generator. Edges are limited to visible calls and README architecture statements; some page-to-hook wiring and backend integrations are not sampled.
Main entry points: BookingCard.tsx Date booking · lib.rs Escrow instructions · useRentalProgram.ts Wallet program client · initSupabase.ts Supabase database
Components 29
Rental web app
- Property listings
app/app/page.tsx - Property details
app/app/properties/[id]/page.tsx - Listing data
app/lib/properties.ts - Date booking
app/components/BookingCard.tsx - Guest bookings
app/app/bookings/page.tsx - Booking controls
app/components/GuestBookings.tsx - Owner dashboard
app/app/admin/page.tsx - Wallet program client
app/hooks/useRentalProgram.ts - Booking API client
app/hooks/useBookingAPI.ts - Guest escrow queries
app/hooks/useGuestBookings.ts - Admin escrow queries
app/hooks/useEscrowQueries.ts
Booking records
- Booking CRUD
app/app/api/bookings/route.ts - Availability checks
app/app/api/bookings/availability/route.ts - Booked dates
app/app/api/bookings/booked-dates/route.ts - Wallet booking lookup
app/app/api/bookings/guest/route.ts - Supabase database
app/lib/supabase/initSupabase.ts
Solana escrow
- Escrow instructions
programs/rental_escrow/src/lib.rs - Create escrow
programs/rental_escrow/src/instructions/initialize.rs - Release payment
programs/rental_escrow/src/instructions/release_payment.rs - Cancel and refund
programs/rental_escrow/src/instructions/cancel_booking.rs - Escrow state
programs/rental_escrow/src/state.rs
Marketing generator
- Marketing tool
app/app/tools/marketing/page.tsx - Copy generation API
app/app/api/marketing/generate/route.ts - Language model client
app/lib/llm.ts - Output validation
app/lib/marketing/schema.ts
Other components
- Guest
- Property owner
- Solana network
- LLM provider
Connections 33
- Guest → Property listings: browses
- Property listings → Property details: opens listing
- Property details → Listing data: uses listings
- Property details → Date booking: offers booking
- Date booking → Availability checks: checks dates
app/components/BookingCard.tsx - Date booking → Booked dates: loads dates
- Date booking → Booking API client: calls
app/components/BookingCard.tsx - Date booking → Wallet program client: creates escrow
app/components/BookingCard.tsx - Booking API client → Booking CRUD: sends booking requests
- Availability checks → Supabase database: checks conflicts
- Booked dates → Supabase database: reads reservations
- Booking CRUD → Supabase database: stores bookings
- Guest bookings → Booking controls: shows bookings
- Booking controls → Guest escrow queries: uses
- Guest escrow queries → Wallet program client: reads and cancels escrow
app/hooks/useGuestBookings.ts - Guest escrow queries → Wallet booking lookup: fetches booking signatures
app/hooks/useGuestBookings.ts - Wallet booking lookup → Supabase database: looks up bookings
- Owner dashboard → Admin escrow queries: manages escrows
- Admin escrow queries → Wallet program client: reads and releases
app/hooks/useEscrowQueries.ts - Wallet program client → Solana network: submits transactions
app/hooks/useRentalProgram.ts - Solana network → Escrow instructions: executes instructions
- Escrow instructions → Create escrow: dispatches
programs/rental_escrow/src/lib.rs - Escrow instructions → Release payment: dispatches
programs/rental_escrow/src/lib.rs - Escrow instructions → Cancel and refund: dispatches
programs/rental_escrow/src/lib.rs - Create escrow → Escrow state: initializes
programs/rental_escrow/src/instructions/initialize.rs - Release payment → Escrow state: updates
programs/rental_escrow/src/instructions/release_payment.rs - Cancel and refund → Escrow state: uses
- Property owner → Owner dashboard: manages rentals
- Guest → Marketing tool: requests copy
- Marketing tool → Copy generation API: submits brief
- Copy generation API → Language model client: generates copy
- Copy generation API → Output validation: validates output
- Language model client → LLM provider: calls provider