# rpedrolm/minipki architecture

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

- Interactive diagram: https://gitdiagram.com/rpedrolm/minipki
- Repository: https://github.com/rpedrolm/minipki

## Overview

MiniPKI is an ASP.NET MVC application for managing certificate authorities and user digital certificates. Users sign in, then the panel supports certificate listing and administration; controller actions create certificates, persist certificate metadata, and save downloadable PFX files. The source excerpt confirms session-based access checks, SQL operations, and certificate-generator calls. The README also mentions certificate-file administration and CRUD improvements, but provides no further implementation detail; view wiring and unsampled subsystems are therefore not asserted as confirmed flows.

Main entry points: [`Controllers/PanelController.cs`](https://github.com/rpedrolm/minipki/blob/main/Controllers/PanelController.cs) (Panel actions), [`Program.cs`](https://github.com/rpedrolm/minipki/blob/main/Program.cs) (MVC routing), [`Controllers/LoginController.cs`](https://github.com/rpedrolm/minipki/blob/main/Controllers/LoginController.cs) (Login actions), [`Controllers/HomeController.cs`](https://github.com/rpedrolm/minipki/blob/main/Controllers/HomeController.cs) (Home actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and views"]
  node_app["MVC routing<br/>[Program.cs]"]
  node_home["Home actions<br/>[HomeController.cs]"]
  node_homeviews["Home views"]
end

subgraph group_access["Access and sessions"]
  node_login["Login actions<br/>[LoginController.cs]"]
  node_loginview["Login view<br/>[Index.cshtml]"]
  node_session["Session state<br/>[Program.cs]"]
end

subgraph group_certs["Certificate workflows"]
  node_panel["Panel actions<br/>[PanelController.cs]"]
  node_panelviews["Panel views"]
  node_certgen["X509 generator"]
end

subgraph group_infra["Persistence and files"]
  node_sql[("SQL database")]
  node_pfx[("PFX repository")]
end

node_user(("User"))

node_user -->|"sends requests"| node_app
node_app -->|"routes actions"| node_home
node_app -->|"routes actions"| node_login
node_app -->|"routes actions"| node_panel
node_home -.->|"returns views"| node_homeviews
node_login -.->|"returns view"| node_loginview
node_panel -.->|"returns views"| node_panelviews
node_login -->|"writes session"| node_session
node_panel -->|"reads session"| node_session
node_login -->|"queries users"| node_sql
node_panel -->|"reads and updates"| node_sql
node_panel -->|"generates certificates"| node_certgen
node_panel -->|"writes and downloads"| node_pfx
node_certgen -->|"writes PFX"| node_pfx

click node_app "https://github.com/rpedrolm/minipki/blob/main/Program.cs"
click node_home "https://github.com/rpedrolm/minipki/blob/main/Controllers/HomeController.cs"
click node_homeviews "https://github.com/rpedrolm/minipki/tree/main/Views/Home"
click node_login "https://github.com/rpedrolm/minipki/blob/main/Controllers/LoginController.cs"
click node_loginview "https://github.com/rpedrolm/minipki/blob/main/Views/Login/Index.cshtml"
click node_session "https://github.com/rpedrolm/minipki/blob/main/Program.cs"
click node_panel "https://github.com/rpedrolm/minipki/blob/main/Controllers/PanelController.cs"
click node_panelviews "https://github.com/rpedrolm/minipki/tree/main/Views/Panel"
click node_pfx "https://github.com/rpedrolm/minipki/tree/main/Repositor"

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_app,node_home,node_homeviews,node_user toneBlue
class node_login,node_loginview,node_session toneAmber
class node_panel,node_panelviews,node_certgen toneMint
class node_sql,node_pfx toneRose
```

## Components

### Web entry and views

- [MVC routing](https://github.com/rpedrolm/minipki/blob/main/Program.cs): `Program.cs`
- [Home actions](https://github.com/rpedrolm/minipki/blob/main/Controllers/HomeController.cs): `Controllers/HomeController.cs`
- [Home views](https://github.com/rpedrolm/minipki/tree/main/Views/Home): `Views/Home`

### Access and sessions

- [Login actions](https://github.com/rpedrolm/minipki/blob/main/Controllers/LoginController.cs): `Controllers/LoginController.cs`
- [Login view](https://github.com/rpedrolm/minipki/blob/main/Views/Login/Index.cshtml): `Views/Login/Index.cshtml`
- [Session state](https://github.com/rpedrolm/minipki/blob/main/Program.cs): `Program.cs`

### Certificate workflows

- [Panel actions](https://github.com/rpedrolm/minipki/blob/main/Controllers/PanelController.cs): `Controllers/PanelController.cs`
- [Panel views](https://github.com/rpedrolm/minipki/tree/main/Views/Panel): `Views/Panel`
- **X509 generator**

### Persistence and files

- **SQL database**
- [PFX repository](https://github.com/rpedrolm/minipki/tree/main/Repositor): `Repositor`

### Other components

- **User**

## Connections

- User → MVC routing: sends requests (evidence: `Program.cs`)
- MVC routing → Home actions: routes actions (evidence: `Program.cs`)
- MVC routing → Login actions: routes actions (evidence: `Program.cs`)
- MVC routing → Panel actions: routes actions (evidence: `Program.cs`)
- Home actions → Home views: returns views
- Login actions → Login view: returns view
- Panel actions → Panel views: returns views
- Login actions → Session state: writes session (evidence: `Controllers/LoginController.cs`)
- Panel actions → Session state: reads session (evidence: `Controllers/PanelController.cs`)
- Login actions → SQL database: queries users (evidence: `Controllers/LoginController.cs`)
- Panel actions → SQL database: reads and updates (evidence: `Controllers/PanelController.cs`)
- Panel actions → X509 generator: generates certificates (evidence: `Controllers/PanelController.cs`)
- Panel actions → PFX repository: writes and downloads (evidence: `Controllers/PanelController.cs`)
- X509 generator → PFX repository: writes PFX
