Quick Answer
To map frontend API calls to backend endpoints, list every request your code sends (fetch, axios and other clients) and every route your backend defines, then match them by method and path. By hand, that means grep and a lot of reading, because base URLs live in env vars, paths hold variables and proxies rewrite them on the way. A request map built from the code does the matching for you and shows where each request ends: a route in your repo, another project, an outside service, or nowhere.
Why Frontend API Calls Are Hard to Map
Imports connect your files, so an editor can jump from a function to its callers. Requests do not work that way. The frontend calls a string, the backend answers a pattern, and nothing in the code joins them. Five things make the string hard to follow:
- Base URLs in env vars:
${process.env.NEXT_PUBLIC_API_URL}/ordersdoes not say where it goes. - Path variables: the frontend sends
/users/${id}, the backend defines/users/:idor a[id]folder. - Proxies and BFFs: a dev proxy or a rewrite turns
/api/ordersinto/ordersbefore it reaches the backend, and a backend for frontend turns one request into several. - Wrappers: an axios instance or a helper builds the URL in another file.
- Two repositories: the frontend and the backend live in different projects.
Mapping It by Hand
For a small app, start with two lists. The requests:
# Requests sent by the frontend
grep -rnE "fetch\(|axios\.(get|post|put|patch|delete)\(" src app
# Routes in a Next.js app (App Router)
find app -name "route.ts" -o -name "route.js"
# Routes in an Express backend
grep -rnE "(app|router)\.(get|post|put|patch|delete)\(" server
Then match them one by one: method, then path, with the variables and proxy prefixes worked out in your head. It works for twenty requests. It does not survive two hundred, or a teammate who adds a new client next week.
The code itself can make the map easier to read. Scattered URL strings are the hardest to trace:
// Hard to trace: the URL is built in each component
const res = await fetch(`${API}/v2/` + type + `/${id}?full=1`);
// Easier: one client module with one function per endpoint
export const getOrder = (id: string) =>
fetch(`${API}/orders/${id}`).then((r) => r.json());
With one client module, a search for /orders/ finds the one function that sends it, your editor finds that function's callers, and a reader sees the endpoint in one line.
What a Request Map Should Show
| Where a request ends | What it tells you |
|---|---|
| A route in this repo | Which function sends it and which handler answers, with file and line on both sides. |
| Through a proxy | The path the browser sees and the route behind the proxy. |
| Another of your projects | The frontend in one repo calls the backend in another. |
| An outside service | The request leaves your app, for example for Stripe or an AI API. |
| No answer found | Nothing in the code matches: a base URL the code does not show, a repo that is not connected, or a typo worth a look. |
The last row is a list to read, not a list of bugs. Many requests with no match are fine; a few are a route that was renamed and a caller that was not. Before you rename one, find every caller.
How Vibe X-Ray Maps It
VibeDoctor Vibe X-Ray builds this map from your code after every manual and push scan, in its HTTP Requests tab:
- Counts for all requests, those answered in this repo, outside services, no answer found, and those answered in your other projects.
- A map, Where requests go, from the folders that send requests to the code that answers them. Click a bubble to go one level down.
- A list where each row shows the sending function with
file:line, the method and path, and the answering route with its file and line. Requests that pass a proxy say "through the proxy". - Search by function, file, path, method or host.
It reads routes and requests in JavaScript and TypeScript (Express, Fastify, NestJS, Hono, Next.js, SvelteKit, Nuxt, Remix and others; fetch, axios, ky, SWR), Python (Flask, FastAPI, Django; requests, httpx, aiohttp), Java and Kotlin (Spring, JAX-RS, Micronaut, Ktor), C#, Go, Swift, PHP, C and C++, Rust, Dart and Ruby, plus Scala routes from Play and http4s. It follows Next.js rewrites, Vite, Create React App and Angular proxy settings, Vercel and Netlify rewrites, nginx and Caddy.
Vibe Story uses the same links: a step that sends a request shows the route that answers it, or the outside service it leaves for. After the Free Week, Free accounts see the first level of the map and the first few requests; paid plans see where every request goes.
To try VibeDoctor from Claude Code or Codex, paste this into the agent:
connect to vibedoctor using https://vibedoctor.io/mcp/start
Not a developer? Connect your GitHub repository on vibedoctor.io for a free scan.
FAQ
How do I find all API calls in a codebase?
Search for the clients you use, such as fetch(, axios. or httpx., then read where each URL is built. A request map from the code lists them for you, with the function and line that sends each one.
How do I know which frontend code calls an API endpoint?
Match the endpoint's method and path against every request in the frontend, including variables in the path and any proxy prefix. In Vibe X-Ray, search the HTTP Requests tab for the path.
Is a request with no matching route a bug?
Not always. The base URL may come from an env var, the backend may be in a repo that is not connected, or the request may go to a service outside your app. Read the list for renamed routes and typos.
Can it follow requests to a backend in another repository?
Yes, when both are your projects in VibeDoctor. Requests to a project's website address are matched automatically, and you can link two projects in Settings for requests whose address comes from a variable.
Does the map change my score?
No. The request map creates no findings and changes no score. It is there to read.