# compositionalit/farmer architecture

> Architecture diagram of the GitHub repository compositionalit/farmer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/compositionalit/farmer
- Repository: https://github.com/compositionalit/farmer

## Overview

Farmer is an F# library for defining repeatable Azure deployments. The apparent workflow is that an engineer composes resources with builder APIs, Farmer represents those resources as Azure Resource Manager (ARM) definitions, and the deployment layer applies them to Azure. The tree also shows broad resource coverage and shared composition/deployment modules. No source excerpts were provided, so the flow edges below are dashed and unverified; the README describes the product purpose but not internal calls.

Main entry points: [`src/Farmer/Builders`](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Builders) (Resource builders), [`src/Farmer/Writer.fs`](https://github.com/compositionalit/farmer/blob/master/src/Farmer/Writer.fs) (Resource composition), [`src/Farmer/Arm`](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm) (ARM definitions), [`src/Farmer/Deploy.fs`](https://github.com/compositionalit/farmer/blob/master/src/Farmer/Deploy.fs) (Deployment template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Deployment authoring"]
  node_builders["Resource builders"]
  node_types["Core types<br/>[Types.fs]"]
end

subgraph group_resources["Azure resource coverage"]
  node_compute["Compute resources"]
  node_networking["Networking resources"]
  node_data["Data resources"]
  node_platform["Platform resources"]
  node_operations["Operations resources"]
  node_identity["Identity resources"]
end

subgraph group_composition["Template composition"]
  node_common["Shared helpers<br/>[Common.fs]"]
  node_writer["Resource composition<br/>[Writer.fs]"]
  node_arm["ARM definitions"]
  node_template["Deployment template<br/>[Deploy.fs]"]
end

subgraph group_deployment["Deployment"]
  node_deploy["Deployment client<br/>[Deploy.fs]"]
end

node_engineer(("Engineer"))
node_azure["Azure"]

node_engineer -.->|"defines resources"| node_builders
node_builders -.->|"uses types"| node_types
node_builders -.->|"configures"| node_compute
node_builders -.->|"configures"| node_networking
node_builders -.->|"configures"| node_data
node_builders -.->|"configures"| node_platform
node_builders -.->|"configures"| node_operations
node_builders -.->|"configures"| node_identity
node_builders -.->|"uses helpers"| node_common
node_builders -.->|"composes resources"| node_writer
node_writer -.->|"produces definitions"| node_arm
node_arm -.->|"serializes to"| node_template
node_template -.->|"provides input"| node_deploy
node_deploy -.->|"deploys to"| node_azure

click node_builders "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Builders"
click node_types "https://github.com/compositionalit/farmer/blob/master/src/Farmer/Types.fs"
click node_compute "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm"
click node_networking "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm"
click node_data "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm"
click node_platform "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm"
click node_operations "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm"
click node_identity "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm"
click node_common "https://github.com/compositionalit/farmer/blob/master/src/Farmer/Common.fs"
click node_writer "https://github.com/compositionalit/farmer/blob/master/src/Farmer/Writer.fs"
click node_arm "https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm"
click node_template "https://github.com/compositionalit/farmer/blob/master/src/Farmer/Deploy.fs"
click node_deploy "https://github.com/compositionalit/farmer/blob/master/src/Farmer/Deploy.fs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_builders,node_types toneBlue
class node_compute,node_networking,node_data,node_platform,node_operations,node_identity toneAmber
class node_common,node_writer,node_arm,node_template toneMint
class node_deploy toneRose
class node_engineer,node_azure toneIndigo
```

## Components

### Deployment authoring

- [Resource builders](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Builders): `src/Farmer/Builders`
- [Core types](https://github.com/compositionalit/farmer/blob/master/src/Farmer/Types.fs): `src/Farmer/Types.fs`

### Azure resource coverage

- [Compute resources](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm): `src/Farmer/Arm`
- [Networking resources](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm): `src/Farmer/Arm`
- [Data resources](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm): `src/Farmer/Arm`
- [Platform resources](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm): `src/Farmer/Arm`
- [Operations resources](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm): `src/Farmer/Arm`
- [Identity resources](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm): `src/Farmer/Arm`

### Template composition

- [Shared helpers](https://github.com/compositionalit/farmer/blob/master/src/Farmer/Common.fs): `src/Farmer/Common.fs`
- [Resource composition](https://github.com/compositionalit/farmer/blob/master/src/Farmer/Writer.fs): `src/Farmer/Writer.fs`
- [ARM definitions](https://github.com/compositionalit/farmer/tree/master/src/Farmer/Arm): `src/Farmer/Arm`
- [Deployment template](https://github.com/compositionalit/farmer/blob/master/src/Farmer/Deploy.fs): `src/Farmer/Deploy.fs`

### Deployment

- [Deployment client](https://github.com/compositionalit/farmer/blob/master/src/Farmer/Deploy.fs): `src/Farmer/Deploy.fs`

### Other components

- **Engineer**
- **Azure**

## Connections

- Engineer → Resource builders: defines resources
- Resource builders → Core types: uses types
- Resource builders → Compute resources: configures
- Resource builders → Networking resources: configures
- Resource builders → Data resources: configures
- Resource builders → Platform resources: configures
- Resource builders → Operations resources: configures
- Resource builders → Identity resources: configures
- Resource builders → Shared helpers: uses helpers
- Resource builders → Resource composition: composes resources
- Resource composition → ARM definitions: produces definitions
- ARM definitions → Deployment template: serializes to
- Deployment template → Deployment client: provides input
- Deployment client → Azure: deploys to
