# colinchristianson/locker architecture

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

- Interactive diagram: https://gitdiagram.com/colinchristianson/locker
- Repository: https://github.com/colinchristianson/locker

## Overview

Locker is a small PHP/SQLite web application for campus organization members to manage account-scoped secrets. The main workflow is a browser request routed to the front controller, which authenticates the member and reads or saves that member’s vault items; registration and same-day password reset are additional flows. The graph includes the database-backed account, token, and vault layers. Edges reflect shown calls and documented behavior; the campus-mail notice is not evidence of an implemented mail integration.

Main entry points: [`public/index.php`](https://github.com/colinchristianson/locker/blob/main/public/index.php) (Route handlers), [`src/bootstrap.php`](https://github.com/colinchristianson/locker/blob/main/src/bootstrap.php) (App bootstrap and rendering), [`src/auth.php`](https://github.com/colinchristianson/locker/blob/main/src/auth.php) (Account and session logic), [`src/crypto.php`](https://github.com/colinchristianson/locker/blob/main/src/crypto.php) (Password and token helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web request flow"]
  node_router["Request router<br/>[router.php]"]
  node_front["Route handlers<br/>[index.php]"]
  node_bootstrap["App bootstrap and rendering<br/>[bootstrap.php]"]
  node_views["Account and vault views"]
end

subgraph group_identity["Accounts and sessions"]
  node_auth["Account and session logic<br/>[auth.php]"]
  node_crypto["Password and token helpers<br/>[crypto.php]"]
end

subgraph group_recovery["Password recovery"]
  node_recovery_view["Reset forms<br/>[forgot.php]"]
  node_reset_view["New-password form<br/>[reset.php]"]
end

subgraph group_vault["Personal vault"]
  node_vault["Vault item access<br/>[vault.php]"]
  node_home_view["Personal shelf view<br/>[home.php]"]
  node_item_view["Store-secret form<br/>[new_item.php]"]
  node_sqlite[("SQLite database")]
end

node_member(("Member"))

node_member -->|"sends requests"| node_router
node_router -->|"routes requests"| node_front
node_front -->|"loads"| node_bootstrap
node_bootstrap -->|"loads"| node_auth
node_bootstrap -->|"loads"| node_crypto
node_bootstrap -->|"loads"| node_vault
node_bootstrap -->|"initializes and seeds"| node_sqlite
node_front -->|"authenticates and manages accounts"| node_auth
node_auth -->|"hashes passwords"| node_crypto
node_auth -->|"reads and writes accounts"| node_sqlite
node_front -->|"reads and saves items"| node_vault
node_vault -->|"reads and writes items"| node_sqlite
node_front -->|"issues and checks reset tokens"| node_crypto
node_crypto -->|"stores and checks tokens"| node_sqlite
node_bootstrap -->|"renders"| node_views
node_front -->|"renders recovery form"| node_recovery_view
node_front -->|"renders reset form"| node_reset_view
node_front -->|"renders shelf"| node_home_view
node_front -->|"renders item form"| node_item_view
node_sqlite -->|"seeds accounts"| node_auth
node_sqlite -->|"seeds sample items"| node_vault

click node_router "https://github.com/colinchristianson/locker/blob/main/public/router.php"
click node_front "https://github.com/colinchristianson/locker/blob/main/public/index.php"
click node_bootstrap "https://github.com/colinchristianson/locker/blob/main/src/bootstrap.php"
click node_views "https://github.com/colinchristianson/locker/tree/main/templates"
click node_auth "https://github.com/colinchristianson/locker/blob/main/src/auth.php"
click node_crypto "https://github.com/colinchristianson/locker/blob/main/src/crypto.php"
click node_recovery_view "https://github.com/colinchristianson/locker/blob/main/templates/forgot.php"
click node_reset_view "https://github.com/colinchristianson/locker/blob/main/templates/reset.php"
click node_vault "https://github.com/colinchristianson/locker/blob/main/src/vault.php"
click node_home_view "https://github.com/colinchristianson/locker/blob/main/templates/home.php"
click node_item_view "https://github.com/colinchristianson/locker/blob/main/templates/new_item.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_router,node_front,node_bootstrap,node_views toneBlue
class node_auth,node_crypto toneAmber
class node_recovery_view,node_reset_view toneMint
class node_vault,node_home_view,node_item_view,node_sqlite toneRose
class node_member toneIndigo
```

## Components

### Web request flow

- [Request router](https://github.com/colinchristianson/locker/blob/main/public/router.php): `public/router.php`
- [Route handlers](https://github.com/colinchristianson/locker/blob/main/public/index.php): `public/index.php`
- [App bootstrap and rendering](https://github.com/colinchristianson/locker/blob/main/src/bootstrap.php): `src/bootstrap.php`
- [Account and vault views](https://github.com/colinchristianson/locker/tree/main/templates): `templates`

### Accounts and sessions

- [Account and session logic](https://github.com/colinchristianson/locker/blob/main/src/auth.php): `src/auth.php`
- [Password and token helpers](https://github.com/colinchristianson/locker/blob/main/src/crypto.php): `src/crypto.php`

### Password recovery

- [Reset forms](https://github.com/colinchristianson/locker/blob/main/templates/forgot.php): `templates/forgot.php`
- [New-password form](https://github.com/colinchristianson/locker/blob/main/templates/reset.php): `templates/reset.php`

### Personal vault

- [Vault item access](https://github.com/colinchristianson/locker/blob/main/src/vault.php): `src/vault.php`
- [Personal shelf view](https://github.com/colinchristianson/locker/blob/main/templates/home.php): `templates/home.php`
- [Store-secret form](https://github.com/colinchristianson/locker/blob/main/templates/new_item.php): `templates/new_item.php`
- **SQLite database**

### Other components

- **Member**

## Connections

- Member → Request router: sends requests (evidence: `README.md`)
- Request router → Route handlers: routes requests (evidence: `public/router.php`)
- Route handlers → App bootstrap and rendering: loads (evidence: `public/index.php`)
- App bootstrap and rendering → Account and session logic: loads (evidence: `src/bootstrap.php`)
- App bootstrap and rendering → Password and token helpers: loads (evidence: `src/bootstrap.php`)
- App bootstrap and rendering → Vault item access: loads (evidence: `src/bootstrap.php`)
- App bootstrap and rendering → SQLite database: initializes and seeds (evidence: `src/bootstrap.php`)
- Route handlers → Account and session logic: authenticates and manages accounts (evidence: `public/index.php`)
- Account and session logic → Password and token helpers: hashes passwords (evidence: `src/auth.php`)
- Account and session logic → SQLite database: reads and writes accounts (evidence: `src/auth.php`)
- Route handlers → Vault item access: reads and saves items (evidence: `public/index.php`)
- Vault item access → SQLite database: reads and writes items (evidence: `src/vault.php`)
- Route handlers → Password and token helpers: issues and checks reset tokens (evidence: `public/index.php`)
- Password and token helpers → SQLite database: stores and checks tokens (evidence: `src/crypto.php`)
- App bootstrap and rendering → Account and vault views: renders (evidence: `src/bootstrap.php`)
- Route handlers → Reset forms: renders recovery form (evidence: `public/index.php`)
- Route handlers → New-password form: renders reset form (evidence: `public/index.php`)
- Route handlers → Personal shelf view: renders shelf (evidence: `public/index.php`)
- Route handlers → Store-secret form: renders item form (evidence: `public/index.php`)
- SQLite database → Account and session logic: seeds accounts
- SQLite database → Vault item access: seeds sample items
