Skip to main content
This guide covers all the ways to install and set up Mizu for your projects.

Requirements

Before installing Mizu, ensure you have:

Checking Your Go Version

If you need to install or upgrade Go, visit go.dev/dl.

Installation Methods

Add Mizu to your existing Go project:
Create a simple main.go:
Run your application:
Visit http://localhost:3000 to see your app.

Method 2: Using the CLI

The Mizu CLI provides project scaffolding and development tools.

Install the CLI

Make sure $GOPATH/bin (or $HOME/go/bin) is in your PATH:

Verify Installation

Create a New Project

Run in Development Mode

This starts your app with hot reload enabled.

Method 3: Using Templates

Start with a pre-configured project structure:

Your First Program

Here’s a complete β€œHello World” example:

Running the Program

Testing the API

IDE Setup

VS Code

  1. Install the Go extension
  2. Open your project folder
  3. VS Code will prompt to install Go tools - accept all
Recommended settings (.vscode/settings.json):

GoLand

  1. Open your project as a Go project
  2. GoLand automatically detects go.mod
  3. Wait for indexing to complete
Recommended settings:
  • Enable β€œFormat on Save”
  • Enable β€œOptimize imports on Save”

Other Editors

For Vim/Neovim, use gopls with your preferred LSP client. For Emacs, use lsp-mode with gopls.

Adding Middlewares

Middlewares are installed as separate packages:
Use them in your app:

Project Structure

Recommended structure for larger applications:

Verifying Installation

Run these checks to ensure everything is set up correctly:

1. Check Go Version

2. Check Mizu Import

3. Run a Test Server

Troubleshooting

”go: module not found”

Ensure you have Go 1.22+ and run:

β€œcommand not found: mizu”

Add Go’s bin directory to your PATH:

Port Already in Use

Change the port in your app:
Or find and kill the process using port 3000:

Next Steps

Quick Start

Build your first complete application.

Core Concepts

Learn about App, Router, Handler, and Context.

Building Blocks

Explore the Mizu component ecosystem.