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:| Template | Description | Best For |
|---|---|---|
| minimal | Smallest runnable project | Learning, quick experiments |
| api | JSON API service | REST APIs, backend services |
| contract | Multi-protocol service | APIs with REST + JSON-RPC |
| web | Full-stack web app | Server-rendered websites |
| live | Real-time app | Chat, dashboards, live updates |
| sync | Offline-first app | Collaborative apps, offline support |
List Templates
See all available templates:Which Template Should I Use?
Use this decision guide to pick the right template:Are you learning Mizu?
Useminimal - It has the least amount of code, making it easy to understand how Mizu works.
Are you building a REST API?
Useapi - It includes a recommended project structure with feature-based organization.
Do you need multiple protocols (REST + JSON-RPC)?
Usecontract - Define your API once, expose it via multiple transports.
Are you building a website with HTML pages?
Useweb - Includes view templates, layouts, and static asset handling.
Do you need real-time updates (like chat)?
Uselive - Includes WebSocket support and live view rendering.
Do you need offline support with data sync?
Usesync - The most advanced template with offline-first architecture.
Template Comparison
Complexity Level
Features Included
| Feature | minimal | api | contract | web | live | sync |
|---|---|---|---|---|---|---|
| Single file | Yes | - | - | - | - | - |
| Feature-based structure | - | Yes | Yes | Yes | Yes | Yes |
| JSON responses | Yes | Yes | Yes | Yes | Yes | Yes |
| HTML templates | - | - | - | Yes | Yes | Yes |
| Static assets | - | - | - | Yes | Yes | Yes |
| JSON-RPC | - | - | Yes | - | - | - |
| OpenAPI generation | - | - | Yes | - | - | - |
| WebSocket | - | - | - | - | Yes | Yes |
| Live updates | - | - | - | - | Yes | Yes |
| Offline support | - | - | - | - | - | Yes |
| Data sync | - | - | - | - | - | Yes |
Common Patterns
Starting Simple, Then Growing
Start withminimal to learn, then create a new project with api:
Prototyping to Production
Start withminimal for a quick prototype, then migrate to api for production:
- Build your prototype with
minimal - Validate your idea works
- Create a new
apiproject - Copy your business logic over
- 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
liveorsync
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 validgo.mod file:
Common Files
All templates include:| File | Purpose |
|---|---|
go.mod | Go module definition |
.gitignore | Git ignore rules |
README.md | Project documentation |
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-runto preview any template - Check out the tutorials for hands-on guides