How muhammed1675/rentora works
Purpose and Entry Points
Rentora is a LAUTECH student-housing marketplace connecting tenants to admin-verified agents and listings. The primary client entry is frontend/src/index.js, which mounts the React application defined by frontend/src/App.js. Deployment targets Vercel, including serverless API routes under frontend/api/.
Client Application and Route Domains
React 19 provides the tenant, agent, and administrator experiences. Route-level pages organize key workflows: browsing and property detail/unlock in frontend/src/pages/Browse.jsx and frontend/src/pages/PropertyDetails.jsx; authenticated account management in frontend/src/pages/Profile.jsx; role-specific operations in frontend/src/pages/AgentDashboard.jsx and frontend/src/pages/AdminDashboard.jsx. Shared shell and listing presentation are in frontend/src/components/Layout.jsx and frontend/src/components/PropertyCard.jsx.
Authentication, Authorization, and Data Boundary
The browser accesses Supabase through frontend/src/lib/supabase.js, with session and role behavior centralized in frontend/src/lib/auth.js. Supabase PostgreSQL is the system of record; its Row Level Security policies enforce tenant, agent, and admin boundaries rather than relying solely on client-side routing. Canonical schema and policy evolution are represented by supabase_schema.sql, supabase_quick_fix.sql, and supabase_migration_v2.sql.
Property Marketplace and Agent Lifecycle
Agents must be verified by admins before they can operate as trusted listers. Agents manage listings, availability, inspection pricing, and earnings via frontend/src/pages/AgentDashboard.jsx; admins review verification and platform activity through frontend/src/pages/AdminDashboard.jsx. Tenant-facing discovery, comparison, and conversion are handled by frontend/src/pages/Browse.jsx, frontend/src/pages/Compare.jsx, and frontend/src/pages/PropertyDetails.jsx.
Token Unlocks and Payment Processing
The platform gates full property/contact details behind token purchases, represented by frontend/src/pages/BuyTokens.jsx. Payment initiation and verification cross a server-side boundary through Vercel functions: frontend/api/korapay-init.js, frontend/api/korapay-verify.js, and frontend/api/confirm-payment.js. Client payment integration is encapsulated in frontend/src/lib/korapay.js; Korapay is the external payment provider.
Inspections, Rent Escrow, and Payouts
Inspection bookings and rent payments feed database-managed financial state. Rentora retains payments in escrow until tenant move-in confirmation, or automatic release after five days; agents receive 70% while Rentora retains 30%. This critical lifecycle, payout calculations, trigger/function logic, and dynamic inspection fees are defined in supabase_migration_v2.sql, with the payment callback UI in frontend/src/pages/PaymentCallback.jsx.
Infrastructure and Supporting Services
Vercel serves the React build and hosts API functions, configured by frontend/vercel.json. Supabase supplies PostgreSQL, authentication, RLS, and database-side business automation. Email/contact and reply operations are serverless endpoints in frontend/api/send-email.js and frontend/api/send-reply.js. A separate Python backend exists at backend/server.py, but the documented primary production architecture centers on the React/Vercel/Supabase stack.
Main entry points: App.js Application routes · supabase.js Supabase client · korapay-init.js Payment functions · vercel.json React deployment
Components 19
React client
- Client entry
frontend/src/index.js - Application routes · Role-aware tenant, agent, and admin experiences.
frontend/src/App.js - Shared shell
frontend/src/components/Layout.jsx - Property discovery · Browse, compare, and inspect listing details.
frontend/src/pages/Browse.jsx - Property unlock · Gates full property and contact details.
frontend/src/pages/PropertyDetails.jsx - Account profile
frontend/src/pages/Profile.jsx - Agent operations · Listings, availability, inspection prices, and earnings.
frontend/src/pages/AgentDashboard.jsx - Admin operations · Agent verification and platform oversight.
frontend/src/pages/AdminDashboard.jsx - Token purchase
frontend/src/pages/BuyTokens.jsx - Auth and roles
frontend/src/lib/auth.js - Supabase client
frontend/src/lib/supabase.js - Korapay client
frontend/src/lib/korapay.js
Vercel
- React deployment · Serves the client build.
frontend/vercel.json - Payment functions · Initiates, verifies, and confirms payment callbacks.
frontend/api/korapay-init.js - Email functions · Sends contact and reply emails.
frontend/api/send-email.js
Supabase
- Auth, RLS, and PostgreSQL · System of record with database-enforced role boundaries.
- Escrow and payouts · Manages inspection fees, escrow release, and 70/30 payouts.
supabase_migration_v2.sql
Other components
- Korapay
- Python backend · Present but outside the documented primary production path.
backend/server.py
Connections 22
- Client entry → Application routes: mounts
- Application routes → Shared shell: renders
- Application routes → Property discovery: tenant routes
- Property discovery → Property unlock: opens
- Application routes → Account profile: account route
- Application routes → Agent operations: agent route
- Application routes → Admin operations: admin route
- Application routes → Token purchase: purchase route
- Application routes → Auth and roles: uses
- Auth and roles → Supabase client: session and role access
- Property discovery → Supabase client: reads listings
- Agent operations → Supabase client: manages listings
- Admin operations → Supabase client: verifies agents
- Supabase client → Auth, RLS, and PostgreSQL: queries under RLS
- Token purchase → Korapay client: starts payment
- Korapay client → Payment functions: calls
- Payment functions → Korapay: initiate and verify
- Payment functions → Auth, RLS, and PostgreSQL: records payment state
- Auth, RLS, and PostgreSQL → Escrow and payouts: executes automation
- React deployment → Application routes: serves
- React deployment → Payment functions: hosts
- React deployment → Email functions: hosts