Getting started

FleetDVK is a CLI tool written in Go that combines package management with backend code generation. You write a lightweight DSL, and FleetDVK produces a production-ready TypeScript API with routing, auth, and database layers.

Prerequisites

You need Go 1.22 or later installed on your machine. You can verify your version by running:

$ go version

Installation

Install FleetDVK globally with Go:

$ go install github.com/nopedal/fleetdvk/cmd/fleetdvk@latest

Verify the installation:

$ fleetdvk --version

Quick start

1. Initialize a project

Run the interactive setup wizard. It will walk you through choosing a framework, database, and auth strategy.

$ fleetdvk init

This creates a project directory with a main.dvk file and a generated/ folder containing the scaffolded TypeScript backend.

2. Edit the DSL

Open main.dvk and define your models and routes. The DSL is designed to be readable — each model maps to a database table, and each route group maps to a set of HTTP endpoints.

project "my-api"
database "supabase"
framework "express"
auth "jwt"

model User {
  id      uuid     @primary
  email   string   @unique
  name    string
  role    enum     [admin, user]
}

route "/users" {
  GET    "/"    -> list(User)     @auth
  POST   "/"    -> create(User)   @admin
  GET    "/:id" -> get(User)      @auth
  DELETE "/:id" -> delete(User)   @admin
}

3. Generate

Run the generator. It parses every .dvk file in the current directory and outputs a complete TypeScript project.

$ fleetdvk generate

The output lands in ./generated/ by default. You can change this with the -o flag.

4. Run the backend

$ cd generated pnpm install pnpm dev

Your API is now running. The health check endpoint is at GET /health.

Watch mode

Instead of running generate manually after every change, use watch mode. FleetDVK will monitor all .dvk files and regenerate the backend on every save.

$ fleetdvk dev

Project structure

After generation, your project looks like this:

generated/
├── package.json
├── tsconfig.json
├── .env
└── src/
    ├── index.ts           # server entry point
    ├── config/
    │   └── database.ts    # database client
    ├── middleware/
    │   └── auth.ts        # JWT auth middleware
    ├── models/
    │   └── user.ts        # interfaces + Zod schemas
    └── routes/
        └── users.ts       # route handlers

Next steps

Read the DSL reference to learn the full syntax, or browse the CLI commands for everything FleetDVK can do.