///
/**
* Runtime application config.
* Resolution order:
* 1. window.__APP_CONFIG__ (injected by docker/entrypoint.sh)
* 2. import.meta.env.VITE_APP_* (build-time Vite defines)
* 3. Hard-coded defaults
*/
export interface AppConfig {
siteName: string
brandName: string
footerName: string
tagline: string
}
declare global {
interface Window {
__APP_CONFIG__?: Partial
}
}
const DEFAULTS: AppConfig = {
siteName: 'Faunosteo',
brandName: 'Faunosteo',
footerName: 'Faunosteo',
tagline: "Bilans d'ostéopathie animalière",
}
function resolveConfig(): AppConfig {
const runtime = typeof window !== 'undefined' ? window.__APP_CONFIG__ : {}
return {
siteName:
runtime?.siteName ??
import.meta.env.VITE_APP_SITE_NAME ??
DEFAULTS.siteName,
brandName:
runtime?.brandName ??
import.meta.env.VITE_APP_BRAND_NAME ??
DEFAULTS.brandName,
footerName:
runtime?.footerName ??
import.meta.env.VITE_APP_FOOTER_NAME ??
DEFAULTS.footerName,
tagline:
runtime?.tagline ??
import.meta.env.VITE_APP_TAGLINE ??
DEFAULTS.tagline,
}
}
export const appConfig: AppConfig = resolveConfig()