Configuration

FleetDVK is configured through the top-level declarations in your .dvk files. There is no separate config file — your DSL source is the single source of truth.

Project name

project "my-api"

Sets the name field in the generated package.json. Also used in the server health check response and console output.

Database

database "supabase"

Determines which database client is generated. Currently FleetDVK generates a Supabase client by default. The generated src/config/database.ts file exports a configured client instance.

ValueGenerated clientRequired env vars
supabase@supabase/supabase-jsSUPABASE_URL, SUPABASE_ANON_KEY
postgresqlGeneric config objectDB_HOST, DB_PORT, DB_NAME
mysqlGeneric config objectDB_HOST, DB_PORT, DB_NAME
sqliteGeneric config objectDB_PATH

Framework

framework "express"

Controls which HTTP framework the generated server uses. The entry point (src/index.ts) and route files are generated differently for each framework.

Valuenpm packageNotes
expressexpress ^4.18Default. Includes helmet and cors middleware.
fastifyfastify ^4.25Async-first. Uses @fastify/cors and @fastify/helmet.
honohono ^3.12Lightweight. Uses @hono/node-server for Node.js runtime.

Auth

auth "jwt"

Determines the authentication middleware generated in src/middleware/auth.ts.

ValueBehavior
jwtBearer token validation using jsonwebtoken. Requires JWT_SECRET env var.
sessionPlaceholder session-based auth middleware.
apikeyPlaceholder API key validation middleware.
noneEmpty middleware that passes through. No auth generated.

When auth is set to "jwt", the generated middleware exports two functions:

  • authenticate — Express middleware that validates the Authorization: Bearer header and attaches the decoded payload to req.user.
  • generateToken — Helper function that signs a payload using the JWT secret.

Language

language "typescript"

Currently FleetDVK only generates TypeScript. JavaScript output is on the roadmap. The language declaration defaults to "typescript" if omitted.

Environment variables

The generator creates a .env file with placeholder values. These must be set before running the generated backend.

PORT=3000
NODE_ENV=development

# Database
SUPABASE_URL=your-supabase-url
SUPABASE_ANON_KEY=your-supabase-anon-key

# Auth
JWT_SECRET=your-jwt-secret-change-this
JWT_EXPIRES_IN=7d

Output directory

By default, fleetdvk generate writes to ./generated/. Override this with the -o flag:

$ fleetdvk generate -o ./src

The fleetdvk dev command also accepts -o.