Dashboard web app
How the agent and landlord dashboard is put together, who can use it, and where each flow is documented.
The dashboard (client-app) is the web app agents and landlords use to list properties, handle requests and get paid. Lawyers sign in to the same app but are sent to a separate portal under /legal, which is documented elsewhere. Tenants and developers are not allowed in: they are signed straight back out and sent to the consumer app.
It is a single-page app: React 19, Vite, react-router, Redux Toolkit (one auth slice, one chat slice, and RTK Query for everything else) and shadcn UI.
Pages in this section
| Page | What it covers |
|---|---|
| Sign up and verification | The four-step sign-up form, the check-email screen and the email verification link |
| Sign in and password reset | Email and password sign-in, Google sign-in, forgot and reset password, signing out |
| Onboarding and KYC | The five-step agent setup, NIN verification, the onboarding banner and intro dialog |
| Navigation and layout | Sidebar, topbar, global search, profile menu, theme, app tour, error page |
| Dashboard home | Stat cards, earnings cards, performance chart, quick actions, recent activity |
| Listings overview | The listings table, filters, delete, and the listing detail page |
| Create a listing | The three-step create flow, drafts and publishing |
| Listing photos and media | Photo groups, cropping, limits, geotag checks, the metadata dialog |
| Edit and publish listings | Editing a listing, managing its photos, publishing a draft |
| Analytics | The analytics screen |
| Settings | Every settings section |
| Notifications and help | The notifications screen and the help center |
Where it lives
Routes are declared in src/routes/router.tsx, src/routes/auth.routes.tsx and src/routes/protected.routes.tsx. src/routes/public.routes.tsx is entirely commented out, so the app has no public marketing pages.
| Route | View file | Access |
|---|---|---|
/auth/signup | src/views/auth/signup.tsx | public |
/auth/check-email | src/views/auth/check-email.tsx | public |
/auth/verify-email | src/views/auth/verify-email.tsx | public |
/auth/signin | src/views/auth/signin.tsx | public |
/auth/forgot-password | src/views/auth/forgot-password.tsx | public |
/auth/reset-password | src/views/auth/reset-password.tsx | public |
/auth/google/callback | src/views/auth/google-callback.tsx | public |
/onboarding | src/views/app/onboarding/onboarding.tsx | signed-in |
/ | src/views/app/dashboard/dashboard.tsx | signed-in, agent or landlord |
/listings | src/views/app/listings/listings.tsx | signed-in, agent or landlord |
/listings/create | src/views/app/listings/create-listing.tsx | signed-in, agent or landlord |
/listings/:id | src/views/app/listings/listing-detail.tsx | signed-in, agent or landlord |
/listings/:id/edit | src/views/app/listings/edit-listing.tsx | signed-in, agent or landlord |
/analytics | src/views/app/analytics/analytics.tsx | signed-in, agent or landlord |
/settings | src/views/app/settings/settings.tsx | signed-in, agent or landlord |
/notifications | src/views/app/notifications/notification.tsx | signed-in, agent or landlord |
/help | src/views/app/help/help.tsx | signed-in, agent or landlord |
/help/category/:categorySlug | src/views/app/help/help-category.tsx | signed-in, agent or landlord |
/help/article/:articleSlug | src/views/app/help/help-article-detail.tsx | signed-in, agent or landlord |
The same router also serves /requests, /requests/:id, /payment-requests/:id, /bookings, /messages, /earnings, /legal-team, /legal-team/:id and the lawyer portal under /legal. Those are covered by other sections.
Roles
src/config/roles.ts allows three roles into this app: AGENT, LANDLORD and LAWYER. The sign-up form offers exactly those three.
Agents and landlords see the same sidebar, the same pages and the same dashboard. The differences the code makes between them are small:
| Behaviour | Agent | Landlord |
|---|---|---|
| After sign-in, when the account is not KYC verified | Sent to /onboarding | Sent to the saved callback URL, or / |
| Onboarding banner above every page | Shown until KYC verified or dismissed | Never shown |
| "How HomeLink works for agents" intro dialog on first visit | Shown once | Never shown |
| Settings sections "Inspection Availability" and "Inspection Fee" | Shown | Hidden |
| Global search entries for those two settings sections | Shown | Hidden |
Landlords are not blocked from onboarding
/onboarding route has no role check. A landlord or lawyer who types the URL can open it, but nothing in the app ever links them there.Route guards
Three layout components decide who gets in. All of them read the browser's storage directly; none of them calls the API.
| Guard | File | Rule |
|---|---|---|
ProtectedRoute | src/layouts/ProtectedRoute.tsx | No access token in sessionStorage: redirect to /auth/signin. Stored user's role not in the allowed list: remove the token, refresh token and user, then redirect to /auth/signin. |
RootLayout | src/layouts/RootLayout.tsx | Stored user's role is LAWYER: redirect to /legal. Otherwise render the app shell with the onboarding banner, intro dialog and tour. |
LawyerLayout | src/layouts/LawyerLayout.tsx | No token, or role is not LAWYER: redirect to /. |
AuthLayout | src/layouts/AuthLayout.tsx | No guard. A signed-in user can still open every /auth/* page. |
Any unknown URL, or an error thrown while rendering a route, shows the error page described in Navigation and layout.
Session storage
Everything the app remembers between page loads lives in the browser. Values are JSON-serialised by src/hooks/storage.ts.
| Store | Key | Holds |
|---|---|---|
sessionStorage | token | The access token. Sent as Authorization: Bearer ... on every API call. |
localStorage | refreshToken | The refresh token. Only used as the body of the sign-out request. |
localStorage | user | The user object returned at sign-in (name, email, role, avatar, isKYCVerified). |
localStorage | hl_callback_url | The page to return to after an expired session. |
localStorage | hl_onboarding | Onboarding form values and progress. |
localStorage | hl_agent_intro_seen | Whether the agent intro dialog has been closed once. |
localStorage | hl_tours_seen | Which users have seen the app tour, keyed like agent:USER_ID. |
localStorage | hl_sidebar_collapsed | Sidebar collapsed or expanded. |
localStorage | vite-ui-theme | light or dark. |
localStorage | notifications | The in-app notification list. |
localStorage | listings_locations, listings_addresses | Values for the listings filter dropdowns. |
Redux holds very little: state.auth has user, loading and error. All server data is cached by RTK Query and lost on reload.
The access token lives in sessionStorage
/auth/signin even though user and refreshToken are still in localStorage. The app has a refreshToken thunk (POST /api/v1/auth/refresh-token) but nothing dispatches it, so there is no silent token refresh.API clients and expired sessions
There are two kinds of API client, and they treat an expired session differently.
| Client | Used by | On a 401 |
|---|---|---|
Axios instance in src/config/axios.ts | Auth, KYC and onboarding thunks in src/services/auth/auth-thunk.ts | If the response message is exactly Token has Expired: save the current path to hl_callback_url (unless it is / or an auth page), clear the Redux user, remove token, refreshToken and user, then hard-redirect to /auth/signin. |
RTK Query fetchBaseQuery | Listings, dashboard, analytics, settings and every other feature API | Nothing special. The request fails and the page shows its own error or empty state. |
Most screens do not sign you out on expiry
Both clients send cookies (withCredentials / credentials: "include") and take their base URL from the VITE_API_BASE_URL build variable, with /api/v1 appended.
Real-time notifications
src/main.tsx mounts a GlobalNotificationSubscriber once at start-up. If a token is present it opens a Socket.IO connection (the token is passed in the socket auth payload), emits notifications:subscribe, and stores every notifications:new event in localStorage. See Notifications and help.
The subscriber runs once per page load
Link Previews
The small Node server that serves the built web app and gives shared links, especially listing links, a proper title, description and preview image.
Bookings and payment requests
The Bookings overview, the Payment Requests tab, and how a lister accepts or declines a buyer's request to pay.