# ki-repos/ingrion architecture

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

- Interactive diagram: https://gitdiagram.com/ki-repos/ingrion
- Repository: https://github.com/ki-repos/ingrion

## Overview

INGRION is a four-part capital-markets and identity ecosystem: a government archive handles citizen identity and KYC approval; the web portal bridges approved KYC to secure desktop downloads; the desktop app exposes user, company, regulator, and validator workflows; and the Go core provides the blockchain. The README documents the cross-project journey and core capabilities, while sampled source confirms frontend routing and selected API calls. Backend endpoint internals and most desktop page behavior were not sampled, so those links are omitted or marked unverified.

Main entry points: [`Ingrion_exe/src/App.tsx`](https://github.com/ki-repos/ingrion/blob/main/Ingrion_exe/src/App.tsx) (Role-based app router), [`Ingrion_core/main.go`](https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go) (Blockchain node), [`National_Identity_Archive/frontend/src`](https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/frontend/src) (Citizen and admin portal), [`Ingrion_Web/frontend/src/pages`](https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/frontend/src/pages) (Portal pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_archive["Identity archive"]
  node_archive_ui["Citizen and admin portal"]
  node_archive_auth["Authentication"]
  node_archive_kyc["Identity KYC"]
  node_archive_records[("Archive records")]
end

subgraph group_portal["Web portal"]
  node_portal_ui["Portal pages"]
  node_portal_kyc["KYC bridge"]
  node_portal_download["Download tokens"]
  node_portal_content["Whitepaper and API docs"]
end

subgraph group_core["Blockchain core"]
  node_chain["Blockchain node<br/>[main.go]"]
  node_consensus["DPoS consensus<br/>[main.go]"]
  node_network["P2P networking<br/>[main.go]"]
  node_ledger[("On-chain state<br/>[main.go]")]
end

subgraph group_desktop["Desktop application"]
  node_desktop_router["Role-based app router<br/>[App.tsx]"]
  node_desktop_setup["Node and identity setup"]
  node_desktop_market["User market workflows"]
  node_desktop_company["Issuer workflows"]
  node_desktop_regulator["Regulatory oversight"]
  node_desktop_validator["Validator operations"]
  node_desktop_storage[("Local data and keys")]
  node_desktop_sync["Node synchronization<br/>[sync.ts]"]
end

node_citizen(("Citizen"))
node_government(("Government admin"))
node_market(("Market participants"))

node_citizen -->|"registers identity"| node_archive_ui
node_government -->|"reviews KYC"| node_archive_ui
node_archive_ui -.->|"authenticates"| node_archive_auth
node_archive_ui -.->|"submits documents"| node_archive_kyc
node_archive_ui -.->|"manages archive links"| node_archive_records
node_archive_kyc -.->|"uses identity records"| node_archive_records
node_archive_ui -->|"routes protected pages"| node_archive_ui
node_citizen -->|"requests verification"| node_portal_ui
node_portal_ui -->|"submits KYC"| node_portal_kyc
node_portal_ui -->|"validates token"| node_portal_download
node_portal_ui -->|"requests whitepaper"| node_portal_content
node_portal_kyc -.->|"checks archive link"| node_archive_records
node_portal_kyc -.->|"publishes KYC approval"| node_chain
node_portal_ui -->|"provides download"| node_desktop_setup
node_market -->|"uses app"| node_desktop_router
node_desktop_router -->|"routes setup"| node_desktop_setup
node_desktop_router -->|"routes market"| node_desktop_market
node_desktop_router -->|"routes issuer tools"| node_desktop_company
node_desktop_router -->|"routes oversight"| node_desktop_regulator
node_desktop_router -->|"routes validator tools"| node_desktop_validator
node_desktop_router -->|"loads keystore and notifications"| node_desktop_storage
node_desktop_router -->|"starts sync"| node_desktop_sync
node_desktop_router -->|"queries node status"| node_chain
node_desktop_market -.->|"submits transactions"| node_chain
node_desktop_company -.->|"submits transactions"| node_chain
node_desktop_regulator -.->|"validates blocks"| node_chain
node_desktop_validator -.->|"validates blocks"| node_chain
node_chain -.->|"runs DPoS"| node_consensus
node_chain -.->|"connects peers"| node_network
node_chain -->|"stores financial state"| node_ledger

click node_archive_ui "https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/frontend/src"
click node_archive_auth "https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/backend/gov_project/apps/accounts"
click node_archive_kyc "https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/backend/gov_project/apps/kyc"
click node_archive_records "https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/backend/gov_project/apps/archive"
click node_portal_ui "https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/frontend/src/pages"
click node_portal_kyc "https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/backend/ingrion_project/apps/kyc"
click node_portal_download "https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/backend/ingrion_project/apps/downloads"
click node_portal_content "https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/backend/ingrion_project/apps/whitepaper"
click node_chain "https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go"
click node_consensus "https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go"
click node_network "https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go"
click node_ledger "https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go"
click node_desktop_router "https://github.com/ki-repos/ingrion/blob/main/Ingrion_exe/src/App.tsx"
click node_desktop_setup "https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/setup"
click node_desktop_market "https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/user"
click node_desktop_company "https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/company"
click node_desktop_regulator "https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/regulator"
click node_desktop_validator "https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/validator"
click node_desktop_storage "https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/lib"
click node_desktop_sync "https://github.com/ki-repos/ingrion/blob/main/Ingrion_exe/src/lib/sync.ts"

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_archive_ui,node_archive_auth,node_archive_kyc,node_archive_records toneBlue
class node_portal_ui,node_portal_kyc,node_portal_download,node_portal_content toneAmber
class node_chain,node_consensus,node_network,node_ledger toneMint
class node_desktop_router,node_desktop_setup,node_desktop_market,node_desktop_company,node_desktop_regulator,node_desktop_validator,node_desktop_storage,node_desktop_sync toneRose
class node_citizen,node_government,node_market toneIndigo
```

## Components

### Identity archive

- [Citizen and admin portal](https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/frontend/src): `National_Identity_Archive/frontend/src`
- [Authentication](https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/backend/gov_project/apps/accounts): `National_Identity_Archive/backend/gov_project/apps/accounts`
- [Identity KYC](https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/backend/gov_project/apps/kyc): `National_Identity_Archive/backend/gov_project/apps/kyc`
- [Archive records](https://github.com/ki-repos/ingrion/tree/main/National_Identity_Archive/backend/gov_project/apps/archive): `National_Identity_Archive/backend/gov_project/apps/archive`

### Web portal

- [Portal pages](https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/frontend/src/pages): `Ingrion_Web/frontend/src/pages`
- [KYC bridge](https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/backend/ingrion_project/apps/kyc): `Ingrion_Web/backend/ingrion_project/apps/kyc`
- [Download tokens](https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/backend/ingrion_project/apps/downloads): `Ingrion_Web/backend/ingrion_project/apps/downloads`
- [Whitepaper and API docs](https://github.com/ki-repos/ingrion/tree/main/Ingrion_Web/backend/ingrion_project/apps/whitepaper): `Ingrion_Web/backend/ingrion_project/apps/whitepaper`

### Blockchain core

- [Blockchain node](https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go): `Ingrion_core/main.go`
- [DPoS consensus](https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go): `Ingrion_core/main.go`
- [P2P networking](https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go): `Ingrion_core/main.go`
- [On-chain state](https://github.com/ki-repos/ingrion/blob/main/Ingrion_core/main.go): `Ingrion_core/main.go`

### Desktop application

- [Role-based app router](https://github.com/ki-repos/ingrion/blob/main/Ingrion_exe/src/App.tsx): `Ingrion_exe/src/App.tsx`
- [Node and identity setup](https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/setup): `Ingrion_exe/src/pages/setup`
- [User market workflows](https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/user): `Ingrion_exe/src/pages/user`
- [Issuer workflows](https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/company): `Ingrion_exe/src/pages/company`
- [Regulatory oversight](https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/regulator): `Ingrion_exe/src/pages/regulator`
- [Validator operations](https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/pages/validator): `Ingrion_exe/src/pages/validator`
- [Local data and keys](https://github.com/ki-repos/ingrion/tree/main/Ingrion_exe/src/lib): `Ingrion_exe/src/lib`
- [Node synchronization](https://github.com/ki-repos/ingrion/blob/main/Ingrion_exe/src/lib/sync.ts): `Ingrion_exe/src/lib/sync.ts`

### Other components

- **Citizen**
- **Government admin**
- **Market participants**

## Connections

- Citizen → Citizen and admin portal: registers identity
- Government admin → Citizen and admin portal: reviews KYC
- Citizen and admin portal → Authentication: authenticates
- Citizen and admin portal → Identity KYC: submits documents
- Citizen and admin portal → Archive records: manages archive links
- Identity KYC → Archive records: uses identity records
- Citizen and admin portal → Citizen and admin portal: routes protected pages (evidence: `National_Identity_Archive/frontend/src/App.jsx`)
- Citizen → Portal pages: requests verification
- Portal pages → KYC bridge: submits KYC (evidence: `Ingrion_Web/frontend/src/pages/KYCPage.jsx`)
- Portal pages → Download tokens: validates token (evidence: `Ingrion_Web/frontend/src/pages/DownloadPage.jsx`)
- Portal pages → Whitepaper and API docs: requests whitepaper (evidence: `Ingrion_Web/frontend/src/pages/WhitepaperPage.jsx`)
- KYC bridge → Archive records: checks archive link
- KYC bridge → Blockchain node: publishes KYC approval
- Portal pages → Node and identity setup: provides download
- Market participants → Role-based app router: uses app
- Role-based app router → Node and identity setup: routes setup (evidence: `Ingrion_exe/src/App.tsx`)
- Role-based app router → User market workflows: routes market (evidence: `Ingrion_exe/src/App.tsx`)
- Role-based app router → Issuer workflows: routes issuer tools (evidence: `Ingrion_exe/src/App.tsx`)
- Role-based app router → Regulatory oversight: routes oversight (evidence: `Ingrion_exe/src/App.tsx`)
- Role-based app router → Validator operations: routes validator tools (evidence: `Ingrion_exe/src/App.tsx`)
- Role-based app router → Local data and keys: loads keystore and notifications (evidence: `Ingrion_exe/src/App.tsx`)
- Role-based app router → Node synchronization: starts sync (evidence: `Ingrion_exe/src/App.tsx`)
- Role-based app router → Blockchain node: queries node status (evidence: `Ingrion_exe/src/App.tsx`)
- User market workflows → Blockchain node: submits transactions
- Issuer workflows → Blockchain node: submits transactions
- Regulatory oversight → Blockchain node: validates blocks
- Validator operations → Blockchain node: validates blocks
- Blockchain node → DPoS consensus: runs DPoS (evidence: `Ingrion_core/main.go`)
- Blockchain node → P2P networking: connects peers (evidence: `Ingrion_core/main.go`)
- Blockchain node → On-chain state: stores financial state (evidence: `Ingrion_core/main.go`)
