Config defaults
How the web app derives default values from Vite env and fallbacks.
Overview
The web app centralizes its default configuration in:
web/src/lib/config/constants/config.tsThis file exports schema objects like:
- CONFIG_SCHEMA_BACKEND
- CONFIG_SCHEMA_COMPANY
- CONFIG_SCHEMA_MARKETING
- CONFIG_SCHEMA_LANDING_PAGE
Pages and repositories use these defaults when a value is missing from runtime data (for example when backend-provided config hasn’t been set yet).
How defaults are chosen
Some defaults are resolved from Vite env first, then fall back to a safe constant.
Examples:
- API base URL — VITE_API_BASE_URL → fallback http://localhost:3000
Vite env changes require restart/rebuild
When you change VITE_* values, restart the web dev server or rebuild so Vite picks them up.
What each section is for
CONFIG_SCHEMA_BACKEND
- What it controls: where the web app sends API requests.
- Common changes:
- Point local web → local API with VITE_API_BASE_URL
- Point production web → production API (via your hosting env/secret injection)
CONFIG_SCHEMA_COMPANY
- What it controls: company/legal identity shown across the site.
- Common changes:
- Company name (
NAME) - Website URL (
URL) - Support email (
SUPPORT_EMAIL) — static default in the schema (and company config when stored) - Legal name / VAT / address (
LEGAL_NAME,VAT_ID,COMPANY_ADDRESS)
- Company name (
- Where it appears (examples): About page and legal pages. Secret admin email sending uses SITE_NAME + SENDER_EMAIL_ADDRESS on the backend; the email manager may still show the schema support email as read-only context.
CONFIG_SCHEMA_MARKETING
- What it controls: SEO defaults and social links.
- Common changes:
- Meta title & description (
META_TITLE,META_DESCRIPTION) - Meta keywords (
META_KEYWORDS) - Social links (
SOCIAL_LINKS_*)
- Meta title & description (
CONFIG_SCHEMA_LANDING_PAGE
- What it controls: default public home/landing page copy and toggles.
- Common changes:
- Hero title / slogan (
HERO_TITLE,HERO_SLOGAN) - Top banner toggle (
ACTIVE_TOP_BANNER)
- Hero title / slogan (
Navigation and footer constants
config.ts also exports navigation/footer link constants (for example PUBLIC_NAVBAR_LINKS and PUBLIC_FOOTER_LINKS). These are not env-driven; they’re static defaults used by the public layout. Defaults vs stored config
If your backend provides stored company/marketing configuration, pages typically prefer the stored values and fall back to these schema defaults when a field is missing.