// Web app for the {{projectName}} project — the CMS EDITOR that drives the // sibling `api-cms` backend. // // Two areas: // - `/login` — a static sign-in page that POSTs to the api's `/auth/*` routes. // - The authed editor in the SILENT route group `src/pages/(app)/`. Its // `layout.tsx` loader is the auth gate: server-side it asks the api's // `session.me` and RedirectErrors an anonymous visitor to /login. Its pages // are `renderMode: 'ssr'` so the gate runs per request. // // The editor fetches the registered content types (`content.types`) and renders // a `` per type from @voltro/cms — no content-type file is imported // into the browser bundle. import { defineEnv, envVar } from '@voltro/env' // Public, build-time env (baked into the bundle). Never a secret in the browser. export const env = defineEnv({ VOLTRO_PUBLIC_APP_NAME: envVar.string({ access: 'public', default: '{{capProjectName}} CMS' }), }) export default { type: 'web' as const, name: '{{capProjectName}}{{capAppName}}', port: {{port}}, theme: 'system' as const, env, // Bilingual by default (cookie-driven , SSR too). Add a code + // `src/locales/.ts` to grow the app. locales: ['en', 'de'] as const, defaultLocale: 'en' as const, // The api this editor consumes. The lookup key ('cms') is what the hooks pass: // `useAction('cms', 'content.types')`, `useSubscription('cms', 'content.list')`. // Codegen pulls its typed rpc surface (content.* + the plugin's /auth). apis: { cms: { package: '@{{projectName}}/api' }, }, }