Core concepts/Route graph

Route graph

The route graph is the static model TrueClara uses for Map, route matching, deploy diffs, and observation context.

The route graph is generated by @trueclara/parser at build or CI time. It is the structural model of your Next.js app: routes, layouts, segments, route groups, dynamic params, and navigation edges that can be discovered from source.

Why it matters

Runtime analytics can tell you that /checkout/review received fewer visits. The graph tells TrueClara where that route sits, what changed around it, and which release shipped the changed structure.

The graph powers:

  • Map rendering.
  • Path pattern matching for runtime events.
  • Deploy graph diffs.
  • Broken URL checks.
  • Route and edge observation context.
  • Setup health.

What the parser sees

InputOutput
app/ or pages/ route filesRoute patterns such as /projects/[id].
Layout filesParent shells and route hierarchy.
Route groupsGrouped structure without changing public paths.
Navigation primitivesEdges between known routes when statically discoverable.
Middleware matchersMiddleware coverage and change detection.

What the parser does not see

The parser is intentionally static. It does not execute your app, call APIs, inspect production data, or guess runtime-only destinations.

Use runtime traffic and deploy attribution to complete the picture. The graph is the frame; runtime events are the measured flow through that frame.

Upload policy

Upload the full parser output:

Terminal
npx @trueclara/parser . --pretty -o trueclara-graph.json
curl -X POST https://api.trueclara.com/v1/static-graphs \
  -H "Content-Type: application/json" \
  -H "X-Trueclara-Project-Key: $TRUECLARA_PROJECT_KEY" \
  --data-binary @trueclara-graph.json

Treat parser failures as setup failures. An incomplete graph can make Map and downstream observations misleading.