Skip to content

Commit 8baefe8

Browse files
Add context diagram to README
1 parent b8a9319 commit 8baefe8

File tree

1 file changed

+84
-18
lines changed

1 file changed

+84
-18
lines changed

README.md

Lines changed: 84 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The software will only be used for signposting an individual to an appropriate s
3131

3232
## Setup
3333

34-
First, ensure [Pprerequisites](#prerequisites) are met. Then clone the repository, and install dependencies.
34+
First, ensure [Prerequisites](#prerequisites) are met. Then clone the repository, and install dependencies.
3535

3636
```shell
3737
git clone https://github.com/NHSDigital/eligibility-signposting-api.git
@@ -128,25 +128,91 @@ Local tests will use [localstack](https://www.localstack.cloud/), started & stop
128128

129129
### Diagrams
130130

131-
The [C4 model](https://c4model.com/) is a simple and intuitive way to create software architecture diagrams that are clear, consistent, scalable and most importantly collaborative. This should result in documenting all the system interfaces, external dependencies and integration points.
132-
133-
![Repository Template](./docs/diagrams/Repository_Template_GitHub_Generic.png)
134-
135-
The source for diagrams should be in Git for change control and review purposes. Recommendations are [draw.io](https://app.diagrams.net/) (example above in [docs](.docs/diagrams/) folder) and [Mermaids](https://github.com/mermaid-js/mermaid). Here is an example Mermaids sequence diagram:
136-
137131
```mermaid
138-
sequenceDiagram
139-
User->>+Service: GET /users?params=...
140-
Service->>Service: auth request
141-
Service->>Database: get all users
142-
Database-->>Service: list of users
143-
Service->>Service: filter users
144-
Service-->>-User: list[User]
145-
```
146-
147-
### Modularity
132+
graph TB
133+
subgraph "System Context"
134+
direction TB
135+
Client["NHS App / Client"]
136+
Consumer["Postman / Consumer"]
137+
API["Eligibility Signposting API"]
138+
AWS["AWS"]
139+
end
140+
141+
Client -->|"HTTP Request"| API
142+
Consumer -->|"HTTP Request"| API
143+
API -->|"Deployed on"| AWS
144+
145+
subgraph "Container Diagram"
146+
direction TB
147+
subgraph "AWS Infrastructure"
148+
direction TB
149+
APIGW["API Gateway"]
150+
Lambda["Python Lambda (app.py)"]
151+
DynamoDB["DynamoDB Table"]
152+
S3Bucket["S3 Bucket (rules)"]
153+
IAM["IAM Roles & Policies"]
154+
end
155+
subgraph "CI/CD Pipeline"
156+
direction TB
157+
GH["GitHub Actions"]
158+
TF["Terraform"]
159+
end
160+
end
161+
162+
Client -->|"HTTPS POST /eligibility"| APIGW
163+
APIGW -->|"Invoke"| Lambda
164+
Lambda -->|"GetItem/PutItem"| DynamoDB
165+
Lambda -->|"GetObject"| S3Bucket
166+
Lambda -->|"Uses"| IAM
167+
168+
GH -->|"runs pipelines"| TF
169+
TF -->|"provisions"| APIGW
170+
TF -->|"provisions"| DynamoDB
171+
TF -->|"provisions"| S3Bucket
172+
TF -->|"provisions"| IAM
173+
174+
subgraph "Eligibility Lambda Function - Components"
175+
direction TB
176+
App["app.py (WireUp DI)"]
177+
Config["config.py, error_handler.py"]
178+
subgraph "Presentation Layer"
179+
direction TB
180+
View["views/eligibility.py"]
181+
ResponseModel["views/response_model/eligibility.py"]
182+
end
183+
subgraph "Business Logic Layer"
184+
direction TB
185+
Service["services/eligibility_services.py"]
186+
Operators["services/rules/operators.py"]
187+
end
188+
subgraph "Data Access Layer"
189+
direction TB
190+
RepoElig["repos/eligibility_repo.py"]
191+
RepoRules["repos/rules_repo.py"]
192+
Factory["repos/factory.py, exceptions.py"]
193+
end
194+
subgraph "Models"
195+
direction TB
196+
ModelElig["model/eligibility.py"]
197+
ModelRules["model/rules.py"]
198+
end
199+
end
200+
201+
Lambda -->|"loads"| App
202+
App -->|injects| View
203+
View -->|calls| Service
204+
Service -->|calls| Operators
205+
Service -->|calls| RepoElig
206+
Service -->|calls| RepoRules
207+
RepoElig -->|uses| DynamoDB
208+
RepoRules -->|uses| S3Bucket
209+
View -->|uses| ResponseModel
210+
App -->|reads| Config
211+
Service -->|uses| ModelElig
212+
Operators -->|uses| ModelRules
213+
App -->|wires| Factory
148214
149-
Most of the projects are built with customisability and extendability in mind. At a minimum, this can be achieved by implementing service level configuration options and settings. The intention of this section is to show how this can be used. If the system processes data, you could mention here for example how the input is prepared for testing - anonymised, synthetic or live data.
215+
```
150216

151217
## Contributing
152218

0 commit comments

Comments
 (0)