Skip to content

Services

Application services

Application services live in servicesDirs and should be generated through the CLI when possible:

bash
bunx nuxt-feathers-zod add service articles --adapter mongodb --schema zod
bunx nuxt-feathers-zod add custom-service reports --methods find --customMethods run --schema zod

Standard and custom Feathers methods are declared separately.

NFZ console services

When console.enabled is active, nine Feathers services are registered before app.setup().

ServiceMethodsPurpose
nfz/servicesfindservice discovery
nfz/schemasfind, get, patchschema inspection and synchronization
nfz/manifestget, patchcurrent NFZ manifest
nfz/buildercreateBuilder preview and apply
nfz/statusfindconsole, authentication, and RBAC status
nfz/rbacget, patchRBAC policy
nfz/presetsfind, createpreset list, preview, and apply
nfz/initcreateguided initialization operations
nfz/database-connectionsfind, getredacted diagnostics and health checks for named connections

Discovery

nfz/services.find() returns a payload containing projectRoot, servicesDirs, and service objects with name and source. The Builder console normalizes this real shape before selecting a service.

Builder client

ts
const builder = useBuilderClient()
const discovery = await builder.getServices()
const schema = await builder.getSchema('users')
const preview = await builder.preview({
  service: 'users',
  fields: schema.fields,
})

Dangerous property names such as __proto__, prototype, and constructor are rejected in Builder inputs. Payload depth, node count, and field count are bounded.

RBAC and writes

nfz/rbac.patch() and Builder apply operations are rejected when console.allowWrite is false.

6.x compatibility

Deprecated /api/nfz/** routes are thin adapters to these Feathers services. They are not independent business APIs.

nuxt-feathers-zod user documentation