Tested with Screens captured from one local run on 2026-10-21 (Chrome plus an iOS simulator, iPhone 17 Pro) with @sgedda/mockifyer-core 1.10.187, @sgedda/mockifyer-fetch 1.8.104 and @sgedda/mockifyer-dashboard 1.5.91. These versions are not pinned: they were the latest npm releases on that date, not versions confirmed against the example's package.json. The commands in this guide have not been run end to end from a clean checkout.
By Sebastian Gedda. Disclosure: I build and maintain Mockifyer, the open-source tool this guide uses, and I run devxtools.dev. Read this as a walkthrough of my own demo app, not a comparison. The neutral overview is on the Mockifyer tool page.
WanderWeird is a demo travel app built to show Mockifyer in a multi-service setup. You log in, plan made-up trips to places like Atlantis Boardwalk or Moon Base Brunch Bar, check real weather and exchange rates, stamp a passport and roll chaos dice. Behind it are seven small Node services, an Umbraco CMS and Mockifyer, which records and replays the services’ outbound HTTP calls and shows how one request fans out across them.
Tested with: the screenshots and recordings come from one local run on 2026-10-21. The commands below have not been run end to end from a clean checkout, so treat script names, ports and defaults as the example’s intended setup and check them against its
package.json. The example isn’t in a public repository yet.
Other tools may fit better. If you write handlers by hand rather than recording traffic, MSW covers browser, Node and React Native tests with one API. For Node-only HTTP stubbing in unit tests, nock is smaller and widely used. If you want record/replay in Node or the browser without a dashboard, Polly.js does that. Mockifyer’s angle is recording across several services and an Expo app into shared scenarios, with a dashboard and hop tracing. That’s useful for a setup like this, but more machinery than a single service needs.
What’s inside
| Folder | What it does | Port |
|---|---|---|
apps/mobile | Expo SDK 57 app. Bottom tabs and stacked screens built from the CMS menu | Expo |
services/gateway-api | The BFF. The app only ever talks to this. It also proxies /graphql | 4200 |
services/auth-api | Fake login and account settings | 4201 |
services/trips-api | Trip CRUD, chaos dice, passport | 4202 |
services/wander-api | Calls Open-Meteo, Frankfurter, Advice Slip, Bored, countries, OpenTripMap | 4203 |
services/cms-api | Turns the Umbraco Delivery API into a nav contract, with a seed fallback | 4204 |
services/lore-api | “Remix hop” that rewrites CMS copy using wander and trips data | 4205 |
services/graphql-api | GraphQL Yoga BFF that aggregates the REST services | 4206 |
cms/umbraco | Umbraco 18 and the Delivery API | 4400 |
packages/mock-bootstrap | Shared Mockifyer setup used by every Node service | – |
mock-data/ | Shared Mockifyer scenario folder (default, hello, …) | – |
| Mockifyer dashboard | Browse mocks, scenarios, hops, client lanes | 3002 |
How it works
mock-data/ folder.- The Expo app talks only to gateway-api (:4200).
- The gateway forwards to lore-api (:4205) and graphql-api (:4206).
- lore-api calls cms-api (:4204, which reads Umbraco on :4400), wander-api (:4203, which calls the public APIs) and trips-api (:4202).
- graphql-api calls auth-api (:4201), trips-api, wander-api and lore-api.
- Each Node service patches
fetchand reads or writes the sharedmock-data/folder. The app connects to the dashboard (:3002) throughsetupMockifyerForReactNative.
In plain words:
- Every Node service calls
initializeMockifyerFromEnv({ label })from@wanderweird/mock-bootstrapwhen it starts. That patches the globalfetch, so each outbound call is either recorded tomock-data/or replayed from it. - All services share one client id (
MOCKIFYER_CLIENT_ID=wanderweird-demo) and one mock folder (MOCKIFYER_PATH=../../mock-data). Calls that cross services are stitched into a single tree of “hops”. The gateway usescreateMockifyerCorrelationMiddleware()to link them. - The Expo app runs its own Mockifyer through
setupMockifyerForReactNative/initMockifyerForReactNativeDashboard(apps/mobile/src/mockifyer-setup.ts) and includes an in-app dev menu. - The bootstrap supports two runtimes, chosen with
MOCKIFYER_RUNTIME:filesystem(default): reads and writes JSON inmock-data/directly.proxy: sends traffic through the dashboard atMOCKIFYER_PROXY_URL(defaulthttp://127.0.0.1:3002), which can store mocks in SQLite or Redis.off: fetch is not patched at all.
Quick start
cd example-projects/wanderweird-travel
npm install
# Terminal 1: all seven Node services
npm run dev
# Terminal 2 (optional but recommended): the Mockifyer dashboard
npm run dashboard # http://127.0.0.1:3002
# Terminal 3: the app
cd apps/mobile
npm run start:hybrid
Log in with one of the demo users:
| User | Password | Flavor |
|---|---|---|
wanderer | wanderer | Spicy chaos default |
jetlag | jetlag | Existential timezone survivor |
You don’t need Umbraco to get started. When the CMS isn’t running, cms-api falls back to services/cms-api/seed/navigation.json. If you want the real CMS:
npm run cms:run # dotnet, Delivery API on :4400
# or
npm run cms:up # Docker
Backoffice is at http://127.0.0.1:4400/umbraco; use the demo credentials in the example’s README.
GraphQL playground: http://127.0.0.1:4206/graphql (the app reaches it through POST http://127.0.0.1:4200/graphql).
Walkthroughs
Record real traffic
npm run dashboard
npm run dev:record # MOCKIFYER_RECORD=true
Use the app as you normally would. Each outbound call, including the weather, FX and advice APIs, is saved under mock-data/<current scenario>/. To record from the app side too, run npm run start:hybrid:record in apps/mobile.
By default the bootstrap stores request stubs only (
MOCKIFYER_RECORD_RESPONSESdefaults tofalse). That meansresponsePendingentries without bodies. If you want full response bodies, setMOCKIFYER_RECORD_RESPONSES=true.
Replay (work offline)
Stop the record script and run npm run dev. Calls that already have a recording are served from mock-data/, so you can demo with no network.
Record a multi-service “hop tree”
This shows how one tap in the app fans out across services.
Filesystem version (no database needed):
npm run dashboard
npm run dev:record:stubs # RECORD=true, RECORD_RESPONSES=false, client_id_header
In the app, turn Mockifyer on and use the wanderweird-demo client id. Nested calls are saved with a parentRequestId. Open http://127.0.0.1:3002/hops to see the tree.
Proxy + SQLite version (central store and a Network tab):
npm run dashboard:sqlite
npm run dev:proxy:record
npm run lane:hello # map lane wanderweird-demo → scenario "hello"
npm run dev:mobile
Then open http://127.0.0.1:3002/hops?scenario=hello.
Redis instead of SQLite: npm run redis:up and then npm run dashboard:redis.
Switch scenarios with client lanes
A scenario is a named set of mocks, such as default or hello. A client lane tells the dashboard which scenario a client id should use:
npm run lane:hello # wanderweird-demo → hello
npm run lane:default # wanderweird-demo → default
Under the hood this is just:
curl -X PUT http://127.0.0.1:3002/api/client-lanes/wanderweird-demo/scenario \
-H 'Content-Type: application/json' -d '{"scenario":"hello"}'
You can also manage scenarios in the dashboard under Settings. It lists the available scenarios, has a Create New Scenario form (optionally derived from an existing one) with Create & Switch, and has Import / export scenario (Download JSON / Choose file…).
The in-app Mockifyer dev menu
This is only available in __DEV__ builds. Go to Account → “Mockifyer dev menu”, or shake the device and pick Dev Menu → “Mockifyer Dev Menu”. From there you can:
- turn Mockifyer on or off
- turn record mode on or off (it’s manual and off by default)
- pick or create a scenario
- set dates for the scenario (global) or for the client lane
Creating scenarios and setting dates need the dashboard running.
Run everything in Docker
npm run cluster:up # Umbraco + all Node services on the "wanderweird" network
npm run cluster:logs
npm run cluster:ps
npm run cluster:down
The gateway stays on host port 4200 and Umbraco on 4400.
Tracing: see every hop, live
Mocking is half the story. Mockifyer can also show you how one tap in the app fans out across all seven services, as it happens and after the fact. There are two views:
| View | Where | Best for |
|---|---|---|
| Mockifyer Atlas | Metro dev server, http://localhost:8081/mockifyer-atlas-live | Watching live traffic from the Expo app while you click around |
| Dashboard → Hops | http://127.0.0.1:3002/hops | Browsing the multi-service chains recorded in a scenario |
Turn tracing on in WanderWeird
-
Metro side (Atlas).
apps/mobile/metro.config.jsalready callsconfigureMetroForMockifyerwith the Metro sync middleware. That middleware serves the Atlas pages, so you don’t need any extra setup. -
Service side (hops). All services share
MOCKIFYER_CLIENT_ID=wanderweird-demo, and the gateway mountscreateMockifyerCorrelationMiddleware(). Outbound calls therefore carry a parent request id, and the dashboard can stitch them into a tree. Pick one setup:Setup Commands Store Filesystem npm run dashboard+npm run dev:record:stubsmock-data/<scenario>/Proxy + SQLite npm run dashboard:sqlite+npm run dev:proxy:recordSQLite through the dashboard Proxy + Redis npm run redis:up+npm run dashboard:redis+npm run dev:proxy:recordRedis through the dashboard The key env vars, all set by those scripts:
MOCKIFYER_RECORD=true,MOCKIFYER_RECORD_RESPONSES=false(request-only stubs),MOCKIFYER_ACTIVATION_MODE=client_id_header, and for proxy modeMOCKIFYER_RUNTIME=proxyplusMOCKIFYER_PROXY_URL=http://127.0.0.1:3002. -
App side. Start the app (
npm run dev:mobileornpm run start:hybridinapps/mobile) with Mockifyer on and thewanderweird-democlient id. -
Start Atlas capture. In the Metro terminal, press
t. This starts capture, opens the live stream, and signals the app to enable Mockifyer if it runs in manual mode. Presstagain to stop. Capture only starts ont. Just opening the page doesn’t start it. (ais not used for this because Metro reserves it for Android.)
The bootstrap sets
networkLog: { captureBodies: false }, so the services log traffic without response bodies by default.
Mockifyer Atlas, the live Metro hop stream
See it live. These recordings are from a real run with the Atlas page in Chrome on the left and the WanderWeird iOS simulator (iPhone 17 Pro) on the right.
wanderer. Atlas (left) picks up POST /api/auth/login, then POST /graphql TravelerDashboard, while the app (right) switches to "Your trips". (Video, 5 s, no audio.)/discover are the real Advice Slip, Open-Meteo, apicountries and Bored calls. The status line reads roots=2 · hops=20.The page subtitle reads: “Live Metro hop stream — newest first. Search filters the buffer; Render docs writes offline Atlas HTML.”
Toolbar
| Control | What it does | Shortcut |
|---|---|---|
| Search | Filters the buffer by path, body, or requestId. It’s an exact, case-insensitive substring match, so a longer query gives fewer hits | – |
| Expand all / Collapse all | Opens or closes every nested group | e |
| Pause / Resume | Freezes the list. The status line counts hops that were “skipped” while paused | p or Space |
| Errors | Shows errors only | f |
| Dedupe (on by default) | Groups duplicate consecutive hops at every level | d |
| Analyze | Analyzes the current buffer | a |
| Clear | Clears the Metro hop buffer | Backspace |
| Dark mode | Toggles the theme | n |
| Render docs | Explains the buffer and writes offline Atlas HTML to mock-data/atlas-html/ (in this repo you’ll find index.html, pages/, atlas.har, bodies/ …) | – |
| Atlas HTML link | Opens the last generated HTML | – |
Shortcuts are ignored while you’re typing in the search box.
Status line: roots=… · hops=… · collapse=on|off · dedupe=on|off · sse=open|connecting|closed. When paused it also shows paused · N skipped.
Reading a row (left to right):
time METHOD status duration source host path [GraphQL op] [badges]
- source says where the answer came from.
upstreammeans the call went to the real service, andmock-hitmeans Mockifyer replayed it. Anerrorsource shows ERR in the status column. Failed hops also get a red ERR badge, for example the401onGET /api/auth/mein Figure 4. - GraphQL op: for
POST /graphqlthe operation name is shown next to the path, for example TravelerDashboard. That’s the app’squery TravelerDashboard($userId: ID!)inapps/mobile/src/api/graphql.ts. - Collapsed children show as “N nested · click expand”. Click to open the tree, then “N nested · click collapse” to fold it again.
- Actions on each row:
- req / res open the request or response body.
- curl copies the root hop as a curl command. It includes
X-Mockifyer-Include-Traceand uses the full spilled body when it’s available. - trace re-calls the hop with
X-Mockifyer-Include-Traceand opens the result in a new tab.
Re-calling a hop with trace. Clicking trace first asks you to confirm: “Re-call POST http://127.0.0.1:4206/graphql with include-trace? This sends a real request and may change data.” Then it opens a Mockifyer Atlas · include-trace tab. That tab has a status line (OK POST … → 200 375ms), a copyable CURL (INCLUDE-TRACE) block with the x-mockifyer-* headers, a CAPTURED HOPS (BEFORE RE-CALL) tree, and then the full JSON response.
X-Mockifyer-Include-Trace. The curl carries the client id and the parent request id. In this run the upstream didn't return a mockifyerTrace, so the tree is the one captured before the re-call.Dashboard → Hops
Testing_Scenario: 9 chains and 35 hops, one card per user request.Open Hops in the dashboard sidebar, or go to http://127.0.0.1:3002/hops?scenario=hello. The header reads “Multi-service request chains recorded in this scenario”.
- Scenario selector, search, and refresh. Pick the scenario, then search with “Search hops — endpoint, method, filename, or request id”. The ⟳ button reloads the list.
- Each card is one user request across services. It shows:
- “N service hops”
- the Root request id, with the note “downstream hops reference this id as parent”, and a Copy link button
- nested hops collapsed by default
- Badges on each hop:
- entry marks the top of the chain.
- leaf marks the lowest-level hop, with no nested requests.
- +N nested means children are hidden. Click to expand.
- a traffic badge shows Replay, Live, Refresh, or Pending. Pending is a request-only stub (
responsePending). That’s whatMOCKIFYER_RECORD_RESPONSES=falsegives you, and it captures a body on the next matching request. - entry hop (amber) means the hop was added from the same recording run by URL and time, and may lack a parent link.
- If a card says “No request ids on these mocks (inferred chain)”, re-record through the dashboard proxy (
npm run dev:proxy:record) so parent → child links are stored.
Other dashboard pages that help here
| Page | Use it in WanderWeird to… |
|---|---|
| Network | Watch “live traffic through the dashboard proxy and SDKs”. You can toggle network logging and body capture, which is off by default, and clear the log. With Redis, events are stored with a TTL. It’s most useful with dev:proxy:record |
| Overrides | Change fields in a replayed response without re-recording, for example making a trip status or the weather weirder. It also has override groups |
| Date Config | Freeze or shift dates returned by getCurrentDate() per scenario. A date set on a client lane (such as wanderweird-demo) overrides the scenario date for that lane’s proxied requests. The app’s dev menu sets the same thing |
| Statistics | The landing page (/): file count, size, endpoints, service hops per chain, replay-mode buckets, slowest and largest leaf hops |
| Memory | Memory usage overall and per scenario. Check it when the hop buffer or Redis grows during long recording sessions |
Testing_Scenario. Nearly everything is Pending because the default records request-only stubs. (Mock path redacted.)From a hop to its mock. Opening a hop’s mock (here the Open-Meteo forecast) shows Edit Mock with a Service chain (9 hops) tree that highlights where the mock sits. The Request tab has the Replay mode choices Use saved mock, Refresh on next request, Always refresh from live and Always use live API, plus Copy cURL. Picking Always refresh from live shows a “Saved” toast.
Walkthrough: trace a login → TravelerDashboard flow across services
- Start everything:
npm run dashboard:sqlite # terminal 1 npm run dev:proxy:record # terminal 2 npm run lane:hello # map wanderweird-demo → scenario "hello" npm run dev:mobile # terminal 3 (Metro) - In the Metro terminal press
t. The Atlas live page opens. - Open the app before logging in. If the app checks the session first,
GET /api/auth/mereturns a 401 with an ERR badge, which is expected. Pressfto show only errors. (The step-by-step captures in this guide don’t include this step; Figure 4, from an earlier session, shows such a row.) - Log in as
wanderer/wanderer. The login call goes through the gateway (:4200) to auth-api (:4201). - The app now loads the dashboard with
POST /graphql, and the row shows TravelerDashboard. It reads “N nested · click expand”. Click it, or presse, to see gateway → graphql-api (:4206) → auth / trips / wander / lore, with lore → cms and wander → open APIs underneath. - Hit trace on the root row to re-run it with include-trace, or curl to copy it.
- Press
pto pause while you read, then Render docs to save an offline HTML copy undermock-data/atlas-html/. - Switch to the dashboard at
http://127.0.0.1:3002/hops?scenario=hello. The same flow appears as a card with “N service hops”, a shared root request id, and entry, leaf, and Pending badges. Use Copy link to share it. - Optional: on Network, inspect the raw events. On Overrides, tweak a response and replay the flow.
Handy knobs
| Variable | Values | Effect |
|---|---|---|
MOCKIFYER_RUNTIME | filesystem (default), proxy, off | Where mocks live / whether fetch is patched |
MOCKIFYER_RECORD | true | Record calls that miss |
MOCKIFYER_RECORD_RESPONSES | true / false (default) | Store full bodies or just stubs |
MOCKIFYER_ACTIVATION_MODE | always, client_id_header, off | client_id_header only mocks requests that carry the client id. It’s the default in proxy mode |
MOCKIFYER_CLIENT_ID | e.g. wanderweird-demo | Shared lane id |
MOCKIFYER_PATH | e.g. ../../mock-data | Mock folder |
MOCKIFYER_PROXY_URL | http://127.0.0.1:3002 | Dashboard used in proxy mode |
EXPO_PUBLIC_MOCKIFYER_BACKEND | hybrid, redis | App backend |
EXPO_PUBLIC_MOCKIFYER_MODE | on, off, manual, launch_client | App runtime mode |
EXPO_PUBLIC_GATEWAY_URL | URL | Override the gateway (Android emulator default: http://10.0.2.2:4200) |
OPENTRIPMAP_API_KEY | key | Enables nearby POIs on Discover (free signup) |
Troubleshooting
- Nothing shows up in
/hops. Check that the services were started with a record script and that the app sends thewanderweird-democlient id. Inclient_id_headermode, requests without that id are ignored. - Mocks have no bodies. That’s expected, because the default is stubs only. Record again with
MOCKIFYER_RECORD_RESPONSES=true. better-sqlite3NODE_MODULE_VERSION error withdashboard:sqlite. Runnpm --prefix packages/mockifyer-dashboard rebuild better-sqlite3.- Android emulator can’t reach the APIs. Use
10.0.2.2(the default), or setEXPO_PUBLIC_GATEWAY_URL. - The CMS menu looks basic. Umbraco isn’t running, so you’re seeing the seed fallback. Start it with
npm run cms:runornpm run cms:up. - Discover has no POIs. Set
OPENTRIPMAP_API_KEY. - Atlas page is empty. Capture only starts when you press
tin the Metro terminal. Checkcurl http://localhost:8081/mockifyer-network-events. - Hops cards say “inferred chain”. Re-record with
npm run dev:proxy:recordso parent ids are stored. - Dev menu can’t create scenarios. Start
npm run dashboard.
FAQ
Do I need Umbraco, Docker or Redis?
No. npm run dev plus the app is enough. Everything else is optional.
Filesystem or proxy?
Filesystem is the simplest and keeps everything in mock-data/. Proxy routes everything through the dashboard, which gives you a central SQLite or Redis store and the Network tab.
Are the destinations real?
No, they’re all made up: Atlantis Boardwalk, Moon Base Brunch Bar, Narnia Customs Queue, Upside-Down Farmers Market, Bermuda Triangular Buffet, Cloud Nine B&B. The weather and FX data come from real open APIs and are matched to each destination’s “real-world cousin”.
Where do bottom tabs come from?
From the CMS. Each tabScreen under mobileApp becomes a tab, and nested contentPage items become stacked screens at /(tabs)/{screenKey}/content/{...slug}.
Related
Sources
- Mockifyer repository and docs: github.com/sgedda/mockifyer
- npm packages: @sgedda/mockifyer-core, @sgedda/mockifyer-fetch, @sgedda/mockifyer-dashboard
- WanderWeird example: no public repository yet








