App layout
Everything has one obvious home.
app/
controllers/
views/
public/
services/
init/
cmd/app/
GoLazy handles the web. Your services handle the business.
An opinionated, server-first framework for building and shipping complete web applications in Go. Keep business behavior in plain Go services you own while GoLazy gives everything from routes and views to jobs, deployment, and upgrades one coherent application model.
App layout
app/
controllers/
views/
public/
services/
init/
cmd/app/
lazyapp
# init/app.go
func main() {
err := lazyapp.New(lazyapp.Config{
Name: "blog",
Drawer: Draw,
Public: app.Public,
Views: app.Views,
}).ListenAndServe()
if err != nil {
log.Fatal(err)
}
}
Router
# init/routes.go
func Draw(router *lazyroutes.Scope) {
router.Resources(postcontroller.New)
router.Get("/", pagecontroller.New,
(*pagecontroller.Controller).Home)
}
Controller
# app/controllers/postscontroller/postcontroller.go
type Controller struct {
controllers.BaseController
posts *postservice.Service
}
func (c *Controller) Index() error {
c.Set("posts", c.posts.List())
return nil
}
Views
# app/views/layouts/app.html.tpl
<html>
<head>
<title>My awesome app</title>
</head>
<body>
{{.content}}
</body>
</html>
# app/views/posts/index.html.tpl
{{range .posts}}
<article>{{.Title}}</article>
{{end}}
01 / Three ideas
Services, Views, and Controllers. Your services are plain Go and 100% yours. Bring your own.
GoLazy comes with .skills to ensure models behave properly. It also includes an MCP server for easily exposing your services to your personal agent.
Routes, requests, services, logs, assets, and rebuilds stay visible while you work.
03 / Install
Install the CLI, create the app, and let the devpanel keep the loop visible.
$ curl -fsSL https://golazy.dev/install.sh | sh
$ lazy new github.com/you/myweb
$ cd myweb && lazy
04 / Keep going