How btl-it3180/gearloop works
GearLoop is a student peer-to-peer equipment-rental web app. Its documented renter flow is to find an item available for chosen dates, place a booking with a deposit hold, and proceed through seller approval and pickup/return condition reports; disputes and deposit resolution extend that flow. The README also documents authentication, role-based administration, item management, and reviews. The checked-in tree is much smaller than that product description: sampled source confirms the health endpoint and shared API/error/database utilities, but not the advertised feature handlers or service/repository layers. Those capabilities are shown as documented subsystems, not verified implementations.
Main entry points: errors.ts Error handling · api Booking lifecycle · route.ts Health endpoint · withApi.ts API response wrapper
Components 20
Web experience
- GearLoop interface
src/app/page.tsx
Rental lifecycle
- Equipment listings
src/app/api - Date availability
src/app/api - Booking lifecycle
src/app/api - Deposit ledger
prisma/schema.prisma - Condition reports
src/app/api - Damage claims
src/app/api - Rental reviews
src/app/api
Platform operations
- Accounts and sessions
src/app/api - Admin operations
src/app/api - Health endpoint
src/app/api/health/route.ts
Runtime foundation
- Prisma client
src/server/db/client.ts - Input validation
src/server/utils/validation.ts - Role guard
src/server/middleware/requireRole.ts - Error handling
src/server/errors.ts - Error catalog
src/lib/error-catalog.ts - API response wrapper
src/server/api/withApi.ts - Response types
src/lib/api-response.ts - PostgreSQL data
prisma/schema.prisma
Other components
- Renters and sellers
Connections 18
- Renters and sellers → GearLoop interface: use
README.md - Renters and sellers → Equipment listings: browse listings
README.md - Renters and sellers → Date availability: check dates
README.md - Renters and sellers → Booking lifecycle: request rental
README.md - Booking lifecycle → Deposit ledger: hold deposit
README.md - Booking lifecycle → Condition reports: record handoff
README.md - Renters and sellers → Damage claims: file claim
README.md - Renters and sellers → Rental reviews: submit review
README.md - Renters and sellers → Accounts and sessions: authenticate
README.md - Renters and sellers → Admin operations: administer
README.md - Health endpoint → Prisma client: queries
src/app/api/health/route.ts - Prisma client → PostgreSQL data: connects
- API response wrapper → Response types: formats
src/server/api/withApi.ts - API response wrapper → Error handling: catches
src/server/api/withApi.ts - Error handling → Error catalog: reads messages
src/server/errors.ts - Input validation → Error handling: throws
src/server/utils/validation.ts - Role guard → Error handling: throws
src/server/middleware/requireRole.ts - Health endpoint → PostgreSQL data: checks connection
src/app/api/health/route.ts