The Context Map is a bird’s-eye view of your schema’s architecture: each context view is rendered as a single node showing its name and entity count, and the arrows between nodes are derived from the actual foreign keys in the diagram. It is computed, not drawn - when relationships change, the map follows, so there is no separate architecture diagram to keep in sync. Click Exit Context Map to return to the diagram.

A Context Map of twelve contexts - account, Auth, catalog, learning, targeting and others - with dependency arrows between them, each carrying a badge with its foreign key count

How do I open the Context Map?

Open the Context Views panel and click Context Map in its header. The panel lists every context view in the diagram with its color dot; the map renders all of them at once.

The Context Views panel listing twelve contexts, with the Context Map button in the panel header

What do the arrows on the Context Map mean?

An arrow is drawn from context A to context B whenever entities in A hold foreign keys into entities in B. The arrows are built to be read precisely:

  • One arrow per direction. If two contexts depend on each other, each direction gets its own arrow, so an asymmetric dependency (1 foreign key one way, 5 the other) reads at a glance.
  • A badge with the foreign key count sits on every arrow - the weight of the dependency, not just its existence.
  • A circle marks the source end of every arrow, so a line that merely passes through or near a context is never misread as originating from it.
  • Color follows the context. Each context view’s color carries onto its node header and its outgoing arrows, the same way an entity’s color propagates to its relationships on the main diagram.

How do I spot circular dependencies between contexts?

Read the arrow shapes. A straight arrow is a one-way dependency. A curved arrow means the two contexts depend on each other - a circular dependency. Scanning the map for curves is the whole audit: any curve is a pair of contexts that cannot be separated cleanly until one direction is removed.

Curves flag cycles between two contexts. Indirect cycles span several contexts (A depends on C, C on B, B back on A - every arrow straight, yet a cycle), and the map gives you two ways to find them:

  • Walk the chain by clicking. Click the context you are checking to highlight its outgoing dependencies, then click each context it points to and follow the highlighted arrows onward, round by round. If every chain ends at a context whose arrows point nowhere new, that context is clean. If some round highlights an arrow pointing back at the context you started from, you have found an indirect circular dependency.
  • Ask AI Chat. AI Chat analyzes the Context Map’s dependency graph and answers directly - the faster route on a map with many contexts, where walking every chain by hand gets tedious. It can also re-arrange the contexts for you, so tidying the map is one request instead of a drag session.

How do I see which foreign keys create a dependency?

Double-click a dependency arrow. A panel lists every entity relation behind that arrow - the source field, the target entity, and the actual constraint name (for example otps.tenant_id -> tenants, otps_tenant_id_fkey). This is the exact coupling surface between the two contexts, useful for design reviews or for planning a module extraction.

The panel header names the direction it is explaining, and there is one row per relation - so the number of rows always matches the count on the arrow’s badge. The 3 on progress -> learning below opens into exactly three foreign keys, all of them pointing at the same trainees table.

The dependency detail panel for the progress to learning arrow, listing three entity relations with their source fields, target entity, and constraint names

How do I inspect one context on a busy map?

  • Click a context to highlight all of its dependency arrows, so you can trace what it depends on - and what depends on it - without following lines by eye. Everything else fades back, and the foreign key count stays readable on each highlighted arrow.
  • Fuzzy search finds a context by any fragment of its name and focuses and highlights the match.
  • A context whose view carries a markdown description shows a file icon on its node; clicking it opens a modal rendering the description, so what a context is for is readable without leaving the map.
  • The footer keeps the totals in view: how many contexts the map contains and how many dependencies run between them - for example Contexts: 12 Dependencies: 20.

The learning context selected on the Context Map, its outgoing arrows highlighted with foreign key counts while every other dependency fades into the background

Search lists every context with its entity count as you type, so jumping to one on a crowded map takes a few keystrokes.

The context search panel open over the Context Map, listing each context with its entity count

The description modal renders the full markdown attached to the context view - what the view covers, its boundary rules, and the invariants worth knowing - read straight from the map.

The markdown description modal for the Auth context, opened from the file icon on its Context Map node

Can I export the Context Map?

Yes. The Context Map exports as JPG, PNG, or SVG, or as a Mermaid diagram - so the architecture picture renders natively in Mermaid-enabled platforms such as GitHub, GitLab, Notion, and Obsidian, right next to the code it describes. The map at the top of this page is an unedited SVG export, which is why it stays sharp at any zoom.

Next

The map can never drift from the schema because every view derives from one set of entities - see the Single Source of Truth workflow.