# `Choreo.Lab.DSL.C4`
[🔗](https://github.com/code-shoily/choreo/blob/v0.14.1/lib/choreo/lab/dsl/c4.ex#L1)

Experimental Livebook-friendly DSL for sketching C4 models.

This Lab DSL compiles to the stable, pipe-first `Choreo.C4` builders and
returns an ordinary `%Choreo.C4{}`. It keeps C4 nouns explicit — people,
software systems, containers, and components — while relationship verbs make
quick architecture sketches read naturally in Livebook.

## Examples

    iex> import Choreo.Lab.DSL.C4
    ...> model = c4 do
    ...>   customer = person("Customer", description: "API consumer")
    ...>   gateway = system("API Gateway", scope: :in, description: "Routes tenant API traffic")
    ...>   api = container("Gateway API", parent: gateway, technology: "Phoenix")
    ...>   db = container("Tenant DB", parent: gateway, technology: "Postgres")
    ...>
    ...>   customer ~> api |> uses("Submits API requests", technology: "HTTPS")
    ...>   api ~> db |> reads("Tenant config", technology: "SQL")
    ...>   scope gateway
    ...> end
    iex> Choreo.C4.scope(model)
    :gateway
    iex> model.graph.nodes[:api].parent
    :gateway
    iex> [{_, _, _, meta} | _] = Choreo.C4.edges_with_meta(model)
    iex> meta.label
    "Submits API requests"

Relationship edges can use generic labels, typed verbs, or explicit `edge`:

    user ~> system |> uses("Uses")
    api ~> db |> reads("Reads tenant config", technology: "SQL")
    edge api ~> worker, calls: "Dispatches job"
    sends api ~> queue, "Publishes event", technology: "Kafka"

Parent and scope options can use variables bound earlier in the block:

    app = system("Application", scope: :in)
    api = container("API", parent: app)
    auth = component("Auth Controller", parent: api)
    scope app

# `cluster_decl`

```elixir
@type cluster_decl() :: %{id: String.t(), opts: keyword()}
```

# `edge_decl`

```elixir
@type edge_decl() :: %{from: Yog.node_id(), to: Yog.node_id(), opts: keyword()}
```

# `node_decl`

```elixir
@type node_decl() :: %{id: Yog.node_id(), builder: atom(), opts: keyword()}
```

# `actor`

# `app`

# `application`

# `boundary`

# `c4`
*macro* 

Builds a `%Choreo.C4{}` from a compact Lab DSL block.

# `c4`
*macro* 

# `calls`

# `cluster`

# `component`

# `consumes`

# `container`

# `database`

# `datastore`

# `depends`

# `edge`

# `external_system`

# `group`

# `in_scope`

# `module`

# `on`

# `person`

# `publishes`

# `reads`

# `relates`

# `routes`

# `scope`

# `sends`

# `service`

# `software_system`

# `system`

# `taxonomy`

```elixir
@spec taxonomy() :: %{
  clusters: [atom()],
  nodes: [atom()],
  edges: [atom()],
  events: [atom()],
  modifiers: [atom()],
  options: [atom()]
}
```

Returns the vocabulary supported by the C4 DSL.

This is meant as a lightweight Livebook discovery helper when autocomplete is
not enough.

    iex> taxonomy = Choreo.Lab.DSL.C4.taxonomy()
    iex> :person in taxonomy.nodes
    true
    iex> :container in taxonomy.nodes
    true
    iex> :uses in taxonomy.edges
    true

# `technology`

# `type`

# `user`

# `uses`

# `verbs`

```elixir
@spec verbs() :: map()
```

Compatibility alias for `taxonomy/0`.

# `writes`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
