Java 21, Javalin, MapDB, Svelte
MockBoard is a small local app for mocking HTTP APIs.
Run it, create a board, add mock rules, and call the generated /m/{boardId} URL from your app, tests, or scripts. Boards and rules are stored locally in MapDB, so there is no external database and no team account layer.
- Creates local mock boards with optional display names.
- Serves mock endpoints from
/m/{boardId}. - Supports
GET,POST,PUT,PATCH,DELETE,HEAD, andOPTIONS. - Matches paths exactly or with single-segment
*wildcards. - Returns custom status codes, headers, JSON bodies, and response delays.
- Generates fake response values with
{{template.keys}}. - Shows incoming requests live in the UI through SSE.
- Keeps request logs per board while the app is running.
Start the app, open the UI, create a board, and add a mock rule.
Example mock rule:
- Method:
GET - Path:
/api/users/* - Status:
200 - Body:
{
"id": "{{system.uuid}}",
"name": "{{user.fullName}}",
"email": "{{user.email}}"
}Call it:
curl http://localhost:8000/m/{boardId}/api/users/123Each call is logged in the board dashboard. If the rule body has templates, they are resolved on every request.
Mock response bodies must be valid JSON. Template values can be placed inside JSON strings:
{
"id": "{{system.uuid}}",
"city": "{{address.city}}",
"bio": "{{content.sentence}}"
}Supported template keys:
| Group | Keys |
|---|---|
user |
fullName, firstName, lastName, email, username, phoneNumber, avatar |
address |
full, city, street, zipCode, country, countryCode |
content |
char, word, sentence, paragraph |
system |
int, long, double, bool, uuid |
Full key examples: {{user.email}}, {{address.city}}, {{content.paragraph}}, {{system.uuid}}.
Unknown templates render as [unknown: key]. Generated values are escaped for JSON strings.
Prerequisites:
- Java 21+
- Node 20+ if you are rebuilding the frontend
- Docker if you prefer Docker Compose
Build the frontend:
dev/scripts/build_frontend.shBuild the Java jar:
dev/scripts/rebuild_java.shBuild and run the jar:
dev/scripts/run_jar.shManual run after building:
java -jar target/mockboard-0.4-beta.jarDefault URL:
http://localhost:8000
Docker:
docker compose up -d --buildDocker URL:
http://localhost:8888
Useful environment variables:
| Variable | Default | Purpose |
|---|---|---|
PORT |
8000 |
HTTP server port |
MBD_STORE_PATH |
data/mockboard.db |
Local MapDB file path |
MBD_MAX_MOCK_RULES |
1000 |
Max mock rules per board |
MBD_MAX_WEBHOOKS |
100 |
Max stored request log entries per board |
MBD_VALIDATION_MOCK_MAX_ALLOWED_DELAY |
10000 |
Max response delay in milliseconds |
MBD_VALIDATION_MOCK_MAX_BODY_LENGTH |
100000 |
Max JSON body length |
MBD_VALIDATION_MOCK_MAX_PATH_LENGTH |
1000 |
Max mock path length |
The frontend source lives in src/frontend. The production build is served by Javalin from src/main/resources/static.
No contributions are expected right now.
This is a personal local tool, not a product roadmap. Issues or notes are still useful if something is broken, but pull requests may sit untouched or be closed if they do not match how the tool is used.

