Home Estimate — How it works
Technical anatomy of the estimate flow. Overview: Home Estimate.
Routes & entry
| Route | Notes |
|---|---|
/estimate, /estimate/[[...slugs]] | Form + result; gated by features.estimate. ISR (revalidate daily). |
/estimate/embedded, /estimate/embedded/demo | Standalone form for external iframe embedding. |
/agent, /agent/client/[clientId]/estimate/* | Agent portal reuse of the estimate flow. |
Root: EstimatePageTemplate → @pages/estimate/EstimateRouter.
Providers
Mounted in the route, outermost → innermost:
EstimatePageTemplate
└─ SearchProvider
└─ SelectOptionsProvider fetched select options (beds/baths/…) → useSelectOptions
└─ EstimateProvider multi-step form state (wraps RHF FormProvider), OTP → useEstimate
└─ EstimateStepsProvider resolves step components (user vs agent) → useEstimateSteps
└─ EstimateRouterSee State Management.
Component tree
EstimateRouter branches on useEstimate().route + agentRole
├─ ResultPageContent route === 'result' (LoadingView / Error40XView while pending)
├─ AgentLandingPageContent agent user
└─ ClientLandingPageContent regular user — the multi-step formConfiguration
| Config | Drives |
|---|---|
@configs/estimate | Steps, form fields, and the Joi validation schema. |
@configs/features | estimate gate. |
@configs/api | Google Places (address autocomplete) and Follow Up Boss (CRM lead routing). |
content.pagesMeta.estimate* | SEO metadata (address/location tokens on the result page). |
Gotchas & hints
- Agent vs client landing.
EstimateRouterrendersAgentLandingPageContentfor agents andClientLandingPageContentotherwise (useUser().agentRole). - Result vs form is route state.
useEstimate().route === 'result'switches toResultPageContent(with loading/error views) instead of the form. EstimateProviderwrapsreact-hook-form’sFormProvider— descendants read the form viauseFormContext; it also drives the OTP verification step.- Embedded variant (
/estimate/embedded) is the same flow packaged for iframe embedding on external sites. SelectOptionsProviderprefetches the dropdown options so steps render without waiting.
Workflow and verification
Source review: e30dd9b47, 2026-11-02. The cross-layer guide covers step validation, OTP/agent branches, persistence and result transitions. Conversion tests ran; no AVM request, client creation or outbound estimate email was executed.
Last updated on