# jfdomitor/intwenty architecture

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

- Interactive diagram: https://gitdiagram.com/jfdomitor/intwenty
- Repository: https://github.com/jfdomitor/intwenty

## Overview

Intwenty is a .NET web application framework for defining views and data in JSON, rendering lightweight applications, and performing generic entity operations without application-specific typed models. The principal flow is a user request, authorization and model lookup, view rendering or dynamic entity CRUD, and database access. Its separate identity-management domain handles accounts, MFA, organizations, products, and permissions. The README also highlights the barea.js SPA support and multiple database backends. The sampled sources support the model, controller, identity, and authentication links shown; unsampled feature wiring is left out.

Main entry points: [`Intwenty/Areas/Identity/Data/IntwentyUserManager.cs`](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentyUserManager.cs) (User and permissions), [`Intwenty/Controllers/ApplicationController.cs`](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Controllers/ApplicationController.cs) (Application controller), [`Intwenty/Areas/Identity/Data/IntwentySignInManager.cs`](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentySignInManager.cs) (Sign-in manager), [`Intwenty/Areas/Identity/Pages/Account`](https://github.com/jfdomitor/intwenty/tree/master/Intwenty/Areas/Identity/Pages/Account) (Account and MFA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Dynamic app runtime"]
  node_model["JSON app model<br/>[IntwentyModel.cs]"]
  node_modelservice["Model service"]
  node_application["Application controller"]
  node_api["API controller<br/>[APIController.cs]"]
  node_clientjs["barea.js client<br/>[intwenty.js]"]
end

subgraph group_identity["Identity and access"]
  node_accountpages["Account and MFA"]
  node_iampages["IAM management"]
  node_signin["Sign-in manager"]
  node_usermanager["User and permissions"]
  node_orgmanager["Organization manager"]
  node_userstore["Identity user store"]
end

subgraph group_platform["Platform services"]
  node_localization["Localization"]
  node_events["Event and DB logging<br/>[EventService.cs]"]
end

subgraph group_integrations["External integrations"]
  node_bankid["BankID client<br/>[BankIDService.cs]"]
  node_freja["Freja client"]
end

node_user(("User"))
node_database[("Configured database")]
node_iamdb[("IAM database")]
node_identityprovider{{"Identity provider"}}
node_bankidservice{{"BankID service"}}
node_frejaservice{{"Freja service"}}

node_user -->|"uses SPA"| node_clientjs
node_clientjs -->|"sends requests"| node_api
node_user -->|"requests view"| node_application
node_application -->|"checks access"| node_usermanager
node_application -->|"resolves view"| node_modelservice
node_modelservice -->|"reads model"| node_model
node_application -->|"reads and writes entities"| node_database
node_api -->|"uses model service"| node_modelservice
node_accountpages -->|"authenticates"| node_signin
node_accountpages -->|"manages account"| node_usermanager
node_iampages -->|"manages users"| node_usermanager
node_iampages -->|"manages organizations"| node_orgmanager
node_signin -->|"checks user"| node_usermanager
node_usermanager -->|"uses store"| node_userstore
node_usermanager -->|"reads and writes IAM"| node_iamdb
node_orgmanager -->|"reads and writes IAM"| node_iamdb
node_user -->|"receives localized content"| node_localization
node_bankid -.->|"calls"| node_bankidservice
node_freja -.->|"calls"| node_frejaservice
node_signin -.->|"supports authentication"| node_bankid
node_signin -.->|"supports authentication"| node_freja
node_accountpages -.->|"external login"| node_identityprovider

click node_model "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Model/IntwentyModel.cs"
click node_modelservice "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/IntwentyModelService.cs"
click node_application "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Controllers/ApplicationController.cs"
click node_api "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Controllers/APIController.cs"
click node_clientjs "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/wwwroot/js/intwenty.js"
click node_accountpages "https://github.com/jfdomitor/intwenty/tree/master/Intwenty/Areas/Identity/Pages/Account"
click node_iampages "https://github.com/jfdomitor/intwenty/tree/master/Intwenty/Areas/Identity/Pages/IAM"
click node_signin "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentySignInManager.cs"
click node_usermanager "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentyUserManager.cs"
click node_orgmanager "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentyOrganizationManager.cs"
click node_userstore "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentyUserStore.cs"
click node_localization "https://github.com/jfdomitor/intwenty/tree/master/Intwenty/Localization"
click node_events "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Services/EventService.cs"
click node_bankid "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Services/BankIDService.cs"
click node_freja "https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Services/FrejaClientService.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_model,node_modelservice,node_application,node_api,node_clientjs,node_user toneBlue
class node_accountpages,node_iampages,node_signin,node_usermanager,node_orgmanager,node_userstore,node_database,node_iamdb toneAmber
class node_localization,node_events toneMint
class node_bankid,node_freja toneRose
class node_identityprovider,node_bankidservice,node_frejaservice toneIndigo
```

## Components

### Dynamic app runtime

- [JSON app model](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Model/IntwentyModel.cs): `Intwenty/Model/IntwentyModel.cs`
- [Model service](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/IntwentyModelService.cs): `Intwenty/IntwentyModelService.cs`
- [Application controller](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Controllers/ApplicationController.cs): `Intwenty/Controllers/ApplicationController.cs`
- [API controller](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Controllers/APIController.cs): `Intwenty/Controllers/APIController.cs`
- [barea.js client](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/wwwroot/js/intwenty.js): `Intwenty/wwwroot/js/intwenty.js`

### Identity and access

- [Account and MFA](https://github.com/jfdomitor/intwenty/tree/master/Intwenty/Areas/Identity/Pages/Account): `Intwenty/Areas/Identity/Pages/Account`
- [IAM management](https://github.com/jfdomitor/intwenty/tree/master/Intwenty/Areas/Identity/Pages/IAM): `Intwenty/Areas/Identity/Pages/IAM`
- [Sign-in manager](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentySignInManager.cs): `Intwenty/Areas/Identity/Data/IntwentySignInManager.cs`
- [User and permissions](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentyUserManager.cs): `Intwenty/Areas/Identity/Data/IntwentyUserManager.cs`
- [Organization manager](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentyOrganizationManager.cs): `Intwenty/Areas/Identity/Data/IntwentyOrganizationManager.cs`
- [Identity user store](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Areas/Identity/Data/IntwentyUserStore.cs): `Intwenty/Areas/Identity/Data/IntwentyUserStore.cs`

### Platform services

- [Localization](https://github.com/jfdomitor/intwenty/tree/master/Intwenty/Localization): `Intwenty/Localization`
- [Event and DB logging](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Services/EventService.cs): `Intwenty/Services/EventService.cs`

### External integrations

- [BankID client](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Services/BankIDService.cs): `Intwenty/Services/BankIDService.cs`
- [Freja client](https://github.com/jfdomitor/intwenty/blob/master/Intwenty/Services/FrejaClientService.cs): `Intwenty/Services/FrejaClientService.cs`

### Other components

- **User**
- **Configured database**
- **IAM database**
- **Identity provider**
- **BankID service**
- **Freja service**

## Connections

- User → barea.js client: uses SPA
- barea.js client → API controller: sends requests
- User → Application controller: requests view
- Application controller → User and permissions: checks access
- Application controller → Model service: resolves view
- Model service → JSON app model: reads model
- Application controller → Configured database: reads and writes entities
- API controller → Model service: uses model service
- Account and MFA → Sign-in manager: authenticates
- Account and MFA → User and permissions: manages account
- IAM management → User and permissions: manages users
- IAM management → Organization manager: manages organizations
- Sign-in manager → User and permissions: checks user
- User and permissions → Identity user store: uses store
- User and permissions → IAM database: reads and writes IAM
- Organization manager → IAM database: reads and writes IAM
- User → Localization: receives localized content
- BankID client → BankID service: calls
- Freja client → Freja service: calls
- Sign-in manager → BankID client: supports authentication
- Sign-in manager → Freja client: supports authentication
- Account and MFA → Identity provider: external login
