// Web app for the {{projectName}} project — an authenticated DASHBOARD shell. // // Two areas, two shapes: // - Public pages live in a SILENT route group `src/pages/(marketing)/` // (the parens organise files + scope a layout WITHOUT adding a URL // segment — `/` and `/login`, not `/(marketing)/...`). // - The authed area lives under `src/pages/dashboard/` (a real `/dashboard` // prefix). Its `layout.tsx` exports a `loader` that gates the session and // throws RedirectError to `/login` when there's none. Those pages are // `renderMode: 'ssr'` so the gate runs per request (a `static` page can't // redirect per-visitor — the build would reject it). // // No api wired — the auth gate reads a demo cookie, so this is a pure // frontend you can `voltro build` + `voltro start` as-is. Swap the cookie // check for a real session (add an api + `apis:`) when you have one. import { defineEnv, envVar } from '@voltro/env' // Public, build-time env (baked into the bundle; read via `publicEnv`). // Never a secret here. A secret belongs on the api, not the browser bundle. 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}}, // Follow the visitor's OS theme, set before first paint (no flash). theme: 'system' as const, env, // Bilingual by default. The framework auto-wires a cookie-driven // from these codes and loads the matching // `src/locales/.ts` catalog — so `` / `useT()` / // `useLocale()` work app-wide with no manual setup. The // in the layout writes the `voltro:locale` cookie + reloads. Grow the app to // more languages by adding a code here + a `src/locales/.ts`. locales: ['en', 'de'] as const, defaultLocale: 'en' as const, }