# wp-daniel/openportal architecture

> Architecture diagram of the GitHub repository wp-daniel/openportal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wp-daniel/openportal
- Repository: https://github.com/wp-daniel/openportal

## Overview

OpenPortal is a modular ASP.NET Core identity and access portal with a React client and an OpenID Connect provider. A user signs in through the portal, then requests or receives application access; the OIDC endpoint evaluates that access and issues tokens to the application. Administrators govern users, groups, organizations, applications, and access reviews. Separate product branches provide notifications, announcements, audit history, and operational statistics. The source excerpts show key sign-in, OIDC, session, and review behavior; several other capabilities and their links are documented in the README but their implementation was not sampled.

Main entry points: [`src/OpenPortal.Web/Program.cs`](https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/Program.cs) (Web host and API), [`src/OpenPortal.Web/Oidc/ConnectController.cs`](https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/Oidc/ConnectController.cs) (OIDC provider), [`src/Modules/Access/OpenPortal.Access.Infrastructure/Persistence/AccessDbContext.cs`](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Persistence/AccessDbContext.cs) (Access records), [`src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentityAuthenticationService.cs`](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentityAuthenticationService.cs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and sessions"]
  node_auth["Authentication"]
  node_sessions["Session management"]
  node_identitydata[("Identity records")]
end

subgraph group_access["Application access"]
  node_oidc["OIDC provider"]
  node_accesscheck["Access evaluation<br/>[AccessEvaluator.cs]"]
  node_requests["Access requests"]
  node_reviews["Access reviews"]
  node_groupsorgs["Groups and organizations<br/>[Organization.cs]"]
  node_registry["Application registry"]
  node_accessdata[("Access records<br/>[AccessDbContext.cs]")]
end

subgraph group_portal["Portal experience"]
  node_web["Web host and API<br/>[Program.cs]"]
  node_spa["React portal<br/>[App.tsx]"]
  node_notifications["Notifications and announcements"]
end

subgraph group_operations["Audit and operations"]
  node_audit["Audit trail<br/>[AuditTrail.cs]"]
  node_statistics["Portal statistics"]
end

node_person(("Portal user"))
node_admin(("Administrator"))
node_externalapp(("Connected application"))

node_person -->|"uses"| node_spa
node_admin -->|"administers"| node_spa
node_spa -->|"calls API"| node_web
node_web -.->|"routes sign-in"| node_auth
node_auth -.->|"reads and writes"| node_identitydata
node_web -.->|"routes sessions"| node_sessions
node_sessions -->|"reads and writes"| node_identitydata
node_externalapp -->|"requests tokens"| node_oidc
node_oidc -->|"authenticates user"| node_auth
node_oidc -->|"checks access"| node_accesscheck
node_accesscheck -.->|"reads grants"| node_accessdata
node_oidc -->|"issues tokens"| node_externalapp
node_person -->|"requests access"| node_requests
node_admin -->|"reviews grants"| node_reviews
node_reviews -->|"updates grants"| node_accessdata
node_groupsorgs -.->|"persists membership"| node_accessdata
node_registry -.->|"persists applications"| node_accessdata
node_web -.->|"serves notices"| node_notifications
node_web -.->|"provides audit context"| node_audit
node_admin -->|"views metrics"| node_statistics

click node_web "https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/Program.cs"
click node_spa "https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/ClientApp/src/App.tsx"
click node_auth "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentityAuthenticationService.cs"
click node_sessions "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentitySessionService.cs"
click node_identitydata "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Identity/OpenPortal.Identity.Infrastructure/Persistence/IdentityDbContext.cs"
click node_oidc "https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/Oidc/ConnectController.cs"
click node_accesscheck "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessEvaluator.cs"
click node_requests "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessRequestService.cs"
click node_reviews "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessReviewService.cs"
click node_groupsorgs "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Domain/Organizations/Organization.cs"
click node_registry "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/ApplicationRegistryService.cs"
click node_accessdata "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Persistence/AccessDbContext.cs"
click node_notifications "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Notifications/OpenPortal.Notifications.Infrastructure/Services/NotificationService.cs"
click node_audit "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Audit/OpenPortal.Audit.Infrastructure/Services/AuditTrail.cs"
click node_statistics "https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessStatisticsService.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth,node_sessions,node_identitydata,node_person toneBlue
class node_oidc,node_accesscheck,node_requests,node_reviews,node_groupsorgs,node_registry,node_accessdata toneAmber
class node_web,node_spa,node_notifications toneMint
class node_audit,node_statistics toneRose
class node_admin,node_externalapp toneIndigo
```

## Components

### Identity and sessions

- [Authentication](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentityAuthenticationService.cs): `src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentityAuthenticationService.cs`
- [Session management](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentitySessionService.cs): `src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentitySessionService.cs`
- [Identity records](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Identity/OpenPortal.Identity.Infrastructure/Persistence/IdentityDbContext.cs): `src/Modules/Identity/OpenPortal.Identity.Infrastructure/Persistence/IdentityDbContext.cs`

### Application access

- [OIDC provider](https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/Oidc/ConnectController.cs): `src/OpenPortal.Web/Oidc/ConnectController.cs`
- [Access evaluation](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessEvaluator.cs): `src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessEvaluator.cs`
- [Access requests](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessRequestService.cs): `src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessRequestService.cs`
- [Access reviews](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessReviewService.cs): `src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessReviewService.cs`
- [Groups and organizations](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Domain/Organizations/Organization.cs): `src/Modules/Access/OpenPortal.Access.Domain/Organizations/Organization.cs`
- [Application registry](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/ApplicationRegistryService.cs): `src/Modules/Access/OpenPortal.Access.Infrastructure/Services/ApplicationRegistryService.cs`
- [Access records](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Persistence/AccessDbContext.cs): `src/Modules/Access/OpenPortal.Access.Infrastructure/Persistence/AccessDbContext.cs`

### Portal experience

- [Web host and API](https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/Program.cs): `src/OpenPortal.Web/Program.cs`
- [React portal](https://github.com/wp-daniel/openportal/blob/main/src/OpenPortal.Web/ClientApp/src/App.tsx): `src/OpenPortal.Web/ClientApp/src/App.tsx`
- [Notifications and announcements](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Notifications/OpenPortal.Notifications.Infrastructure/Services/NotificationService.cs): `src/Modules/Notifications/OpenPortal.Notifications.Infrastructure/Services/NotificationService.cs`

### Audit and operations

- [Audit trail](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Audit/OpenPortal.Audit.Infrastructure/Services/AuditTrail.cs): `src/Modules/Audit/OpenPortal.Audit.Infrastructure/Services/AuditTrail.cs`
- [Portal statistics](https://github.com/wp-daniel/openportal/blob/main/src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessStatisticsService.cs): `src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessStatisticsService.cs`

### Other components

- **Portal user**
- **Administrator**
- **Connected application**

## Connections

- Portal user → React portal: uses (evidence: `README.md`)
- Administrator → React portal: administers (evidence: `README.md`)
- React portal → Web host and API: calls API (evidence: `README.md`)
- Web host and API → Authentication: routes sign-in
- Authentication → Identity records: reads and writes
- Web host and API → Session management: routes sessions
- Session management → Identity records: reads and writes (evidence: `src/Modules/Identity/OpenPortal.Identity.Infrastructure/Services/IdentitySessionService.cs`)
- Connected application → OIDC provider: requests tokens (evidence: `README.md`)
- OIDC provider → Authentication: authenticates user (evidence: `src/OpenPortal.Web/Oidc/ConnectController.cs`)
- OIDC provider → Access evaluation: checks access (evidence: `src/OpenPortal.Web/Oidc/ConnectController.cs`)
- Access evaluation → Access records: reads grants
- OIDC provider → Connected application: issues tokens (evidence: `README.md`)
- Portal user → Access requests: requests access (evidence: `README.md`)
- Administrator → Access reviews: reviews grants (evidence: `README.md`)
- Access reviews → Access records: updates grants (evidence: `src/Modules/Access/OpenPortal.Access.Infrastructure/Services/AccessReviewService.cs`)
- Groups and organizations → Access records: persists membership (evidence: `src/Modules/Access/OpenPortal.Access.Infrastructure/Persistence/AccessDbContext.cs`)
- Application registry → Access records: persists applications
- Web host and API → Notifications and announcements: serves notices
- Web host and API → Audit trail: provides audit context
- Administrator → Portal statistics: views metrics (evidence: `README.md`)
