// Backend app for the {{projectName}} project. Read by `voltro dev`. // // `store: 'memory'` is the dev-friendly default — fast startup, no // docker. Switch to `'postgres'` when you wire `docker compose up` // from the repo root. // // `plugins` composes cross-cutting behaviour. Drop entries here to // audit-log mutations, run authz checks, ship webhooks, etc. See // @voltro/plugin-audit for a reference plugin. // // OPTIONAL infra knobs — both are ON by default with a zero-infra backend, // so you only touch them to go distributed (see the commented lines below): // • `cache:` — the query/result cache (`ctx.cache`). Default `memory` // (in-process). Set `'redis'` for a cross-instance cache — or just run // `voltro add redis`, which flips this and provisions the infra for you. // • `kv:` — the durable key-value store (`ctx.kv`, for state you CAN'T // recompute: cursors, onboarding progress, tokens). Default `database` // (durable, shared across replicas). `'redis'` needs a PERSISTENT redis; // `'memory'` is dev-only. Env `CACHE_BACKEND` / `KV_BACKEND` override. import { defineEnv, envVar } from '@voltro/env' // Typed environment — declare your env once; it's validated at boot (fail-fast) // and read on the server via `serverEnv` / `getSecret` from '@voltro/env/server'. // `access` is required: 'public' (browser-safe) or 'secret' (server-only, never // bundled). Run `voltro env` to see the manifest. See the Environment docs. export const env = defineEnv({ LOG_LEVEL: envVar.enum(['debug', 'info', 'warn', 'error'], { access: 'public', default: 'info' }), // Add your own, e.g.: // STRIPE_KEY: envVar.string({ access: 'secret' }), }) export default { type: 'api' as const, name: '{{capProjectName}}{{capAppName}}', store: 'memory' as const, // cache: 'redis' as const, // distributed query/result cache (or: voltro add redis) // kv: 'redis' as const, // durable ctx.kv on Redis (default 'database' — durable) env, }