-
Notifications
You must be signed in to change notification settings - Fork 76
Closed as not planned
Labels
Description
π·οΈ Context: Guest/Host Role System
Weβre implementing a dual-role system where users can have two profiles:
- Guest (Tenant): Users who search and book properties
- Host: Users who list and manage properties
- Dual: Users who can be both at the same time
Role Flow:
-
All users start as Guest by default
-
To become a Host, they must complete the βBecome a Hostβ flow
-
Dashboard access depends on role:
- Guest Dashboard: Always accessible (bookings, profile, wallet)
- Host Dashboard: Only if
hostStatus === 'verified'and they have properties
Architecture:
- Reuse 90% of the existing codebase (components, hooks, services)
- Add role logic on top of the current infrastructure
- Do not change existing dashboard components (they already work)
References:
- Existing auth system:
hooks/auth/use-auth.tsx - Current dashboards:
/tenant-dashboard(guest) and/dashboard/host-dashboard(host) - Reusable components:
components/dashboard/*
π Task: Reorganize dashboard structure
Goal: Consistent structure /dashboard/{role}.
File structure changes:
BEFORE:
apps/web/src/app/
βββ tenant-dashboard/page.tsx
βββ dashboard/
βββ host-dashboard/page.tsx
AFTER:
apps/web/src/app/dashboard/
βββ page.tsx (selector)
βββ guest/page.tsx (ex tenant-dashboard)
βββ host/page.tsx (ex host-dashboard)
Steps:
-
Create
app/dashboard/guest/page.tsx- Copy content from
/tenant-dashboard/page.tsx - Add
<RoleGuard requiredRole="guest">
- Copy content from
-
Move
app/dashboard/host-dashboard/page.tsxtoapp/dashboard/host/page.tsx- Add
<RoleGuard requiredRole="host">
- Add
-
Keep
/tenant-dashboardas a redirect (deprecated)
Files to create:
app/dashboard/guest/page.tsx
Files to move:
app/dashboard/host-dashboard/page.tsxβapp/dashboard/host/page.tsx
Files to modify:
app/tenant-dashboard/page.tsx(add redirect)
Acceptance Criteria:
-
/dashboard/guestworks -
/dashboard/hostworks -
/tenant-dashboardredirects to/dashboard/guest - Both dashboards use
RoleGuard - Internal components remain unchanged (keep working)
Reactions are currently unavailable