Frontend configuration and generated contracts
The frontend is a React 19 and TypeScript application built with Vite. Browser configuration supplies public service addresses and the Supabase anon key. Generated database types describe the local schema used by that build. Neither configuration nor compile-time types grant business access.
The browser bundle is inspectable by its users. Service-role keys, database passwords and provider credentials belong to the backend and its runtime secret contract, never a VITE_* variable.
Configuration reference
Section titled “Configuration reference”| Source or value | Purpose | Constraint |
|---|---|---|
VITE_SUPABASE_URL |
Supabase public endpoint | Must identify the intended environment; initialization refuses a missing value |
VITE_SUPABASE_ANON_KEY |
Public client API key | Used with the user’s session and SQL policy; not a service-role credential |
VITE_BACKEND_URL / BACKEND_URL |
Application API address | Central config defaults to http://127.0.0.1:8110 locally |
VITE_SENTRY_DSN |
Optional browser error-reporting setup | Initialization is conditional; it does not authorize copying sensitive payloads |
import.meta.env |
Vite browser build configuration | Browser modules do not use Node’s process.env |
src/types/supabase.ts |
Generated Database schema types |
Regenerate with make types after schema changes; do not edit by hand |
| Domain interfaces in hooks | API payloads, projections and editor state | A separate handwritten type is not runtime response validation |
| Tenant terminology and style tokens | Company-specific trade labels and shared presentation | Follow the owning hook/tokens rather than inventing incompatible names |
Build time and runtime
Section titled “Build time and runtime”Vite resolves browser build values into the release. Altering the backend service environment does not update an already-built app. The exact-commit publisher builds the selected frontend with its intended public values and records a frontend version artifact.
The Supabase client throws clearly when its required public values are absent. It persists the session, refreshes tokens and detects session information in URLs. AuthProvider then obtains verified live identity from the API; a locally stored session is not a complete authority snapshot.
The bootstrap conditionally initializes Sentry with replay sampling disabled in the inspected code and installs the backend request governor before rendering. This describes configuration, not a guarantee that all possible logs or telemetry contain no sensitive data. Information security owns the broader data and logging rules.
Schema and API contracts
Section titled “Schema and API contracts”createClient<Database> and derived row/insert/update types help catch schema mismatches. They cannot verify RLS, a role grant, an accepted token, business validity or a deployment’s current schema. Dynamic projections and targeted casts still exist; a compile pass is not evidence that every runtime response matches its asserted type.
After a forward migration, the local stack and make types produce the committed generated file. Migration and type delivery owns the process and populated-upgrade checks. Application compatibility also depends on RPC execution context and API contracts, which are not fully expressed by table row types.
HTTP models live in the backend’s operation owners. MCP tool schemas and evidence envelopes form a separate interface. A browser’s inferred TypeScript type must not be reported as the canonical schema for either.
Example and failure handling
Section titled “Example and failure handling”A synthetic developer changes a database function argument and updates an editor call. They must regenerate from the changed local schema and validate the actual function/API contract. Hand-editing the generated type to silence a mismatch would conceal the incompatibility rather than fix it.
If a published browser calls a wrong API origin, first inspect its exact build identity and configured public address. Do not insert a secret key or redirect it to another shared database to make the request succeed. Use the runtime map and owning release instructions.
Evidence limits
Section titled “Evidence limits”This reference follows the named initialization, build and type-generation sources. It does not claim a dependency upgrade, current telemetry configuration or every environment’s successful deployment. Focused type/build checks and public version observations establish their own named results.