# swarnayuroy/jwt-authentication-poc architecture

> Architecture diagram of the GitHub repository swarnayuroy/jwt-authentication-poc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/swarnayuroy/jwt-authentication-poc
- Repository: https://github.com/swarnayuroy/jwt-authentication-poc

## Overview

SampleAuthentication is a hybrid authentication and user-management product: an Angular client and an ASP.NET MVC client use an ASP.NET Core API, with a shared DataContext described as in-memory storage. The main workflow is credential submission, API authentication or account registration, then user-facing session/dashboard operations; account verification and password recovery are additional API capabilities. The graph also shows the API’s repository/service/data layers. Several implementation files were not sampled, so unverified internal links are omitted or marked dashed.

Main entry points: [`SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs`](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs) (Account repository), [`SampleAuthentication/API_Service/Controllers/AccountController.cs`](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Controllers/AccountController.cs) (Account endpoints), [`SampleAuthentication/API_Service/Program.cs`](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Program.cs) (API composition), [`SampleAuthentication/API_Service/RepositoryLayer/Repository/UserRepository.cs`](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/RepositoryLayer/Repository/UserRepository.cs) (User repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_angular["Angular client<br/>[auth.service.ts]"]
  node_mvc["MVC web client"]
  node_webrepo["Web repository<br/>[WebRepository.cs]"]
  node_httpdata["HTTP data service<br/>[HttpDataService.cs]"]
end

subgraph group_api["Authentication API"]
  node_accountapi["Account endpoints"]
  node_userapi["User endpoints<br/>[UserController.cs]"]
  node_accountrepo["Account repository"]
  node_userrepo["User repository<br/>[UserRepository.cs]"]
  node_dataservice["Data service"]
  node_authrecords["Authentication records<br/>[User.cs]"]
end

subgraph group_data["Data access"]
  node_datacontext[("Shared data context<br/>[IContextService.cs]")]
end

subgraph group_shared["Shared infrastructure"]
  node_jwt["JWT handling<br/>[JwtManager.cs]"]
  node_handoff["Login handoff<br/>[HandoffManager.cs]"]
  node_startup["API composition<br/>[Program.cs]"]
end

node_person(("User"))

node_person -->|"uses"| node_angular
node_person -->|"uses"| node_mvc
node_angular -->|"posts credentials"| node_accountapi
node_mvc -->|"submits requests"| node_webrepo
node_webrepo -->|"calls HTTP service"| node_httpdata
node_httpdata -.->|"HTTP/REST"| node_accountapi
node_accountapi -->|"delegates"| node_accountrepo
node_userapi -->|"delegates"| node_userrepo
node_accountrepo -.->|"handles account data"| node_authrecords
node_accountrepo -.->|"uses data service"| node_dataservice
node_userrepo -.->|"uses data service"| node_dataservice
node_dataservice -->|"accesses data"| node_datacontext
node_accountapi -.->|"issues tokens"| node_jwt
node_accountrepo -->|"consumes handoff"| node_handoff
node_startup -->|"registers dependency"| node_accountrepo
node_startup -->|"registers dependency"| node_userrepo
node_startup -->|"maps controllers"| node_accountapi

click node_angular "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/angular-web/src/app/service/auth.service.ts"
click node_mvc "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/web/Controllers/AccountController.cs"
click node_webrepo "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/web/Repository/WebRepository.cs"
click node_httpdata "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/web/Service/DataLayer/HttpDataService.cs"
click node_accountapi "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Controllers/AccountController.cs"
click node_userapi "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Controllers/UserController.cs"
click node_accountrepo "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs"
click node_userrepo "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/RepositoryLayer/Repository/UserRepository.cs"
click node_dataservice "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/AppData/DataService/SampleDataService.cs"
click node_authrecords "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Models/Entities/User.cs"
click node_jwt "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Utils/JwtManager.cs"
click node_handoff "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Utils/HandoffManager.cs"
click node_datacontext "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/DataContext/DataService/IContextService.cs"
click node_startup "https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Program.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_angular,node_mvc,node_webrepo,node_httpdata,node_person toneBlue
class node_accountapi,node_userapi,node_accountrepo,node_userrepo,node_dataservice,node_authrecords toneAmber
class node_datacontext toneMint
class node_jwt,node_handoff,node_startup toneRose
```

## Components

### User clients

- [Angular client](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/angular-web/src/app/service/auth.service.ts): `SampleAuthentication/angular-web/src/app/service/auth.service.ts`
- [MVC web client](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/web/Controllers/AccountController.cs): `SampleAuthentication/web/Controllers/AccountController.cs`
- [Web repository](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/web/Repository/WebRepository.cs): `SampleAuthentication/web/Repository/WebRepository.cs`
- [HTTP data service](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/web/Service/DataLayer/HttpDataService.cs): `SampleAuthentication/web/Service/DataLayer/HttpDataService.cs`

### Authentication API

- [Account endpoints](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Controllers/AccountController.cs): `SampleAuthentication/API_Service/Controllers/AccountController.cs`
- [User endpoints](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Controllers/UserController.cs): `SampleAuthentication/API_Service/Controllers/UserController.cs`
- [Account repository](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs): `SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs`
- [User repository](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/RepositoryLayer/Repository/UserRepository.cs): `SampleAuthentication/API_Service/RepositoryLayer/Repository/UserRepository.cs`
- [Data service](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/AppData/DataService/SampleDataService.cs): `SampleAuthentication/API_Service/AppData/DataService/SampleDataService.cs`
- [Authentication records](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Models/Entities/User.cs): `SampleAuthentication/API_Service/Models/Entities/User.cs`

### Data access

- [Shared data context](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/DataContext/DataService/IContextService.cs): `SampleAuthentication/DataContext/DataService/IContextService.cs`

### Shared infrastructure

- [JWT handling](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Utils/JwtManager.cs): `SampleAuthentication/API_Service/Utils/JwtManager.cs`
- [Login handoff](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Utils/HandoffManager.cs): `SampleAuthentication/API_Service/Utils/HandoffManager.cs`
- [API composition](https://github.com/swarnayuroy/jwt-authentication-poc/blob/main/SampleAuthentication/API_Service/Program.cs): `SampleAuthentication/API_Service/Program.cs`

### Other components

- **User**

## Connections

- User → Angular client: uses
- User → MVC web client: uses
- Angular client → Account endpoints: posts credentials (evidence: `SampleAuthentication/angular-web/src/app/service/auth.service.ts`)
- MVC web client → Web repository: submits requests (evidence: `SampleAuthentication/web/Controllers/AccountController.cs`)
- Web repository → HTTP data service: calls HTTP service (evidence: `SampleAuthentication/web/Repository/WebRepository.cs`)
- HTTP data service → Account endpoints: HTTP/REST
- Account endpoints → Account repository: delegates (evidence: `SampleAuthentication/API_Service/Controllers/AccountController.cs`)
- User endpoints → User repository: delegates (evidence: `SampleAuthentication/API_Service/Controllers/UserController.cs`)
- Account repository → Authentication records: handles account data
- Account repository → Data service: uses data service
- User repository → Data service: uses data service
- Data service → Shared data context: accesses data (evidence: `SampleAuthentication/API_Service/AppData/DataService/SampleDataService.cs`)
- Account endpoints → JWT handling: issues tokens
- Account repository → Login handoff: consumes handoff (evidence: `SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs`)
- API composition → Account repository: registers dependency (evidence: `SampleAuthentication/API_Service/Program.cs`)
- API composition → User repository: registers dependency (evidence: `SampleAuthentication/API_Service/Program.cs`)
- API composition → Account endpoints: maps controllers (evidence: `SampleAuthentication/API_Service/Program.cs`)
