How drew-space/unidel-housing works
Purpose and Runtime
Ruum is a Next.js App Router marketplace for University of Delta students to discover off-campus housing and connect with verified agents. It runs as a TypeScript frontend on Vercel, with Convex providing backend functions and database; Clerk supplies authentication. Global app composition and the Convex client boundary are rooted at app/layout.tsx and components/providers/ConvexClientProvider.tsx.
Route Domains and Entry Points
The application separates three route groups:
• Public/student marketplace: landing, listing discovery/detail, agent profiles, favorites, and KYC at app/(main)/page.tsx, app/(main)/house/page.tsx, and app/(main)/house/[id]/page.tsx.
• Agent workspace: dashboard and listing creation at app/(agent)/dashboard/page.tsx and app/(agent)/dashboard/create-listing/page.tsx.
• Administrative workspace: operational dashboard, KYC queue, agent management, and listing moderation at app/(admin)/admin/dashboard/page.tsx, app/(admin)/admin/kyc/page.tsx, and app/(admin)/admin/listings/page.tsx.
Each domain has its own layout boundary: app/(main)/layout.tsx, app/(agent)/dashboard/layout.tsx, and app/(admin)/admin/layout.tsx.
Identity, Roles, and Access Control
Clerk establishes the authenticated user identity; Convex persists application user records and roles. Role-aware routing is enforced client-side through hooks/useRoleGuard.ts and hooks/useAdminRedirect.ts, while request-level behavior is centralized in proxy.ts. User lifecycle and role data operations are implemented in convex/users.ts, with Clerk/Convex auth integration configured in convex/auth.config.ts.
Important boundary: authentication identity is external (Clerk), while marketplace authorization state—student, agent, admin, verification status—belongs in Convex.
Listing Discovery and Publishing
Housing posts are the core marketplace entity, modeled in convex/schema.ts and operated on by convex/housePost.ts. Public pages render browsing and detail experiences, using reusable listing presentation components at components/HouseCard.tsx and components/ImageGallery.tsx.
The expected flow is: agent passes verification → creates a listing in the agent dashboard → Convex stores/query-serves the listing → public listing pages expose filtered/searchable inventory. Listing input constraints are represented by lib/schemas/house.ts, creating a UI-to-backend validation boundary.
Verification and Trust Operations
Agent onboarding is a manual KYC workflow: applicants submit identity evidence, admins review it, and rejected applicants can resubmit. Backend workflow and status transitions reside in convex/kyc.ts; user/agent administration is in convex/admin.ts. The public-facing KYC entry is app/(main)/kyc/page.tsx, while the review queue is app/(admin)/admin/kyc/page.tsx.
Trust signals extend beyond KYC: students can save listings via convex/favourites.ts, review agents through convex/reviews.ts, and report agent/listing issues through convex/agentReports.ts. These moderation inputs feed the admin workspace rather than automated enforcement.
UI Composition and External Boundaries
Shared navigation and responsive shell components connect route domains: components/Navbar.tsx, components/app-sidebar.tsx, and components/admin-sidebar.tsx. The interface is built with Tailwind and shadcn/ui primitives under components/ui.
Convex is the principal application-data service and exposes generated typed bindings in convex/_generated/api.d.ts. The repository also contains an HTTP integration surface at convex/http.ts, though the primary visible application flow is Next.js client routes invoking Convex-backed marketplace operations.
Main entry points: (main)/page.tsx Student marketplace · users.ts Users and roles · housePost.ts Listing operations · dashboard/page.tsx Agent workspace
Components 19
Next.js frontend
App Router route domains and shared client boundaries.
- App composition
app/layout.tsx - Convex client provider
components/providers/ConvexClientProvider.tsx - Student marketplace · Discovery, details, favorites, and KYC entry.
app/(main)/page.tsx - Student layout
app/(main)/layout.tsx - Listing discovery · Browse and listing detail pages.
app/(main)/house/page.tsx - Agent workspace · Dashboard and listing creation.
app/(agent)/dashboard/page.tsx - Agent layout
app/(agent)/dashboard/layout.tsx - Admin workspace · Operations, KYC review, agent management, and moderation.
app/(admin)/admin/dashboard/page.tsx - Admin layout
app/(admin)/admin/layout.tsx - Role guards
hooks/useRoleGuard.ts - Request proxy
proxy.ts - Listing validation
lib/schemas/house.ts
Convex backend
Marketplace data, workflows, and typed operations.
- Marketplace schema · Defines housing posts and application state.
convex/schema.ts - Users and roles · Persists application users, roles, and lifecycle data.
convex/users.ts - Listing operations · Creates, stores, and queries housing posts.
convex/housePost.ts - KYC workflow · Manages submission, review, rejection, and resubmission.
convex/kyc.ts - Trust and moderation · Favorites, reviews, reports, and admin operations.
convex/admin.ts - Convex auth config
convex/auth.config.ts
External services
- Clerk · External authenticated identity source.
Connections 22
- App composition → Convex client provider: mounts
- Convex client provider → Clerk: uses identity
- Student layout → Student marketplace: frames
- Student marketplace → Listing discovery: includes
- Agent layout → Agent workspace: frames
- Admin layout → Admin workspace: frames
- Request proxy → Role guards: complements
- Role guards → Users and roles: checks role state
- Clerk → Convex auth config: integrates identity
- Convex auth config → Users and roles: authenticates operations
- Users and roles → Marketplace schema: persists
- Listing validation → Listing operations: validates input for
- Agent workspace → Listing validation: submits listing
- Agent workspace → Listing operations: creates listings
- Listing operations → Marketplace schema: reads and writes
- Listing discovery → Listing operations: queries inventory
- Student marketplace → KYC workflow: submits KYC
- Admin workspace → KYC workflow: reviews KYC
- KYC workflow → Users and roles: updates verification
- Student marketplace → Trust and moderation: favorites, reviews, reports
- Admin workspace → Trust and moderation: operates moderation
- Trust and moderation → Marketplace schema: persists trust signals