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- Your app sends traffic to Mock Alpha (directly, or via an interceptor in debug builds)
- Mock Alpha captures the request, normalises the path, and seeds response scenarios
- From the dashboard you choose which scenario to serve
- Optionally configure match rules so different request shapes get different responses
- For real-time events, configure MQTT topics that fire when endpoints are hit
Two ways to integrate
| Approach | How | Best for |
|---|---|---|
| Direct base URL | Point your app's API base URL at Mock Alpha's /api/mock endpoint | Any platform, zero extra code |
| Interceptor | A debug-build interceptor that captures real traffic and serves mocks | Auto-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
aedesbroker 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.