Skip to content

go-mizu/mizu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mizu

Go Reference Go Report Card Codecov

A lightweight, composable web framework for Go.

Mizu logo

Mizu [水] - means water💧 in Japanese - helps you build clear and reliable web applications using modern Go. It keeps things simple, close to the standard library, and gives you the control you expect as a Go developer.

Overview

Mizu is designed to make building web servers in Go straightforward and enjoyable. It provides just enough structure to handle routing, middleware, templates, and streaming without hiding how net/http works underneath.

Everything in Mizu is built to feel natural to Go developers. You can start with a few lines of code, and as your project grows, the same patterns still apply. There are no custom DSLs or hidden global states—just plain Go that compiles fast and reads cleanly.

Quickstart

Install Mizu and create a simple web app:

go get github.com/go-mizu/mizu@latest

Create main.go:

package main

import "github.com/go-mizu/mizu"

func main() {
	app := mizu.New()

	app.Get("/", func(c *mizu.Ctx) error {
		return c.Text(200, "Hello, Mizu!")
	})

	app.Listen(":3000")
}

Run it:

go run main.go

Open http://localhost:3000 in your browser.

CLI Installation

The Mizu CLI provides project scaffolding and development tools.

Using Go install:

go install github.com/go-mizu/mizu/cmd/mizu@latest

This downloads and installs the CLI from the published module.

From source (for development):

git clone https://github.com/go-mizu/mizu.git
cd mizu
make workspace  # Creates go.work for local development
make install

This builds the CLI using your local changes and installs to $HOME/bin. Ensure this directory is in your PATH.

Verify installation:

mizu version

Using the CLI

The CLI provides commands for creating projects, running development servers, working with service contracts, and exploring middlewares.

Create a new project:

# List available templates
mizu new --list

# Create a project from a template
mizu new ./myapp --template minimal

# Create a frontend project with a specific framework
mizu new ./myapp --template frontend:react
mizu new ./myapp --template frontend:vue

# Preview what will be created (dry run)
mizu new ./myapp --template api --dry-run

Available templates include:

  • minimal - Smallest runnable Mizu project
  • api - JSON API service with recommended layout
  • web - Full-stack web app with views and components
  • contract - Code-first API contract with REST, JSON-RPC, and OpenAPI
  • live - Real-time interactive app with live views
  • sync - Offline-first app with sync and reactive state
  • frontend:* - Frontend frameworks (react, vue, svelte, angular, next, nuxt, htmx, alpine, preact, sveltekit)
  • mobile:* - Mobile apps (ios, android, flutter, dotnet, reactnative)

Run in development mode:

cd myapp
mizu dev

# Pass arguments to your application
mizu dev -- --port 3000

The dev command auto-detects your main package (checking cmd/ or the current directory) and runs it. Use --cmd to specify a custom path if needed.

Work with service contracts:

# List all methods from a contract
mizu contract ls

# Show method details
mizu contract show todo.Create

# Call a method
mizu contract call todo.Create '{"title":"Buy milk"}'

# Export OpenAPI spec
mizu contract spec > openapi.json

# Generate code from a contract definition
mizu contract gen contract.go

Explore middlewares:

# List all available middlewares
mizu middleware ls

# Filter by category
mizu middleware ls -c security

# Show middleware details
mizu middleware show helmet

Global flags:

Flag Description
--json Emit machine-readable JSON output
--no-color Disable colored output
-q, --quiet Reduce output to errors only
-v, --verbose Increase verbosity (repeatable)
-h, --help Show help

Contributing

Mizu is an open project, and everyone is welcome. If you enjoy Go and want to help build a clean, modern framework, you are encouraged to contribute.

You can:

  • Report issues or suggest improvements
  • Improve examples and documentation
  • Write middleware or helper packages
  • Share your ideas and feedback in GitHub discussions

Every contribution helps make Mizu better. Thoughtful code, good design, and clear documentation are all equally valuable.

License

MIT License © 2025 Mizu Contributors

Mizu keeps web development in Go clear, explicit, and enjoyable from the first line of code to production.

About

Zero-dependency web framework built entirely on Go's standard library

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •