// Web app for the {{projectName}} project — a PUBLIC status page fed by the // sibling `api-status` api. // // The index page is `renderMode: 'ssr'`: its loader runs server-side per request // and pulls the current incidents + components over the api's POST /rpc, so the // first paint + the document reflect real state (crawlable, no client // round-trip). The component then upgrades to live with `useSubscription`, so a // new incident lands on every open page within seconds — the whole point of a // status page. // // No auth: the reads are public (the api leaves them ungated), and the page must // stay up even when the rest of the product — and its login — is down. import { defineEnv, envVar } from '@voltro/env' // Public, build-time env (baked into the bundle; read via `publicEnv`). // Never a secret here — declare secrets on the api. export const env = defineEnv({ VOLTRO_PUBLIC_APP_NAME: envVar.string({ access: 'public', default: '{{capProjectName}}' }), }) export default { type: 'web' as const, name: '{{capProjectName}}{{capAppName}}', port: {{port}}, theme: 'system' as const, env, // Bilingual by default (cookie-driven — no `/<locale>` prefix). The framework // auto-wires <I18nProvider> from these codes + the `src/locales/<code>.ts` // catalogs, so `<T>` / `useT()` / `useLocale()` work app-wide (SSR too). Add a // code + a `src/locales/<code>.ts` to grow to more languages. locales: ['en', 'de'] as const, defaultLocale: 'en' as const, // The api this page reads. The NAME ('app') is the lookup key the loader's // `query` + the hooks use: `query('incidents.live', {})`, // `useSubscription('app', 'incidents.live')`. apis: { app: { package: '@{{projectName}}/api' }, }, }