Skip to content

Rename and Reorganize DashboardsΒ #166

@respp

Description

@respp

🏷️ 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:

  1. All users start as Guest by default

  2. To become a Host, they must complete the β€œBecome a Host” flow

  3. 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:

  1. Create app/dashboard/guest/page.tsx

    • Copy content from /tenant-dashboard/page.tsx
    • Add <RoleGuard requiredRole="guest">
  2. Move app/dashboard/host-dashboard/page.tsx to app/dashboard/host/page.tsx

    • Add <RoleGuard requiredRole="host">
  3. Keep /tenant-dashboard as 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/guest works
  • /dashboard/host works
  • /tenant-dashboard redirects to /dashboard/guest
  • Both dashboards use RoleGuard
  • Internal components remain unchanged (keep working)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions