Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Ozcaar/real-estate-template/llms.txt

Use this file to discover all available pages before exploring further.

AgencyConfig is the single source of truth for everything that varies between real estate agencies: identity, contact details, social presence, feature modules, locale settings, currency, measurement units, and the active theme. It is defined in app/types/agency.types.ts and consumed exclusively through the useSiteConfig() composable — components must never hardcode agency data. The file app/config/agencies/default.agency.ts ships a complete placeholder configuration that demonstrates every field; copy and rename it to create a new agency identity.

MeasurementUnit type

export type MeasurementUnit = 'metric' | 'imperial'
Controls the default unit label displayed for property and development area measurements ( vs ft²). This is the agency-level default; individual Property and Development records may override it with their own sizeUnit field.

AgencyConfig interface

id
string
required
Unique agency identifier (e.g. 'default', 'acme-realty'). Used internally as a stable key; does not appear in the UI.
name
string
required
Agency display name rendered in the header, footer, and browser title. Zod enforces at least one non-whitespace character.
slogan
string
Optional short marketing tagline shown in hero sections and the footer (e.g. 'Find your ideal property').
Path to the agency logo served from public/ (e.g. '/images/logo.svg'). Must begin with '/'. Zod enforces the leading slash.
favicon
string
Optional path to the favicon served from public/ (e.g. '/favicon.ico'). Must begin with '/' when present.
theme
string
required
ID of the theme this agency uses (e.g. 'default'). Must match a key in the themes registry (app/themes/index.ts). The cross-config validator throws a ZodError when this ID is not found in the registry.
defaultLocale
string
required
BCP 47 locale code that the site falls back to (e.g. 'en', 'es'). Must appear in both availableLocales and i18nLocales — the cross-config validator throws if either condition is not met.
availableLocales
string[]
required
Array of BCP 47 locale codes the agency supports (e.g. ['en', 'es']). Must be non-empty. Every entry must also be registered in the Nuxt i18n config (i18nLocales).
currency
string
required
ISO 4217 currency code used to format all prices (e.g. 'USD', 'MXN', 'EUR'). Applied by the currency-format.ts utility across property cards, detail pages, and development showcases. A format warning (non-throwing) is emitted when the value does not match the three-uppercase-letter ISO 4217 pattern.
measurementUnit
MeasurementUnit
required
Agency-wide default area unit. 'metric' renders ; 'imperial' renders ft². Individual Property and Development records override this with their own sizeUnit field. No auto-conversion is performed — numbers are always rendered as-is.
contact
AgencyContactConfig
required
Primary contact details. See AgencyContactConfig below.
social
AgencySocialConfig
required
Social media profile URLs. See AgencySocialConfig below.
modules
AgencyModulesConfig
required
Feature-flag toggles. See AgencyModulesConfig below.

Nested interfaces

AgencyContactConfig

contact
AgencyContactConfig

AgencySocialConfig

social
AgencySocialConfig

AgencyModulesConfig

All six fields are required booleans. Setting a module to false removes its navigation entry (via the module field on NavItem) and disables its routes and components, allowing agencies that do not use a feature to ship without dead pages.
modules
AgencyModulesConfig

Runtime validation

The file app/config/agencies/agency.schema.ts provides runtime validation for AgencyConfig. Two public functions are exported.

validateAgencyConfig(agency, deps)

function validateAgencyConfig(
  agency: AgencyConfig,
  deps: ValidateAgencyConfigDeps,
): ValidateAgencyConfigResult
Strict variant. Throws a ZodError on any structural or cross-config failure. Returns { agency, warnings } on success. The first parameter must be an already-typed AgencyConfig object (use safeParseAgencyConfig when the input is unknown).
import { validateAgencyConfig } from '~/config/agencies/agency.schema'
import { themes } from '~/themes'
import { defaultI18nLocales } from '~/config/i18n'

const { agency, warnings } = validateAgencyConfig(myAgencyConfig, {
  themes,
  i18nLocales: defaultI18nLocales,
})

if (warnings.length > 0) {
  warnings.forEach(w => console.warn('[AgencyConfig]', w))
}

safeParseAgencyConfig(agency, deps)

function safeParseAgencyConfig(
  agency: unknown,
  deps: ValidateAgencyConfigDeps,
): SafeParseAgencyConfigResult
Non-throwing variant. The first parameter is typed unknown — use this when the input may not yet conform to AgencyConfig (e.g. a raw JSON payload from a CMS or a multi-tenant config loader). Returns a tagged discriminated union so callers can handle validation errors without a try/catch:
export type SafeParseAgencyConfigResult =
  | { ok: true;  agency: AgencyConfig; warnings: string[] }
  | { ok: false; error: z.ZodError;    warnings: string[] }
Use this variant in multi-tenant loaders or server-side config resolution where you want to fall back to the default agency instead of crashing.
const result = safeParseAgencyConfig(unknownConfig, { themes, i18nLocales })
if (!result.ok) {
  console.error('Invalid agency config:', result.error.issues)
  // fall back to default agency...
}

Cross-config coherence checks

These rules throw a ZodError when violated:
RuleDescription
defaultLocale ∈ availableLocalesThe default locale must be listed in the agency’s supported locales
defaultLocale ∈ i18nLocalesThe default locale must be registered in Nuxt’s i18n config
Every availableLocales[i] ∈ i18nLocalesEvery supported locale must be registered in Nuxt’s i18n config
theme ∈ themesThe theme ID must exist as a key in the themes registry

Format warnings

These checks log a console.warn but never throw. A site with format warnings still boots correctly. The shipped default.agency.ts triggers five warnings by design (one per social platform placeholder URL) to document what a real agency should update during rebranding.
CheckCondition
contact.emailDoes not match name@domain.tld pattern
currencyDoes not match the three-uppercase-letter ISO 4217 pattern
social.*Any set social URL that does not start with http://, https://, or www.

SiteConfig

The resolved configuration object consumed across the app via useSiteConfig():
export interface SiteConfig {
  agency: AgencyConfig
  theme: ThemeConfig
}
SiteConfig pairs the active AgencyConfig with its resolved ThemeConfig. The theme.ts plugin resolves the theme at startup using resolveTheme(agency.theme) and injects CSS variables for the active theme via themeToCssVars. Powers navigation configuration in app/config/navigation.ts:
export interface NavItem {
  labelKey: string
  to: string
  module?: keyof AgencyModulesConfig
}
labelKey
string
required
i18n translation key for the navigation label. Never raw text — always a key looked up via $t().
to
string
required
Route path (e.g. '/properties', '/contact').
module
keyof AgencyModulesConfig
Optional module name. When set, layout components (AppHeader, AppMobileMenu, AppFooter) hide this nav entry when the corresponding module is disabled in AgencyConfig.modules.

Build docs developers (and LLMs) love