Skip to content

Commit fd6b391

Browse files
authored
Merge pull request #5 from NHSDigital/feature/CCM-5145-getting-started-docs
Add architecture documentation for bounded contexts
2 parents 0493ef6 + b90d6d4 commit fd6b391

8 files changed

+110
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- [ ] New feature (non-breaking change which adds functionality)
1616
- [ ] Breaking change (fix or feature that would change existing functionality)
1717
- [ ] Bug fix (non-breaking change which fixes an issue)
18+
- [ ] Documentation
1819

1920
## Checklist
2021

.tool-versions

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
terraform 1.7.0
44
pre-commit 3.6.0
5+
nodejs 18.18.2
6+
gitleaks 8.15.3
57

68
# ==============================================================================
79
# The section below is reserved for Docker image versions.

docs/architecture/Index.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: default
3+
title: Architecture
4+
nav_order: 4
5+
has_children: true
6+
---
7+
8+
Be aware of NHS organizational
9+
standards: [NHS Architecture Principles][nhsap] | [Software Engineering Quality Framework][seqf] |
10+
[Records Management Code of Practise][rmc]
11+
12+
[nhsap]: https://digital.nhs.uk/about-nhs-digital/our-work/nhs-digital-architecture/principles#download-the-nhs-architecture-principles
13+
14+
[seqf]: https://github.com/NHSDigital/software-engineering-quality-framework
15+
16+
[rmc]:https://transform.england.nhs.uk/information-governance/guidance/records-management-code/
17+
18+
## General principles for diagrams
19+
20+
* Pages are structured using the [4+1 View of Architecture][Kruchten]
21+
and flow from high level to broken down functionality.
22+
* Final "view" documentation is meant to represent the "current" view
23+
of the system, not work in progress
24+
* Diagram checklist to help with consistency:
25+
1. Diagrams flow from left to right, then top to bottom to allow
26+
readability
27+
2. 0.5 line and shape width
28+
3. lines are recommended to have text (and preferably numbered)
29+
4. provide context on which part of the system the diagram relates
30+
to
31+
32+
![img.png](assets/kruchten_4_1_model.png)
33+
34+
[<figcaption>Architectural Blueprints—The “4+1” View Model of Software Architecture</figcaption>][Kruchten]
35+
36+
[Kruchten]: https://ics.uci.edu/~michele/Teaching/INF117/Krutchten%204+1View%20SWArch.pdf
37+
38+
* Physical
39+
* [Sub-domains and bounded contexts](physical/sub-domains_and_bounded_contexts)
40+
* [Initial account structure for new architecture](physical/initial_account_structure_for_new_architecture)
46.9 KB
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: default
3+
title: Initial account structure for new architecture
4+
parent: Architecture
5+
---
6+
7+
* The initial accounts have been created reflect the structure we
8+
intend to use for the new Web UI
9+
* A top-level DNS sub-domain provides the mapping from the nhsnotify
10+
DNS root to delegated DNS zones in each sub-domain account
11+
* The Event Bus account provides a central location for events to be
12+
published without the consuming services needing direct knowledge
13+
of the source
14+
* The Web Platform account provides the endpoint for the Web UI and
15+
documentation. It delegates requests to the other micro-frontend (
16+
MFE) services
17+
* Each MFE (micro-frontend) is implemented in its own sub-domain.
18+
Initially these will be:
19+
* CMS: Service documentation. This may be hosted on GitHub pages in
20+
which case it may not have its own domain accounts
21+
* Auth: Federated login identity provider which will provide tokens
22+
for use across the other MFE services
23+
* Template Manager: MVP template manager web UI
24+
* The existing system, while it consists of several conceptual
25+
domains, is currently deployed to a single account
26+
* As we refine the architecture we will extract sub-domains from the
27+
core system and create new accounts to encapsulate them.
28+
29+
![NHS Notify Domains](assets/Domains.drawio.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: default
3+
title: Sub-domains and bounded contexts
4+
parent: Architecture
5+
---
6+
7+
[Bounded contexts][1] are a pattern used in DDD to model parts of a
8+
system which operate on a single consistent model of part of a
9+
business domain.
10+
11+
[1]: https://martinfowler.com/bliki/BoundedContext.html
12+
13+
For NHS Notify we are attempting to keep our architecture modular
14+
following DDD principles. As a starting point when creating new
15+
bounded contexts these are some suggestions for structuring the AWS
16+
accounts and components which are deployed within them.
17+
18+
* By default, each sub-domain has its own AWS accounts
19+
* `<sub-domain>-preprod` (AKA `dev`)
20+
* `<sub-domain>-prod`
21+
* Each sub-domain will have a top-level GitHub repo which defines the
22+
account-level infrastructure
23+
* Each sub-domain will have one or more bounded contexts
24+
* Usually this revolves around some store of state
25+
* Subscriptions for events which affect that state
26+
* Handlers and processing for changes to state
27+
* APIs for direct actions on the state
28+
* Events published to reflect changes to the state
29+
* Auditing and logging to wrap the service and provide observability
30+
* A sub-domain may contain one or more microservices
31+
* Each microservice should be individually deployable with defined
32+
contracts between services
33+
* Each microservice should be contained in its own GitHub repo
34+
* Questions:
35+
* Where are audit logs kept? Per sub-domain, or shared location in
36+
isolated account?
37+
38+
![Bounded Context Diagram](assets/Bounded_Context.drawio.png)

0 commit comments

Comments
 (0)