Describe your data once.
Get a real API, instantly.
mockingpug turns one JSON schema into a deterministic, relational dataset, then serves it over the exact endpoints your app already calls.
{
"amount": 1000,
"data": {
"id": "number.increment",
"name": "username.FS",
"role": "role",
"posts": "data.blogpost"
}
}{
"id": 1,
"name": "Elena Ruiz",
"role": "ADMIN",
"posts": [
{ "title": "…" },
// 6 more, resolved live
]
}Describe
One JSON file per entity. Field-level relations (data.user.id) and inverse relations resolve automatically.
Generate
Validate before anything runs, then generate a fully relational, deterministic dataset from your seed.
Serve
Pick a transport. Same schema, same generated data, same queryresolver underneath, whether that's React (MSW) or Next.js (a real Route Handler).
Some features
Every value is a pure function of seed + entity + index + field. Same seed, same dataset, on every machine and every run.
Field-level (data.user.id) and inverse (data.blogpost) relations resolve automatically, with cycle detection at validation time.
Change one field on a 10,000-record entity and only that field regenerates. Manual test mutations survive.
Pagination (page / offset / cursor), field filtering, substring search, sorting, full CRUD, and consistent error shapes, generated per entity instead of hand-wired.
runtime.delay / runtime.errorRate inject latency and failures live, from a devtools panel, so you can test your loading and error states on demand.
mockingpug types emits a .d.ts straight from your schema, so there are no hand-duplicated interfaces to drift out of sync.
Toggle mock/real network, inspect and reset records per entity, bypass a single endpoint once its real backend is ready.
doctor --strict and --assert-prod-safe catch broken schemas and leaked mock code before they ship.
A handy debugging tool
Devtools helps you visually locate mock data on a page by hiding it with asterisks ***. You can easily view each individual mock data model and add response delays or error rates to requests.
This is Morty, my pug
I named this library in his honor
