Add Connections

The Add Connection panel lets you manually define relationships that Codity has not auto-detected, and add custom infrastructure cards (databases, queues, caches, etc.) that sit outside your repositories but are shared between them.

Opening the Panel

Click the link icon in the Architecture Diagram toolbar. The panel expands below the toolbar. Click the icon again or press Cancel to close it.

Mode 1: Repo → Repo

Use this mode to declare a direct dependency between two repositories.

From repo: select the source repository (or an existing custom card) from the dropdown.

To repo: select the target repository (or an existing custom card). The source is excluded from this list.

Description: describe the connection in plain language. Be specific: include the direction of data flow, the protocol, and the purpose. Example: codity.ai calls scanner-service via POST /api/scan to trigger code scans.

Click Save & regenerate to add the connection. It appears on the diagram as a regular edge and is stored locally in your browser.

Mode 2: Custom Card

Use this mode to add a shared infrastructure node: something like a database or message queue that multiple repositories connect to.

Card Name

Enter a name for the infrastructure component, for example Shared PostgreSQL or Redis Cache.

Card Type

Choose the type that best describes the component. This controls the icon and accent color on the diagram.

TypeUse for
DatabasePostgreSQL, MySQL, MongoDB, etc.
QueueKafka, RabbitMQ, SQS, etc.
CacheRedis, Memcached, etc.
GatewayAPI gateways, load balancers, reverse proxies
ExternalThird-party services, SaaS APIs
CustomAnything else

Connected Repos & Cards

Select which repositories or existing custom cards connect to this card by clicking their pills. You can select multiple at once.

Setting connection direction

When you select a repo or card, a direction button appears immediately after the pill. Click it to set the direction of data or dependency flow between the card and that repo. It cycles through three states:

SymbolMeaning
Card → Repo (the card serves the repo; e.g. a shared DB that the repo reads from)
Repo → Card (the repo sends to the card; e.g. a repo writing events to a queue)
←→Bidirectional (both directions, e.g. a repo that reads and writes to the same database)

The direction you set is reflected as arrow orientation on the diagram edge.

Description

Describe how the connected repos use this infrastructure. Example: All services share this PostgreSQL instance for persistent storage. Migrations are managed by codity.ai.

Saving

Click Add to architecture. The card appears on the diagram immediately with edges to all connected repos, using the directions you specified. The card is stored locally in your browser.

Managing Existing Custom Cards

Below the form, the panel shows a list of all custom cards currently on the diagram under Custom cards on diagram. Each row shows the card name and the repos it is connected to.

Click the X button on any card to remove it from the diagram and delete all its connections.

How Connections Are Stored

Repo → Repo connections and Custom cards are saved in your browser's local storage, not on the server. This means:

  • They are personal to your browser session
  • They persist across page refreshes
  • They do not sync to other team members or devices

To share your architecture layout with teammates, use the diagram's Save layout button to persist node positions, and coordinate custom cards manually.