How satyam-0304/campus-lend works
CampusLend is a campus-only peer-to-peer equipment lending marketplace. Students authenticate and verify their campus email, browse or list equipment, manage borrow requests, and coordinate through profiles, chat, notifications, and reviews. The frontend is a React application; its typed API client communicates with Express, whose routes enforce identity and verification before accessing Supabase. The README documents direct browser use of Supabase Auth and Storage. Some frontend wiring and route internals were not sampled, so those links are limited to indexed references or documented architecture.
Main entry points: App.tsx CampusLend app · supabaseClient.js Backend Supabase clients · app.js Express API · api.ts Typed API client
Components 29
Student experience
- CampusLend app
frontend/src/App.tsx - Landing page
frontend/src/components/LandingPage.tsx
Identity and verification
- Sign-in modal
frontend/src/components/AuthModal.tsx - OTP verification
frontend/src/components/EmailOtpVerificationModal.tsx - Browser Supabase client
frontend/src/lib/supabase.ts - OTP endpoints
backend/routes/authOtpRoutes.js - JWT validation
backend/middleware/authMiddleware.js - Email gate
backend/middleware/requireEmailVerified.js - Verification email
backend/services/emailService.js
Marketplace operations
- Equipment browsing
frontend/src/components/marketplace/ProductCard.tsx - Item details
frontend/src/components/marketplace/ProductDetailModal.tsx - Seller dashboard
frontend/src/components/marketplace/SellerHub.tsx - Rental dates
frontend/src/components/marketplace/RentalDateSelector.tsx - Equipment listings
backend/routes/equipmentRoutes.js - Borrow lifecycle
backend/routes/requestRoutes.js - Profile management
backend/routes/profileRoutes.js
Community interactions
- Chat drawer
frontend/src/components/marketplace/ChatDrawer.tsx - Messaging API
backend/routes/messageRoutes.js - Notifications
frontend/src/components/marketplace/NotificationPopover.tsx - Notification API
backend/routes/notificationRoutes.js - Reviews
frontend/src/components/marketplace/ReviewModal.tsx - Review API
backend/routes/reviewRoutes.js
API and persistence
- Typed API client
frontend/src/lib/api.ts - Express API
backend/app.js - Backend Supabase clients
backend/config/supabaseClient.js
Other components
- Campus student
- Supabase Auth
- Supabase database
- Supabase Storage
Connections 46
- Campus student → CampusLend app: uses
README.md - CampusLend app → Landing page: renders
frontend/src/App.tsx - CampusLend app → Sign-in modal: opens
frontend/src/App.tsx - CampusLend app → OTP verification: opens
frontend/src/App.tsx - Sign-in modal → Browser Supabase client: authenticates with
frontend/src/components/AuthModal.tsx - Browser Supabase client → Supabase Auth: uses
README.md - CampusLend app → Equipment browsing: renders
frontend/src/App.tsx - CampusLend app → Item details: renders
frontend/src/App.tsx - CampusLend app → Seller dashboard: renders
frontend/src/App.tsx - Item details → Rental dates: renders
frontend/src/components/marketplace/ProductDetailModal.tsx - Equipment browsing → Typed API client: requests data
- Seller dashboard → Typed API client: requests data
- Typed API client → Express API: calls REST API
README.md - Express API → Equipment listings: mounts
backend/app.js - Express API → Borrow lifecycle: mounts
backend/app.js - Express API → Profile management: mounts
backend/app.js - Express API → OTP endpoints: mounts
backend/app.js - Express API → Messaging API: mounts
backend/app.js - Express API → Notification API: mounts
backend/app.js - Express API → Review API: mounts
backend/app.js - OTP endpoints → JWT validation: checks identity
backend/routes/authOtpRoutes.js - JWT validation → Backend Supabase clients: uses anon client
backend/middleware/authMiddleware.js - OTP endpoints → Backend Supabase clients: uses service client
backend/routes/authOtpRoutes.js - OTP endpoints → Verification email: sends codes
backend/routes/authOtpRoutes.js - Verification email → Campus student: emails code
backend/services/emailService.js - Equipment listings → JWT validation: authenticates
backend/routes/equipmentRoutes.js - Equipment listings → Email gate: requires verification
backend/routes/equipmentRoutes.js - Borrow lifecycle → JWT validation: authenticates
backend/routes/requestRoutes.js - Borrow lifecycle → Email gate: requires verification
backend/routes/requestRoutes.js - Email gate → Backend Supabase clients: checks status
backend/middleware/requireEmailVerified.js - Equipment listings → Backend Supabase clients: reads and writes
backend/routes/equipmentRoutes.js - Borrow lifecycle → Backend Supabase clients: reads and writes
backend/routes/requestRoutes.js - Profile management → Backend Supabase clients: reads and writes
backend/routes/profileRoutes.js - Messaging API → Backend Supabase clients: reads and writes
backend/routes/messageRoutes.js - Notification API → Backend Supabase clients: reads and writes
backend/routes/notificationRoutes.js - Review API → JWT validation: authenticates
backend/routes/reviewRoutes.js - Review API → Backend Supabase clients: reads and writes
backend/routes/reviewRoutes.js - Backend Supabase clients → Supabase database: accesses
README.md - Campus student → Browser Supabase client: uploads images
README.md - Browser Supabase client → Supabase Storage: stores item photos
README.md - CampusLend app → Chat drawer: renders
frontend/src/App.tsx - CampusLend app → Notifications: renders
frontend/src/App.tsx - CampusLend app → Reviews: renders
frontend/src/App.tsx - Chat drawer → Typed API client: requests data
- Notifications → Typed API client: requests data
- Reviews → Typed API client: requests data