-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverview_architecture.puml
More file actions
138 lines (115 loc) · 7.08 KB
/
Copy pathoverview_architecture.puml
File metadata and controls
138 lines (115 loc) · 7.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
@startuml
!theme plain
skinparam componentStyle rectangle
skinparam backgroundColor #FAFAFA
skinparam packageBackgroundColor #F5F5F5
skinparam componentBackgroundColor #E3F4F8
skinparam arrowColor #555555
skinparam defaultFontSize 12
title PCMS Outlook Add-In – Solution Architecture
' ─────────────────────────────────────────────
' Client
' ─────────────────────────────────────────────
package "Outlook Client" #D1E8F0 {
component [Outlook Add-In\n(HTML/JS/Office.js)] as AddIn
}
' ─────────────────────────────────────────────
' API Layer (PCMS.OutlookAddIn.Api)
' ─────────────────────────────────────────────
package "API Layer — PCMS.OutlookAddIn.Api" #FFF3E0 {
component [Controllers\n(Clients, Matters, Documents,\nAttachments, Favourites,\nRecent, Search, Opportunities,\nHealth)] as Controllers
component [GlobalException\nHandlingMiddleware] as ExMiddleware
component [Authentication\n(Advanced Identity / Keycloak JWT)] as Auth
component [FluentValidation\nValidators] as Validators
component [DI Registration\n(ServiceRegistrationExtensions)] as DI
}
' ─────────────────────────────────────────────
' Application Layer (PCMS.OutlookAddin.Application)
' ─────────────────────────────────────────────
package "Application Layer — PCMS.OutlookAddin.Application" #E8F5E9 {
component [Services\n(ClientService, MatterService,\nDocumentService, SearchService,\nFavouriteService, RecentService,\nOpportunityService, UserService)] as AppServices
component [Interfaces\n(IClientService, IMatterService,\nIExternalClientService,\nICacheService, IServiceBusPublisher,\nIGraphEmailService, etc.)] as AppInterfaces
component [Mappers\n(ClientMapper)] as Mappers
}
' ─────────────────────────────────────────────
' Domain Layer (PCMS.OutlookAddin.Domain)
' ─────────────────────────────────────────────
package "Domain Layer — PCMS.OutlookAddin.Domain" #F3E5F5 {
component [Models & DTOs\n(ClientContactSearchDto,\nDashboardDetails, SearchResult,\nPaginatedResponse, UserIdResult, etc.)] as DomainModels
component [Exceptions\n(NotFoundException,\nUnauthorizedException,\nForbiddenException,\nFileTooLargeException)] as DomainExceptions
component [Constants] as DomainConstants
}
' ─────────────────────────────────────────────
' Infrastructure Layer (PCMS.OutlookAddin.Infrastructure)
' ─────────────────────────────────────────────
package "Infrastructure Layer — PCMS.OutlookAddin.Infrastructure" #E3F4F8 {
component [External API Services\n(ExternalClientService,\nExternalMatterService,\nExternalSearchService,\nExternalOpportunityService,\nExternalFavouriteService,\nExternalRecentService,\nExternalDocumentHistoryService)] as ExtServices
component [Caching Decorators\n(CachedExternalClientService,\nCachedExternalMatterService,\nCachedExternalSearchService,\nCachedExternalOpportunityService)] as CacheDecorators
component [RedisCacheService\n+ CacheKeyBuilder] as RedisService
component [GraphEmailService\n+ MsalGraphTokenProvider] as GraphService
component [ServiceBusPublisher\n+ NullServiceBusPublisher] as SBPublisher
component [AdvancedIdentityTokenValidator\n(JWKS validation)] as TokenValidator
component [UserRepository\n(Dapper / SQL)] as UserRepo
component [ExternalApiTokenProvider\n(OAuth client credentials)] as TokenProvider
}
' ─────────────────────────────────────────────
' Azure Functions (PCMS.OutlookAddin.Functions)
' ─────────────────────────────────────────────
package "Azure Functions — PCMS.OutlookAddin.Functions" #FFF8E1 {
component [DocumentProcessingFunction\n(Service Bus trigger)] as DocFunction
}
' ─────────────────────────────────────────────
' External Systems
' ─────────────────────────────────────────────
package "External Systems" #F5F5F5 {
cloud "PCMS Core API\n(REST)" as PCMSCore
cloud "Microsoft Graph API\n(email / attachments)" as GraphAPI
cloud "Advanced Identity\n(Keycloak JWKS)" as Keycloak
queue "Azure Service Bus\n(addin-save-mail queue)" as ServiceBus
database "Redis Cache" as Redis
database "SQL Database\n(user lookup)" as SQL
cloud "Azure Key Vault\n(secrets)" as KeyVault
}
' ─────────────────────────────────────────────
' Connections
' ─────────────────────────────────────────────
' Client → API
AddIn --> Controllers : HTTPS (JWT)
' API internal
Controllers --> ExMiddleware : exception propagation
Controllers --> Auth : token validation
Controllers --> Validators : request validation
Controllers --> AppServices : delegates to
' API → Application
AppServices --> AppInterfaces : implements
AppServices --> Mappers : maps responses
AppServices --> DomainModels : uses
AppServices --> DomainExceptions : throws
' Application → Infrastructure
AppInterfaces <|.. ExtServices : implements
AppInterfaces <|.. CacheDecorators : implements (decorator)
AppInterfaces <|.. GraphService : implements
AppInterfaces <|.. SBPublisher : implements
AppInterfaces <|.. UserRepo : implements
' Caching
CacheDecorators --> ExtServices : wraps (cache-aside)
CacheDecorators --> RedisService : cache reads/writes
RedisService --> Redis : StackExchange.Redis
' External calls
ExtServices --> PCMSCore : HTTP (OAuth2 bearer)
ExtServices --> TokenProvider : get access token
TokenProvider --> PCMSCore : POST /token
GraphService --> GraphAPI : MSAL + HTTP
GraphService --> Keycloak : JWKS fetch (token validation)
TokenValidator --> Keycloak : JWKS key fetch
UserRepo --> SQL : Dapper queries
SBPublisher --> ServiceBus : publish messages
' Functions
ServiceBus --> DocFunction : Service Bus trigger
DocFunction --> GraphAPI : fetch EML / attachment bytes
DocFunction --> PCMSCore : POST document
' Secrets at startup
KeyVault --> DI : override appsettings at startup
' Exception handling
DomainExceptions --> ExMiddleware : mapped to HTTP responses
@enduml