Skip to content

Commit

Permalink
Added C4 docs using PlantUML to aid understanding of the sample
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCakeMonster committed Apr 21, 2022
1 parent 374211e commit 06d0f60
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ This is just a sample, and is not complete. The following tasks would need to be

1. Create persistent repository implementations - currently only in-memory implementations exist
2. Consider protecting against duplicate failed messages being broadcast should multiple OrderService instances restart concurrently
3. Add monitoring of messages that have exceeded the maximum failure threshold
4. Delete persisted messages that are older than a maximum retention period
5. Identify and handle poison messages in the ActivityService
6. Move additional parameters to configuration, such as message processing delay, backoff delay, maximum failure threshold
7. Unit tests
8. Add middleware to protect against exceptions thrown by the controllers
9. Add a persistent logging provider
10. Add health checks, to be used to monitor service health (e.g. by a liveness probe in Kubernetes) - especially in the background services.
3. Add authentication, authorisation and validation
4. Add monitoring of messages that have exceeded the maximum failure threshold
5. Delete persisted messages that are older than a maximum retention period
6. Identify and handle poison messages in the ActivityService
7. Move additional parameters to configuration, such as message processing delay, backoff delay, maximum failure threshold
8. Unit tests
9. Add middleware to protect against exceptions thrown by the controllers
10. Add a persistent logging provider
11. Add health checks, to be used to monitor service health (e.g. by a liveness probe in Kubernetes) - especially in the background services.
41 changes: 41 additions & 0 deletions docs/C4Container.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
!define DEVICONS https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/devicons2
!define CLOUDICONS https://raw.githubusercontent.com/plantuml/plantuml-stdlib/master/cloudinsight
!include DEVICONS/react_original.puml
!include DEVICONS/postgresql.puml
!include CLOUDICONS/kafka.puml

title SummarisationSample: Containers

Person(customer, "Customer")
Person(manager, "Manager")

System_Boundary(summarisationSample, "Summarisation Sample") {
Container(customerSite, "Customer Website", "React", "Customer website, through which they manage their orders", , $sprite="react_original")
Container(customerGateway, "Customer API Gateway", "C#, WebAPI", "API Gateway through which the customer website accesses underlying services")
Rel(customerSite, customerGateway, "Uses", "HTTPS")

Container(managementSite, "Management Website", "React", "Management website, through which managers will manage the system", $sprite="react_original")
Container(managementGateway, "Customer API Gateway", "C#, WebAPI", "API Gateway through which the management website accesses underlying services")
Rel(managementSite, managementGateway, "Uses", "HTTPS")

ContainerDb(kafka, "Message Bus", "Kafka", "Messaging", $sprite="kafka")

Container(ordersService, "Order Service", "C#, WebAPI", "Order microservice, responsible for managing orders")
ContainerDb(ordersDB, "Orders Database", "PostgreSQL", "Holds order information", $sprite="postgresql")
Rel(ordersService, ordersDB, "CRUD", "Entity Framework")
Rel(ordersService, kafka, "Publishes Messages", "TCP")
Rel(customerGateway, ordersService, "Place Order", "HTTPS")

Container(activitiesService, "Activity Service", "C#, WebAPI", "Activity microservice, responsible for tracking important system activities")
ContainerDb(activitiesDB, "Activities Database", "PostgreSQL", "Holds activity summaries", $sprite="postgresql")
Rel(activitiesService, activitiesDB, "CRUD", "Entity Framework")
Rel(activitiesService, kafka, "Subscribes to Messages", "TCP")
Rel(managementGateway, activitiesService, "Get Summary", "HTTPS")
}

Rel(customer, customerSite, "Places Order", "HTTPS")
Rel(manager, managementSite, "Requests Summary", "HTTPS")

@enduml
12 changes: 12 additions & 0 deletions docs/C4SystemContext.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@startuml system-context
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml

title SummarisationSample: System Context

Person(customer, "Customer")
Person(manager, "Manager")
System(summarisationSample, "Summarisation Sample")
Rel(customer, summarisationSample, "Place Order", "HTTPS")
Rel(manager, summarisationSample, "Get Activity Summary", "HTTPS")

@enduml
24 changes: 24 additions & 0 deletions docs/SummarisationSample.Docs.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32407.337
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Diagrams", "Diagrams", "{DABC2AC3-E74F-41AA-BAB9-868E2C04442F}"
ProjectSection(SolutionItems) = preProject
C4Container.puml = C4Container.puml
C4SystemContext.puml = C4SystemContext.puml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{0D0F88C4-F52C-4C46-8CB1-2DD828A51A43}"
ProjectSection(SolutionItems) = preProject
Templates\C4_Context.puml = Templates\C4_Context.puml
EndProjectSection
EndProject
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {19FB7B6C-605B-4A08-8273-6D134725E5F3}
EndGlobalSection
EndGlobal

0 comments on commit 06d0f60

Please sign in to comment.