Skip to content

Config defaults

How the web app derives default values from Vite env and fallbacks.

2 min read

Overview

The web app centralizes its default configuration in:

web/src/lib/config/constants/config.ts

This 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 URLVITE_API_BASE_URL → fallback http://localhost:3000

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)
  • 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_*)

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)

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.

Related configuration