Velocity is a full-stack web framework for Go. Pre-1.0 and shipping in public. vel.build.
Prerequisites
You need:
-
Go 1.26+ β
go versionshould printgo1.26or newer. -
Homebrew β for installing the
velocityCLI on macOS or Linux. (Other platforms can build from source; see the installer repo.) - Bun (recommended) or Node + npm β for the JS side. The installer picks up whichever it finds.
No Docker, no external services to start. The project-local ./vel binary handles the dev server, migrations, and code generation once the project exists.
π‘ Pro tip β install Bun. Bun is meaningfully faster than npm for both dependency installs and Vite startup, and
velocity newwill use it automatically when present. One-liner:curl -fsSL https://bun.sh/install | bash. If you'd rather stick with npm, the tutorial works exactly the same.
1. Install the installer
brew install --cask velocitykode/tap/velocity
Verify it landed:
velocity --version
You should see the installed version string. The velocity CLI is project-bootstrap-only; once a project exists, you'll use the project-local ./vel binary for everything else.
2. Scaffold a new project
velocity new acme
acme is the placeholder name I use throughout these tutorials β pick whatever fits your project.
The installer asks three quick questions:
-
Project type β
Full stack (Inertia + Vite)for the React + Tailwind setup this tutorial uses. -
Database β
sqlitefor the easiest local default. Postgres and MySQL are available and swap in via env var later. -
Enable Inertia server-side rendering? β
Nfor development. Flip toYlater if you need it.
Use β / β to toggle, enter to confirm.
Once you've answered, the installer clones the template, configures the Go module, initializes git, installs dependencies, builds the project-local ./vel binary, runs the initial migrations, and prints the next two commands you need:
The whole thing takes well under a minute on a warm machine.
3. Start the dev server
cd acme
./vel serve
This boots the Go backend with hot-module-reload, runs Vite for the frontend in parallel, and prints something like:
[velocity] listening on http://localhost:4000
[vite] dev server ready in 230ms
4. Open the app
Navigate to http://localhost:4000.
You'll land on the login page. Register an account, log in, and you're on the dashboard. Every primitive Velocity ships β auth, ORM, queues, cache, mail, storage, broadcasting, scheduling β is wired and ready to use.
Find your way around
Here is what velocity new acme produced. The directories you'll touch most are at the top.
acme/
βββ main.go # Bootstrap chain: Providers, Middleware, Routes, Run
βββ go.mod
βββ .env # Local config (DB driver, secrets, etc.)
β
βββ routes/
β βββ web.go # Web routes (the first file you edit)
β
βββ internal/
β βββ app/ # App-level wiring (kernel, middleware stacks, events)
β βββ handlers/ # HTTP handlers (auth, dashboard, home, health)
β βββ middleware/ # Custom middleware
β βββ models/ # ORM models (the starter ships User)
β βββ commands/ # Custom ./vel commands
β
βββ config/ # Typed config: app.go, auth.go, crypto.go, view.go
β
βββ database/
β βββ migrations/ # Go migration files
β βββ factories/ # Model factories for tests and seeds
β βββ database.sqlite # The local DB after first migration
β
βββ resources/
β βββ js/ # React + TypeScript (app.tsx, pages/, components/, layouts/)
β βββ css/ # Tailwind entrypoint
β βββ views/ # Server-rendered HTML shell for Inertia
β
βββ public/ # Static assets served at the URL root
βββ storage/ # File storage default (uploads, logs)
βββ vite.config.ts # Frontend build config
The shortest possible walk-through:
-
main.go. The bootstrap chain. Anything you wire (providers, middleware, routes, commands, events) flows through it. -
routes/web.go. Where you'll spend most of the first hour. Add a route, point it at a handler ininternal/handlers/. -
internal/handlers/. HTTP handlers. The starter has auth (login, register, logout), dashboard, home, and health. -
internal/models/. Your ORM models. Starts withUser. New models go here, scaffolded by./vel make:model. -
database/migrations/. Schema. Go files, not SQL strings or YAML. New migrations come from./vel make:migrationor./vel make:model -m. -
resources/js/. The React frontend.pages/maps 1:1 to the Inertia responses your handlers return:c.Inertia("Posts/Index", props)rendersresources/js/pages/Posts/Index.tsx. -
config/. Typed Go config files. Reads from.envat startup, exposes typed values to the rest of the app.
That is the loop. routes/web.go declares the URL. internal/handlers/ runs the logic. internal/models/ talks to the database. resources/js/pages/ renders the response.
What's next
-
Add a model.
./vel make:model Post -mscaffolds a model and migration in one shot. -
Add a handler.
./vel make:handler PostsHandlergives you a handler wired to the router. - Read the docs. vel.build/docs covers the full API surface.
That's it. Four commands, one running app. Velocity gets out of your way after that.
Originally published at vel.build/blog/your-first-velocity-app.


Top comments (0)