Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions diagrams/class-diagrams/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Class Diagrams for GOV.UK Forms apps

The mermaid files in this directory are [Class Diagrams](https://mermaid.js.org/syntax/classDiagram.html) for each of the apps we run that make up the main GOV.UK Forms system.

## How to generate

In each app, install the `rails-erd` gem:

```ruby
group :development do
gem "rails-erd", git: "https://github.com/voormedia/rails-erd.git"
end
```

We need the latest version in the repo, as at the time of writing the most recent release does not include [Mermaid support](https://github.com/voormedia/rails-erd/commit/22cfc76098e222b7c211f0369e80580aeaa22c70).

> ⚠️ Note: Do not commit the gem into the app repos.

Run:

```shell
generator="mermaid" rake erd
```

This will create a file called `erd.mmd` in the root of the application.

## Update the diagram

1. Open the file in an editor and copy the contents (all of the `classDiagram` block).
2. Paste the contents into the corresponding diagram file, replacing everything inside the "mermaid" block:
````
```mermaid
classDiagram
...
```
````
3. Update the date near the top of the file.
11 changes: 10 additions & 1 deletion diagrams/admin-erd.mmd → diagrams/class-diagrams/admin.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
title: GOV.UK Forms Admin app class diagram
---

# GOV.UK Forms Admin app class diagram
## 2025-05-29

```mermaid
classDiagram
direction RL
class `CreateFormService::CreateFormEvent`
Expand Down Expand Up @@ -77,4 +85,5 @@ classDiagram
`Organisation` --> `Group`
`Organisation` --> `MouSignature`
`Group` --> `Membership`
`Group` --> `GroupForm`
`Group` --> `GroupForm`
```
11 changes: 10 additions & 1 deletion diagrams/api-erd.mmd → diagrams/class-diagrams/api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
title: GOV.UK Forms API class diagram
---

# GOV.UK Forms API class diagram
## 2025-05-29

```mermaid
classDiagram
direction RL
class `AccessToken`
Expand Down Expand Up @@ -86,4 +94,5 @@ classDiagram
`Page` --> `Condition`
`Form` --> `MadeLiveForm`
`Form` --> `Api::V2::FormDocument`
`Condition` .. `Form`
`Condition` .. `Form`
```
11 changes: 10 additions & 1 deletion diagrams/runner-erd.mmd → diagrams/class-diagrams/runner.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
title: GOV.UK Forms Runner app class diagram
---

# GOV.UK Forms Runner app class diagram
## 2025-05-29

```mermaid
classDiagram
direction RL
class `Submission`
Expand All @@ -8,4 +16,5 @@ classDiagram
`Submission` : +string mail_status
`Submission` : +string mode
`Submission` : +string reference
`Submission` : +datetime sent_at
`Submission` : +datetime sent_at
```