Mock Alpha

Overview

Mock Alpha — unified API mock platform for any client app

Mock Alpha

Mock Alpha is an open-source mock server platform for app development teams. It lets you capture real API traffic, define response scenarios, and replay them during development — no backend dependency needed.

It works with any HTTP client on any platform — Android, iOS, Flutter, web frontends, CLI tools — because the integration is plain HTTP: your app sends requests to Mock Alpha and gets the scenario response you selected in the dashboard.

What it does

HTTP Mocking

Capture and replay API responses. Switch between scenarios from the dashboard without changing client code.

Request-Aware Routing

Route incoming requests to different scenarios based on query parameters, request body, or headers.

Response Templates

Use {{request.X}} placeholders in response bodies to echo back data from the incoming request.

MQTT Mock Server

Embedded MQTT broker. Publish mock events manually or automatically when an HTTP endpoint is hit.

How it works

Your App  →  Mock Alpha  →  returns mock response

               └── MQTT broker  →  pushes events to your app
  1. Your app sends traffic to Mock Alpha (directly, or via an interceptor in debug builds)
  2. Mock Alpha captures the request, normalises the path, and seeds response scenarios
  3. From the dashboard you choose which scenario to serve
  4. Optionally configure match rules so different request shapes get different responses
  5. For real-time events, configure MQTT topics that fire when endpoints are hit

Two ways to integrate

ApproachHowBest for
Direct base URLPoint your app's API base URL at Mock Alpha's /api/mock endpointAny platform, zero extra code
InterceptorA debug-build interceptor that captures real traffic and serves mocksAuto-seeding endpoints from real API responses

See Client Integration for the general protocol, Platform Examples for Flutter / Web / iOS / curl, and Android Interceptor for a full OkHttp reference implementation.

Architecture

Mock Alpha is a single Next.js application with:

  • Dashboard — React UI for managing projects, endpoints, and scenarios
  • API routes — Next.js Route Handlers for all backend logic
  • MQTT broker — embedded aedes broker at ports 1883 (TCP) / 1884 (WebSocket)
  • PostgreSQL — Drizzle ORM for all persistence

You can use a hosted Mock Alpha instance, or run it yourself — see Self-Hosting.

Getting started

See Quick Start to connect your app in under five minutes.

On this page