# lina77b/secrets_vault architecture

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

- Interactive diagram: https://gitdiagram.com/lina77b/secrets_vault
- Repository: https://github.com/lina77b/secrets_vault

## Overview

SecVault is a Django web app for encrypted personal and team secrets. A signed-in user reaches account and vault routes, then can create, manage, or reveal secrets; reveal decrypts the value and records an audit event. Workspace membership and roles govern shared access, while administrators manage members and secrets. The graph includes the documented browser interactions and the main persistence, encryption, and audit layers. Some template and settings wiring is not excerpted, so relationships not evidenced by the shown source or README are omitted.

Main entry points: [`vault/views.py`](https://github.com/lina77b/secrets_vault/blob/main/vault/views.py) (Request handlers), [`vault/audit.py`](https://github.com/lina77b/secrets_vault/blob/main/vault/audit.py) (Audit writer), [`vault/urls.py`](https://github.com/lina77b/secrets_vault/blob/main/vault/urls.py) (Vault routes), [`vault/models.py`](https://github.com/lina77b/secrets_vault/blob/main/vault/models.py) (Secret records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_routes["Vault routes<br/>[urls.py]"]
  node_views["Request handlers<br/>[views.py]"]
  node_browser["Secret controls<br/>[app.js]"]
  node_templates["Page templates"]
end

subgraph group_vault["Vault and sharing"]
  node_forms["Input forms<br/>[forms.py]"]
  node_workspace["Workspace access<br/>[views.py]"]
  node_secrets["Secret records<br/>[models.py]"]
end

subgraph group_security["Security and audit"]
  node_crypto["Encryption<br/>[crypto.py]"]
  node_auditwriter["Audit writer<br/>[audit.py]"]
  node_signals["Auth event logging<br/>[signals.py]"]
  node_auditview["Audit history<br/>[views.py]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Database")]
end

node_user(("User"))

node_user -->|"uses"| node_routes
node_routes -->|"dispatches"| node_views
node_views -->|"renders"| node_templates
node_views -->|"validates with"| node_forms
node_views -->|"checks access"| node_workspace
node_views -->|"queries and saves"| node_secrets
node_views -->|"writes events"| node_auditwriter
node_browser -->|"requests reveal"| node_views
node_secrets -->|"encrypts and decrypts"| node_crypto
node_signals -->|"logs auth events"| node_auditwriter
node_auditwriter -->|"writes logs"| node_database
node_views -->|"queries records"| node_database
node_auditview -->|"queries history"| node_database

click node_routes "https://github.com/lina77b/secrets_vault/blob/main/vault/urls.py"
click node_views "https://github.com/lina77b/secrets_vault/blob/main/vault/views.py"
click node_browser "https://github.com/lina77b/secrets_vault/blob/main/static/js/app.js"
click node_templates "https://github.com/lina77b/secrets_vault/tree/main/templates"
click node_forms "https://github.com/lina77b/secrets_vault/blob/main/vault/forms.py"
click node_workspace "https://github.com/lina77b/secrets_vault/blob/main/vault/views.py"
click node_secrets "https://github.com/lina77b/secrets_vault/blob/main/vault/models.py"
click node_crypto "https://github.com/lina77b/secrets_vault/blob/main/vault/crypto.py"
click node_auditwriter "https://github.com/lina77b/secrets_vault/blob/main/vault/audit.py"
click node_signals "https://github.com/lina77b/secrets_vault/blob/main/vault/signals.py"
click node_auditview "https://github.com/lina77b/secrets_vault/blob/main/vault/views.py"

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_routes,node_views,node_browser,node_templates,node_user toneBlue
class node_forms,node_workspace,node_secrets toneAmber
class node_crypto,node_auditwriter,node_signals,node_auditview toneMint
class node_database toneRose
```

## Components

### Web interface

- [Vault routes](https://github.com/lina77b/secrets_vault/blob/main/vault/urls.py): `vault/urls.py`
- [Request handlers](https://github.com/lina77b/secrets_vault/blob/main/vault/views.py): `vault/views.py`
- [Secret controls](https://github.com/lina77b/secrets_vault/blob/main/static/js/app.js): `static/js/app.js`
- [Page templates](https://github.com/lina77b/secrets_vault/tree/main/templates): `templates`

### Vault and sharing

- [Input forms](https://github.com/lina77b/secrets_vault/blob/main/vault/forms.py): `vault/forms.py`
- [Workspace access](https://github.com/lina77b/secrets_vault/blob/main/vault/views.py): `vault/views.py`
- [Secret records](https://github.com/lina77b/secrets_vault/blob/main/vault/models.py): `vault/models.py`

### Security and audit

- [Encryption](https://github.com/lina77b/secrets_vault/blob/main/vault/crypto.py): `vault/crypto.py`
- [Audit writer](https://github.com/lina77b/secrets_vault/blob/main/vault/audit.py): `vault/audit.py`
- [Auth event logging](https://github.com/lina77b/secrets_vault/blob/main/vault/signals.py): `vault/signals.py`
- [Audit history](https://github.com/lina77b/secrets_vault/blob/main/vault/views.py): `vault/views.py`

### Persistence

- **Database**

### Other components

- **User**

## Connections

- User → Vault routes: uses (evidence: `README.md`)
- Vault routes → Request handlers: dispatches (evidence: `vault/urls.py`)
- Request handlers → Page templates: renders (evidence: `vault/views.py`)
- Request handlers → Input forms: validates with (evidence: `vault/views.py`)
- Request handlers → Workspace access: checks access (evidence: `vault/views.py`)
- Request handlers → Secret records: queries and saves (evidence: `vault/views.py`)
- Request handlers → Audit writer: writes events (evidence: `vault/views.py`)
- Secret controls → Request handlers: requests reveal (evidence: `README.md`)
- Secret records → Encryption: encrypts and decrypts (evidence: `vault/models.py`)
- Auth event logging → Audit writer: logs auth events (evidence: `vault/signals.py`)
- Audit writer → Database: writes logs (evidence: `vault/audit.py`)
- Request handlers → Database: queries records (evidence: `vault/views.py`)
- Audit history → Database: queries history (evidence: `vault/views.py`)
