Quick Start

Install GoLazy

Install the lazy CLI, create a GoLazy app, and run it locally.

By Guillermo Alvarez - Published - Updated

Install the CLI

Install the lazy command with Go:

go install github.com/golazy/lazy@latest

Confirm the command is on your PATH:

lazy --version

lazy --version is also used by lazy new to select the matching sample_app tag.

Create a full app

Generate an application from the sample app template:

lazy new github.com/guillermo/my_app
cd my_app

The generated module is a normal Go module. Its executable lives under cmd/app, while application behavior lives under app and init.

Run the app

Start the development loop:

lazy

The command finds the app command, generates JavaScript assets when js.toml is present, builds a temporary binary, starts it on an internal loopback address, and proxies the public address. By default the public address is :3000.

Set a different address when needed:

ADDR=127.0.0.1:4000 lazy

What to inspect first

The first request goes through the same files every generated app uses:

cmd/app/main.go
init/app.go
init/context.go
init/routes.go
app/controllers/home/
app/views/home/index.html.tpl

For the standard route table, init/routes.go starts small:

func Draw(router *lazyroutes.Scope) {
    router.Get("/", home.New, (*home.HomeController).Index)
    router.Resources(postcontroller.New)
}

Verify the generated app

Run the app checks from the module root:

lazy tailwind
lazy js
go test ./...

The asset commands refresh generated public files before Go tests or builds embed them.

Continue with Single-File App when you want the smallest possible shape, or Full App when you want to understand the generated layout.