# nilsteampassnet/teampass architecture

> Architecture diagram of the GitHub repository nilsteampassnet/teampass, 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/nilsteampassnet/teampass
- Repository: https://github.com/nilsteampassnet/teampass

## Overview

TeamPass is a self-hosted team password vault. The central workflow is user authentication, folder/role-based access to encrypted credential items, and auditability of access; its broader product includes Secure Send, integrations, compliance features, and live collaboration. The graph combines README-described capabilities with source-index references and excerpts. Several feature branches are represented at their exact source paths, but their internal call chains are not inferred where implementation excerpts were unavailable.

Main entry points: [`app/api/index.php`](https://github.com/nilsteampassnet/teampass/blob/master/app/api/index.php) (API entry), [`app/api/Controller/Api/ItemController.php`](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Controller/Api/ItemController.php) (Item API), [`app/api/Model/FolderAccessModel.php`](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/FolderAccessModel.php) (Folder access), [`app/sources/secure_send_logic.php`](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/secure_send_logic.php) (Secure Send)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vault["Vault and Access"]
  node_api["API entry<br/>[index.php]"]
  node_folders["Folder access"]
  node_folderapi["Folder API"]
  node_itemsapi["Item API<br/>[ItemController.php]"]
  node_items["Credential items<br/>[ItemModel.php]"]
  node_itemqueries["Item persistence<br/>[items.queries.php]"]
  node_search["Credential search"]
end

subgraph group_security["Identity and Security"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_authmodel["Auth model<br/>[AuthModel.php]"]
  node_crypto["Encryption manager<br/>[CryptoManager.php]"]
  node_rsa["RSA primitives<br/>[RSA.php]"]
  node_ldap["LDAP and AD<br/>[ldap.functions.php]"]
  node_oauth["OAuth2 identity"]
  node_webauthn["WebAuthn<br/>[WebauthnModel.php]"]
end

subgraph group_sharing["Sharing and Collaboration"]
  node_secure["Secure Send"]
  node_securestore["Secure Send storage"]
  node_websocket["Live collaboration<br/>[MessageHandler.php]"]
  node_connections["Connection manager"]
  node_email["Email delivery<br/>[EmailService.php]"]
end

subgraph group_operations["Governance and Operations"]
  node_audit["Audit trail<br/>[items.logs.php]"]
  node_reviews["Access reviews"]
  node_reports["Compliance reports"]
  node_classification["Data classification"]
  node_config["Configuration<br/>[ConfigManager.php]"]
  node_database[("MySQL database")]
end

node_user(("Vault user"))

node_user -.->|"uses vault API"| node_api
node_api -->|"dispatches to"| node_auth
node_api -->|"loads"| node_authmodel
node_api -->|"dispatches to"| node_folderapi
node_api -->|"loads"| node_folders
node_api -.->|"dispatches to"| node_itemsapi
node_folderapi -->|"uses access rules"| node_folders
node_itemsapi -->|"checks access"| node_folders
node_itemsapi -->|"uses item model"| node_items
node_items -.->|"persists items"| node_itemqueries
node_itemsapi -.->|"encrypts secrets"| node_crypto
node_crypto -->|"uses RSA"| node_rsa
node_itemsapi -.->|"records access"| node_audit
node_user -.->|"searches credentials"| node_search
node_user -.->|"shares a secret"| node_secure
node_secure -.->|"uses storage"| node_securestore
node_user -.->|"authenticates via"| node_ldap
node_user -.->|"signs in via"| node_oauth
node_user -.->|"uses MFA"| node_webauthn
node_user -.->|"takes part in reviews"| node_reviews
node_user -.->|"exports evidence"| node_reports
node_user -.->|"classifies data"| node_classification
node_websocket -->|"manages connections"| node_connections
node_secure -.->|"notifies recipients"| node_email
node_config -->|"reads settings"| node_database
node_folders -->|"queries folder tree"| node_database

click node_api "https://github.com/nilsteampassnet/teampass/blob/master/app/api/index.php"
click node_auth "https://github.com/nilsteampassnet/teampass/blob/master/app/api/Controller/Api/AuthController.php"
click node_authmodel "https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/AuthModel.php"
click node_folders "https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/FolderAccessModel.php"
click node_folderapi "https://github.com/nilsteampassnet/teampass/blob/master/app/api/Controller/Api/FolderController.php"
click node_itemsapi "https://github.com/nilsteampassnet/teampass/blob/master/app/api/Controller/Api/ItemController.php"
click node_items "https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/ItemModel.php"
click node_itemqueries "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/items.queries.php"
click node_crypto "https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/cryptomanager/src/CryptoManager.php"
click node_rsa "https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/phpseclibV1/Crypt/RSA.php"
click node_audit "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/items.logs.php"
click node_search "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/search.functions.php"
click node_secure "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/secure_send_logic.php"
click node_securestore "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/secure_send_storage.php"
click node_ldap "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/ldap.functions.php"
click node_oauth "https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/oauth2controller/src/OAuth2Controller.php"
click node_webauthn "https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/WebauthnModel.php"
click node_reviews "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/reviews.functions.php"
click node_reports "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/reports.functions.php"
click node_classification "https://github.com/nilsteampassnet/teampass/blob/master/app/sources/classification.functions.php"
click node_websocket "https://github.com/nilsteampassnet/teampass/blob/master/app/websocket/src/MessageHandler.php"
click node_connections "https://github.com/nilsteampassnet/teampass/blob/master/app/websocket/src/ConnectionManager.php"
click node_email "https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/emailservice/src/EmailService.php"
click node_config "https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/configmanager/src/ConfigManager.php"

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_api,node_folders,node_folderapi,node_itemsapi,node_items,node_itemqueries,node_search,node_user toneBlue
class node_auth,node_authmodel,node_crypto,node_rsa,node_ldap,node_oauth,node_webauthn toneAmber
class node_secure,node_securestore,node_websocket,node_connections,node_email toneMint
class node_audit,node_reviews,node_reports,node_classification,node_config,node_database toneRose
```

## Components

### Vault and Access

- [API entry](https://github.com/nilsteampassnet/teampass/blob/master/app/api/index.php): `app/api/index.php`
- [Folder access](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/FolderAccessModel.php): `app/api/Model/FolderAccessModel.php`
- [Folder API](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Controller/Api/FolderController.php): `app/api/Controller/Api/FolderController.php`
- [Item API](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Controller/Api/ItemController.php): `app/api/Controller/Api/ItemController.php`
- [Credential items](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/ItemModel.php): `app/api/Model/ItemModel.php`
- [Item persistence](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/items.queries.php): `app/sources/items.queries.php`
- [Credential search](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/search.functions.php): `app/sources/search.functions.php`

### Identity and Security

- [Authentication](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Controller/Api/AuthController.php): `app/api/Controller/Api/AuthController.php`
- [Auth model](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/AuthModel.php): `app/api/Model/AuthModel.php`
- [Encryption manager](https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/cryptomanager/src/CryptoManager.php): `app/includes/libraries/teampassclasses/cryptomanager/src/CryptoManager.php`
- [RSA primitives](https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/phpseclibV1/Crypt/RSA.php): `app/includes/libraries/phpseclibV1/Crypt/RSA.php`
- [LDAP and AD](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/ldap.functions.php): `app/sources/ldap.functions.php`
- [OAuth2 identity](https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/oauth2controller/src/OAuth2Controller.php): `app/includes/libraries/teampassclasses/oauth2controller/src/OAuth2Controller.php`
- [WebAuthn](https://github.com/nilsteampassnet/teampass/blob/master/app/api/Model/WebauthnModel.php): `app/api/Model/WebauthnModel.php`

### Sharing and Collaboration

- [Secure Send](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/secure_send_logic.php): `app/sources/secure_send_logic.php`
- [Secure Send storage](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/secure_send_storage.php): `app/sources/secure_send_storage.php`
- [Live collaboration](https://github.com/nilsteampassnet/teampass/blob/master/app/websocket/src/MessageHandler.php): `app/websocket/src/MessageHandler.php`
- [Connection manager](https://github.com/nilsteampassnet/teampass/blob/master/app/websocket/src/ConnectionManager.php): `app/websocket/src/ConnectionManager.php`
- [Email delivery](https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/emailservice/src/EmailService.php): `app/includes/libraries/teampassclasses/emailservice/src/EmailService.php`

### Governance and Operations

- [Audit trail](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/items.logs.php): `app/sources/items.logs.php`
- [Access reviews](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/reviews.functions.php): `app/sources/reviews.functions.php`
- [Compliance reports](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/reports.functions.php): `app/sources/reports.functions.php`
- [Data classification](https://github.com/nilsteampassnet/teampass/blob/master/app/sources/classification.functions.php): `app/sources/classification.functions.php`
- [Configuration](https://github.com/nilsteampassnet/teampass/blob/master/app/includes/libraries/teampassclasses/configmanager/src/ConfigManager.php): `app/includes/libraries/teampassclasses/configmanager/src/ConfigManager.php`
- **MySQL database**

### Other components

- **Vault user**

## Connections

- Vault user → API entry: uses vault API (evidence: `README.md`)
- API entry → Authentication: dispatches to (evidence: `app/api/index.php`)
- API entry → Auth model: loads (evidence: `app/api/index.php`)
- API entry → Folder API: dispatches to (evidence: `app/api/index.php`)
- API entry → Folder access: loads (evidence: `app/api/index.php`)
- API entry → Item API: dispatches to
- Folder API → Folder access: uses access rules (evidence: `app/api/Controller/Api/FolderController.php`)
- Item API → Folder access: checks access (evidence: `app/api/Controller/Api/ItemController.php`)
- Item API → Credential items: uses item model (evidence: `app/api/Controller/Api/ItemController.php`)
- Credential items → Item persistence: persists items
- Item API → Encryption manager: encrypts secrets
- Encryption manager → RSA primitives: uses RSA (evidence: `app/includes/libraries/teampassclasses/cryptomanager/src/CryptoManager.php`)
- Item API → Audit trail: records access
- Vault user → Credential search: searches credentials (evidence: `README.md`)
- Vault user → Secure Send: shares a secret (evidence: `README.md`)
- Secure Send → Secure Send storage: uses storage
- Vault user → LDAP and AD: authenticates via (evidence: `README.md`)
- Vault user → OAuth2 identity: signs in via (evidence: `README.md`)
- Vault user → WebAuthn: uses MFA (evidence: `README.md`)
- Vault user → Access reviews: takes part in reviews (evidence: `README.md`)
- Vault user → Compliance reports: exports evidence (evidence: `README.md`)
- Vault user → Data classification: classifies data (evidence: `README.md`)
- Live collaboration → Connection manager: manages connections (evidence: `app/websocket/src/MessageHandler.php`)
- Secure Send → Email delivery: notifies recipients
- Configuration → MySQL database: reads settings (evidence: `app/includes/libraries/teampassclasses/configmanager/src/ConfigManager.php`)
- Folder access → MySQL database: queries folder tree (evidence: `app/api/Model/FolderAccessModel.php`)
