Skip to main content
When you create a new project with mizu new, you choose a template. Templates are starter projects that give you a solid foundation with all the boilerplate already set up. Each template is designed for a specific use case, from simple learning projects to complex real-time applications.

Available Templates

The Mizu CLI includes 6 built-in templates:

List Templates

See all available templates:
Output:

Which Template Should I Use?

Use this decision guide to pick the right template:

Are you learning Mizu?

Use minimal - It has the least amount of code, making it easy to understand how Mizu works.

Are you building a REST API?

Use api - It includes a recommended project structure with feature-based organization.

Do you need multiple protocols (REST + JSON-RPC)?

Use contract - Define your API once, expose it via multiple transports.

Are you building a website with HTML pages?

Use web - Includes view templates, layouts, and static asset handling.

Do you need real-time updates (like chat)?

Use live - Includes WebSocket support and live view rendering.

Do you need offline support with data sync?

Use sync - The most advanced template with offline-first architecture.

Template Comparison

Complexity Level

Features Included

Common Patterns

Starting Simple, Then Growing

Start with minimal to learn, then create a new project with api:

Prototyping to Production

Start with minimal for a quick prototype, then migrate to api for production:
  1. Build your prototype with minimal
  2. Validate your idea works
  3. Create a new api project
  4. Copy your business logic over
  5. Enjoy the better structure

Frontend + Backend

For apps with both a frontend and backend:
  • API only (frontend in React/Vue): Use api
  • Server-rendered HTML: Use web
  • Real-time features: Use live or sync

Template Architecture

All templates share these principles:

Embedded in CLI

Templates are built into the CLI binary. This means:
  • No network required to create projects
  • Templates always match CLI version
  • Works offline

Go Module Ready

Every template creates a valid go.mod file:

Common Files

All templates include:

Creating Projects

Basic Creation

With Custom Module Path

Preview Before Creating

Explore Each Template

Minimal Template

Single-file starting point for learning

API Template

JSON API with feature-based structure

Contract Template

Multi-protocol service with OpenAPI

Web Template

Full-stack web app with views

Live Template

Real-time app with WebSockets

Sync Template

Offline-first app with data sync

Next Steps

  • Pick a template and explore its detailed documentation
  • Run mizu new --template <name> --dry-run to preview any template
  • Check out the tutorials for hands-on guides