Skip to Content
HomeLink Hub

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

PageWhat it covers
Sign up and verificationThe four-step sign-up form, the check-email screen and the email verification link
Sign in and password resetEmail and password sign-in, Google sign-in, forgot and reset password, signing out
Onboarding and KYCThe five-step agent setup, NIN verification, the onboarding banner and intro dialog
Navigation and layoutSidebar, topbar, global search, profile menu, theme, app tour, error page
Dashboard homeStat cards, earnings cards, performance chart, quick actions, recent activity
Listings overviewThe listings table, filters, delete, and the listing detail page
Create a listingThe three-step create flow, drafts and publishing
Listing photos and mediaPhoto groups, cropping, limits, geotag checks, the metadata dialog
Edit and publish listingsEditing a listing, managing its photos, publishing a draft
AnalyticsThe analytics screen
SettingsEvery settings section
Notifications and helpThe 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.

RouteView fileAccess
/auth/signupsrc/views/auth/signup.tsxpublic
/auth/check-emailsrc/views/auth/check-email.tsxpublic
/auth/verify-emailsrc/views/auth/verify-email.tsxpublic
/auth/signinsrc/views/auth/signin.tsxpublic
/auth/forgot-passwordsrc/views/auth/forgot-password.tsxpublic
/auth/reset-passwordsrc/views/auth/reset-password.tsxpublic
/auth/google/callbacksrc/views/auth/google-callback.tsxpublic
/onboardingsrc/views/app/onboarding/onboarding.tsxsigned-in
/src/views/app/dashboard/dashboard.tsxsigned-in, agent or landlord
/listingssrc/views/app/listings/listings.tsxsigned-in, agent or landlord
/listings/createsrc/views/app/listings/create-listing.tsxsigned-in, agent or landlord
/listings/:idsrc/views/app/listings/listing-detail.tsxsigned-in, agent or landlord
/listings/:id/editsrc/views/app/listings/edit-listing.tsxsigned-in, agent or landlord
/analyticssrc/views/app/analytics/analytics.tsxsigned-in, agent or landlord
/settingssrc/views/app/settings/settings.tsxsigned-in, agent or landlord
/notificationssrc/views/app/notifications/notification.tsxsigned-in, agent or landlord
/helpsrc/views/app/help/help.tsxsigned-in, agent or landlord
/help/category/:categorySlugsrc/views/app/help/help-category.tsxsigned-in, agent or landlord
/help/article/:articleSlugsrc/views/app/help/help-article-detail.tsxsigned-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:

BehaviourAgentLandlord
After sign-in, when the account is not KYC verifiedSent to /onboardingSent to the saved callback URL, or /
Onboarding banner above every pageShown until KYC verified or dismissedNever shown
"How HomeLink works for agents" intro dialog on first visitShown onceNever shown
Settings sections "Inspection Availability" and "Inspection Fee"ShownHidden
Global search entries for those two settings sectionsShownHidden

Landlords are not blocked from onboarding

The /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.

GuardFileRule
ProtectedRoutesrc/layouts/ProtectedRoute.tsxNo 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.
RootLayoutsrc/layouts/RootLayout.tsxStored user's role is LAWYER: redirect to /legal. Otherwise render the app shell with the onboarding banner, intro dialog and tour.
LawyerLayoutsrc/layouts/LawyerLayout.tsxNo token, or role is not LAWYER: redirect to /.
AuthLayoutsrc/layouts/AuthLayout.tsxNo 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.

StoreKeyHolds
sessionStoragetokenThe access token. Sent as Authorization: Bearer ... on every API call.
localStoragerefreshTokenThe refresh token. Only used as the body of the sign-out request.
localStorageuserThe user object returned at sign-in (name, email, role, avatar, isKYCVerified).
localStoragehl_callback_urlThe page to return to after an expired session.
localStoragehl_onboardingOnboarding form values and progress.
localStoragehl_agent_intro_seenWhether the agent intro dialog has been closed once.
localStoragehl_tours_seenWhich users have seen the app tour, keyed like agent:USER_ID.
localStoragehl_sidebar_collapsedSidebar collapsed or expanded.
localStoragevite-ui-themelight or dark.
localStoragenotificationsThe in-app notification list.
localStoragelistings_locations, listings_addressesValues 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

Closing the tab or opening the app in a new tab starts with no token, so the user is sent to /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.

ClientUsed byOn a 401
Axios instance in src/config/axios.tsAuth, KYC and onboarding thunks in src/services/auth/auth-thunk.tsIf 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 fetchBaseQueryListings, dashboard, analytics, settings and every other feature APINothing special. The request fails and the page shows its own error or empty state.

Most screens do not sign you out on expiry

Because listings, dashboard and settings all use RTK Query, an expired token on those screens shows up as "Failed to load listing", empty tables or a failed-save toast. The user stays on the page until a request made through the Axios instance fails, or until they reload in a new tab.

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

It only connects if a token exists when the page first loads. Sign-in navigates without reloading the page, so the notification subscription is not set up until the next full page load.

On this page