Skip to content

Commit 4c21c23

Browse files
committed
Update and correct ERD to Class Diagrams
These diagrams are not ERDs but in fact Class Diagrams. They also needed some useful context and instructions on how to update them.
1 parent dea9610 commit 4c21c23

4 files changed

Lines changed: 67 additions & 3 deletions

File tree

diagrams/class-diagrams/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Class Diagrams for GOV.UK Forms apps
2+
3+
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.
4+
5+
## How to generate
6+
7+
In each app, install the `rails-erd` gem:
8+
9+
```ruby
10+
group :development do
11+
gem "rails-erd", git: "https://github.com/voormedia/rails-erd.git"
12+
end
13+
```
14+
15+
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).
16+
17+
> ⚠️ Note: Do not commit the gem into the app repos.
18+
19+
Run:
20+
21+
```shell
22+
generator="mermaid" rake erd
23+
```
24+
25+
This will create a file called `erd.mmd` in the root of the application.
26+
27+
## Update the diagram
28+
29+
1. Open the file in an editor and copy the contents (all of the `classDiagram` block).
30+
2. Paste the contents into the corresponding diagram file, replacing everything inside the "mermaid" block:
31+
````
32+
```mermaid
33+
classDiagram
34+
...
35+
```
36+
````
37+
3. Update the date near the top of the file.
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: GOV.UK Forms Admin app class diagram
3+
---
4+
5+
# GOV.UK Forms Admin app class diagram
6+
## 2025-05-29
7+
8+
```mermaid
19
classDiagram
210
direction RL
311
class `CreateFormService::CreateFormEvent`
@@ -77,4 +85,5 @@ classDiagram
7785
`Organisation` --> `Group`
7886
`Organisation` --> `MouSignature`
7987
`Group` --> `Membership`
80-
`Group` --> `GroupForm`
88+
`Group` --> `GroupForm`
89+
```
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: GOV.UK Forms API class diagram
3+
---
4+
5+
# GOV.UK Forms API class diagram
6+
## 2025-05-29
7+
8+
```mermaid
19
classDiagram
210
direction RL
311
class `AccessToken`
@@ -86,4 +94,5 @@ classDiagram
8694
`Page` --> `Condition`
8795
`Form` --> `MadeLiveForm`
8896
`Form` --> `Api::V2::FormDocument`
89-
`Condition` .. `Form`
97+
`Condition` .. `Form`
98+
```
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: GOV.UK Forms Runner app class diagram
3+
---
4+
5+
# GOV.UK Forms Runner app class diagram
6+
## 2025-05-29
7+
8+
```mermaid
19
classDiagram
210
direction RL
311
class `Submission`
@@ -8,4 +16,5 @@ classDiagram
816
`Submission` : +string mail_status
917
`Submission` : +string mode
1018
`Submission` : +string reference
11-
`Submission` : +datetime sent_at
19+
`Submission` : +datetime sent_at
20+
```

0 commit comments

Comments
 (0)