Production readiness
This page lists the checks to perform before shipping an application based on nuxt-feathers-zod.
Goal
A production-ready application should have:
- a clear Nuxt configuration;
- services generated or structured according to the module conventions;
- tested authentication flows;
- a strict separation between public configuration and server secrets;
- dangerous administration actions disabled by default;
- operational documentation that the project team can understand quickly.
Quick checklist
bash
bunx nuxt-feathers-zod doctor
bunx nuxi prepare
bun run typecheck
bun run buildThen verify:
- the
services/directory exists whenfeathers.servicesDirsis['services']; services/.nfz/manifest.jsonmatches the actual services;- authentication strategies declared in
feathers.authexist on the backend; - sensitive environment variables are not exposed through
publicruntime config; - remote URLs are correct for REST and Socket.io;
- protected routes redirect correctly when no session is available.
Recommended minimal configuration
ts
export default defineNuxtConfig({
modules: ['nuxt-feathers-zod'],
feathers: {
client: { mode: 'embedded' },
servicesDirs: ['services'],
transports: {
rest: { enabled: true, path: '/feathers' },
websocket: { enabled: true },
},
auth: {
enabled: true,
strategies: ['local', 'jwt'],
},
database: {
mongodb: {
enabled: true,
url: process.env.MONGO_URL,
},
},
},
})Services
The recommended workflow is to generate services through the CLI.
bash
bunx nuxt-feathers-zod add service articles --adapter mongodb --schema zodThis keeps the following elements aligned:
- the
.nfzmanifest; - naming conventions;
- schemas;
- hooks;
- shared imports;
- runtime scanner compatibility.
Authentication
For local/JWT authentication:
bash
bunx nuxt-feathers-zod add service users --auth --adapter mongodb --schema zodFor a remote application using Keycloak:
bash
bunx nuxt-feathers-zod init remote \
--url https://api.example.com \
--transport socketio \
--auth \
--payloadMode keycloak \
--tokenField access_tokenIn production, validate the flow in these situations:
- initial login;
- browser refresh;
- token expiration;
- protected route;
- protected service call;
- logout;
- authentication failure.
MongoDB management
MongoDB administration endpoints should stay conservative.
Recommended defaults:
- enable read access only when needed;
- keep database and collection creation disabled;
- keep document deletion disabled;
- keep drop database and drop collection disabled;
- limit access to an allowlist of databases when possible.
Runtime config
Public values may be exposed through runtimeConfig.public._feathers. Secrets must stay in private runtime config or server-side environment variables.
Never expose these values to the client:
- a full MongoDB URL with credentials;
- JWT secrets;
- confidential Keycloak secrets;
- SMTP credentials;
- administration keys.
Suggested smoke tests
Before delivery:
- Start the app in a local production mode.
- Verify
/feathersor the configured REST path. - Sign in with a test account.
- Call a public service.
- Call a protected service.
- Verify session restoration after refresh.
- Check server logs for authentication failures.
- Trigger a controlled error and verify how it appears in the UI.
Best practices
- Do not create services manually when the CLI can generate them.
- Version the
.nfzmanifest. - Keep business hooks close to the service.
- Encapsulate critical access through composables or domain stores.
- Avoid scattered direct
$api.service(...)calls in sensitive pages. - Keep destructive actions disabled by default.
