Skip to main content
This guide walks you through creating a mobile backend with Mizu. You’ll have a working API with device detection, versioning, and mobile-optimized responses in under 5 minutes.

Prerequisites

Before starting, make sure you have:
  • Go 1.22 or later - Download Go
  • Mizu CLI - Install with go install github.com/go-mizu/mizu/cmd/cli@latest
Verify your installation:

Create Your First Mobile Backend

Step 1: Create a New Project

Create a minimal Mizu project:

Step 2: Add Mobile Middleware

Update your main.go to add mobile support:

Step 3: Run the Server

Your mobile backend is now running at http://localhost:3000.

Test Your API

Test with Mobile Headers

Response:

Test API Versioning

Add More Features

Require Device ID

Now requests without X-Device-ID return 400 Bad Request.

Enforce Minimum App Version

Requests with app versions below 1.5.0 return 426 Upgrade Required.

Add Offline Sync

Add Push Token Registration

Create a Mobile Client

Using a Template

Create a complete mobile client with matching SDK:

Manual Client Setup

iOS (Swift)

Android (Kotlin)

Flutter (Dart)

Project Structure

A typical mobile backend project:

Common Patterns

Platform-Specific Responses

Graceful Version Migration

Structured Error Responses

Next Steps

You’ve created your first mobile backend! Here’s what to explore next:

Device Detection

Deep dive into device parsing and validation

API Versioning

Learn about version management

Offline Sync

Implement delta synchronization

Push Notifications

Handle push token registration