portal

How portal works

Portal puts your spec, your code and your live traffic on one map, then checks every pull request against it.

Your specarchitecture/*.c4
Your code and configCompose, Kubernetes, Terraform, CDK, Bicep, apps
Live traffic (optional)OpenTelemetry traces
One map
orders-api in the code
fraud-check planned in the spec
orders-db in the code
notifier seen in traffic
Every pull request✓ matches the spec✕ or says what doesn't, with the line

From plan to merge

Using an example system called orders.
1Write down the plan

A file in the repo lists the parts and how they connect.

2A pull request comes in

Portal flags a connection the plan doesn't have.

3Fix it in the same pull request

Update the plan, or change the code.

4The map updates on merge

Built parts are solid, planned ones dashed.

5It keeps checking

Live traffic is compared with the plan too.

Planned: portal suggests the spec change as a small pull request

What portal reads

From your repo, unless you send traces.

Deploy config

  • Docker Compose
  • Kubernetes manifests
  • Helm charts
  • .NET Aspire
  • Cloudflare Worker config
  • Spring Cloud Gateway routes

Cloud infrastructure as code

  • Terraform
  • AWS CloudFormation and SAM
  • AWS CDK (TypeScript, JavaScript, Python)
  • Pulumi (TypeScript, JavaScript, Python, Go, C#, YAML)
  • Azure Bicep, with Azure Verified Modules
  • Azure Resource Manager (ARM) templates
  • Serverless Framework

AWS, Azure, Google Cloud and Cloudflare resources: compute, databases, caches, queues and topics, clusters.

Code

  • Go
  • TypeScript and JavaScript
  • Python
  • Java, Kotlin and Scala
  • C# and F#
  • Rust
  • PHP
  • Elixir
  • Swift
  • C++
  • Ruby

Each app's packages, its framework (30 known, such as Express, Next.js, Spring Boot, FastAPI, Django, ASP.NET Core, Gin, Rails and Axum) and the calls it makes to other apps.

APIs

  • REST
  • gRPC
  • GraphQL
  • SOAP
  • Thrift
  • AsyncAPI
  • WebSocket
  • tRPC
  • JSON-RPC

From routes in the code, or from schema files (OpenAPI, .proto, GraphQL, WSDL, Thrift, AsyncAPI).

Databases, caches and brokers

  • PostgreSQL
  • MySQL
  • MongoDB
  • SQLite
  • DuckDB
  • H2
  • HSQLDB
  • Derby
  • RocksDB
  • LevelDB
  • LMDB
  • BoltDB
  • Cassandra
  • Elasticsearch
  • ClickHouse
  • DynamoDB
  • S3
  • Spanner
  • Firestore
  • Redis
  • Memcached
  • Kafka
  • RabbitMQ
  • NATS
  • SQS
  • Pub/Sub

From the packages an app uses, and from container images.

Live traffic

  • OpenTelemetry traces

Optional. Calls between services that the code doesn't show.

Your plan and the checks

Your plan You write it, in architecture/*.c4

What the system should look like: its parts, how they connect, and rules that must hold.

It lives in the repo and changes through pull requests, like code. It can describe something you haven't built yet; the map shows that as planned. Your coding agent can keep it up to date.

The checks Portal works them out from the code

What a pull request changes, and where the code and the plan disagree. For example, a connection the plan doesn't have, a broken rule or docs that weren't updated.

The checks don't use AI, so the same pull request always gets the same result. Each finding links to the file and line, or the live traffic, it came from. When portal can't tell, it says so.

They also run as a GitHub check, portal facts, so a team can require them before merging.

You can also have an AI review each pull request. It's off by default. Turn it on for a repo on its system page, or comment /portal review on a pull request.

The spec is plain LikeC4

Portal adds a few conventions on top, so any LikeC4 tool still works with it.
model {
billing = domain 'Billing' {
dispatcher = service 'Webhook Dispatcher' {
metadata {
code 'src/dispatcher/**'
docs 'docs/webhooks.md'
otel_service 'webhook-dispatcher'
}
}
}
dispatcher -[request]-> merchant 'POST invoice event'
}
domain

A column on the map. Nest elements inside it.

kind

The layer, one row each, top to bottom: actor, api, service, event, datastore, infra. A component is a part nested in a service; it shows in a frame under it.

code

Files that implement it. A changed file belongs to the most specific pattern.

docs

Its documentation. Code changed but docs didn't: stale docs.

otel_service

Its OpenTelemetry service.name or host, to match calls seen at runtime. Comma-separate several.

only_writes_from, never_calls

Rules: only these write it; it never connects to these. Checked on every PR against the spec and the code; on the system page against traces too.

resource

The deployed name in the Worker config (a queue, D1 or R2 name, a KV or Hyperdrive binding) or a Compose service name, so what the config wires is compared with the spec.

-[kind]->

What a connection does: request, publishes, consumes, reads, writes. A plain -> gets its type from the element kinds.

Keep the spec up to date

Update it by hand or let your coding agent do it. Either way, you can run the checks locally before you push.
portal check

Shows what the pull request comment will say, for your working tree. It sends only file paths and your .c4 files.

By hand

Edit architecture/*.c4 in the same pull request as the code. The checks tell you what's missing.

Your coding agent

If you use one, the skill teaches it the conventions, so it drafts the .c4 change along with the code. Its pull requests are checked like anyone's.

Install it in the repo, then commit
curl -fsSL https://portal.haris-d21.workers.dev/install | sh

Adds the skill and check.mjs to .claude/skills/portal-architecture/, and a short pointer to it in AGENTS.md, plus .github/copilot-instructions.md, GEMINI.md and a Cursor rule when the repo uses them. Run again to update.

Check before pushing
node .claude/skills/portal-architecture/check.mjs
Read the skill · Read the installer

Get started

  1. 01
    Install the GitHub App

    Install it on GitHub, then choose which repos portal reads. Pull requests are checked from the first one.

  2. 02
    Add architecture/*.c4

    Start with a few coarse elements. The map appears when it merges.

  3. 03
    Send traces

    Issue the repo's ingest token on its Runtime tab (needs write access), and point your services or an OpenTelemetry Collector at portal with it. The Runtime tab fills in.

Existing systems

  1. 01
    Open its system page

    Portal draws the map from your deploy config (Compose, Kubernetes, Helm, a Worker) and your cloud infrastructure code (Terraform, CloudFormation, CDK, Bicep), the calls in the code and the traces. It also suggests a starter spec.

  2. 02
    Add what only you know

    Domains, your own names, rules and what you plan to build. Write it yourself, or have your agent propose it in a pull request.

  3. 03
    Refine as you go

    Split coarse elements when pull requests touch them. Each pull request reports how much of the code the spec covers, and says so when that drops.

Read more about where portal is heading, what's next and what it keeps.