# mgoldie05/locker architecture

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

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

## Overview

Locker is a small PHP/SQLite shared-secret shelf. A member reaches the front controller, signs in or registers, then views or stores account-scoped vault entries; password recovery uses a same-day reset token. The advisor account and its seeded hold are documented and created in the seed routine. The graph distinguishes request routing, application logic, persistence, and rendered screens. No mail service is shown: the README and controller describe a queued reset link, but the sampled code only stores a token.

Main entry points: [`public/index.php`](https://github.com/mgoldie05/locker/blob/main/public/index.php) (Front controller), [`src/db.php`](https://github.com/mgoldie05/locker/blob/main/src/db.php) (SQLite schema and seed), [`src/auth.php`](https://github.com/mgoldie05/locker/blob/main/src/auth.php) (Account and sessions), [`src/bootstrap.php`](https://github.com/mgoldie05/locker/blob/main/src/bootstrap.php) (Bootstrap and rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["Request handling"]
  node_router["PHP router<br/>[router.php]"]
  node_controller["Front controller<br/>[index.php]"]
end

subgraph group_core["Application logic"]
  node_bootstrap["Bootstrap and rendering<br/>[bootstrap.php]"]
  node_auth["Account and sessions<br/>[auth.php]"]
  node_crypto["Password and tokens<br/>[crypto.php]"]
  node_vault["Vault operations<br/>[vault.php]"]
end

subgraph group_data["Persistence"]
  node_database[("SQLite schema and seed<br/>[db.php]")]
end

subgraph group_views["Rendered screens"]
  node_layout["Shared layout<br/>[layout_start.php]"]
  node_home["Vault shelf<br/>[home.php]"]
  node_account_forms["Account forms<br/>[register.php]"]
  node_reset_forms["Reset forms<br/>[reset.php]"]
  node_item_form["New item form<br/>[new_item.php]"]
  node_forgot_form["Forgot form<br/>[forgot.php]"]
  node_login_form["Sign-in form<br/>[login.php]"]
end

node_member(("Member"))

node_member -->|"sends requests"| node_router
node_router -->|"routes requests"| node_controller
node_controller -->|"loads"| node_bootstrap
node_bootstrap -->|"initializes and seeds"| node_database
node_controller -->|"uses account functions"| node_auth
node_controller -->|"uses reset functions"| node_crypto
node_controller -->|"reads and adds items"| node_vault
node_auth -->|"queries users"| node_database
node_auth -->|"hashes passwords"| node_crypto
node_crypto -->|"stores reset tokens"| node_database
node_vault -->|"reads and writes entries"| node_database
node_controller -->|"renders shelf"| node_home
node_controller -->|"renders registration"| node_account_forms
node_controller -->|"renders sign-in"| node_login_form
node_controller -->|"renders recovery"| node_forgot_form
node_controller -->|"renders reset"| node_reset_forms
node_controller -->|"renders item form"| node_item_form
node_bootstrap -->|"includes layout"| node_layout
node_database -->|"seeds accounts"| node_auth
node_database -->|"seeds vault items"| node_vault

click node_router "https://github.com/mgoldie05/locker/blob/main/public/router.php"
click node_controller "https://github.com/mgoldie05/locker/blob/main/public/index.php"
click node_bootstrap "https://github.com/mgoldie05/locker/blob/main/src/bootstrap.php"
click node_auth "https://github.com/mgoldie05/locker/blob/main/src/auth.php"
click node_crypto "https://github.com/mgoldie05/locker/blob/main/src/crypto.php"
click node_vault "https://github.com/mgoldie05/locker/blob/main/src/vault.php"
click node_database "https://github.com/mgoldie05/locker/blob/main/src/db.php"
click node_layout "https://github.com/mgoldie05/locker/blob/main/templates/layout_start.php"
click node_home "https://github.com/mgoldie05/locker/blob/main/templates/home.php"
click node_account_forms "https://github.com/mgoldie05/locker/blob/main/templates/register.php"
click node_reset_forms "https://github.com/mgoldie05/locker/blob/main/templates/reset.php"
click node_item_form "https://github.com/mgoldie05/locker/blob/main/templates/new_item.php"
click node_forgot_form "https://github.com/mgoldie05/locker/blob/main/templates/forgot.php"
click node_login_form "https://github.com/mgoldie05/locker/blob/main/templates/login.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_controller toneBlue
class node_bootstrap,node_auth,node_crypto,node_vault toneAmber
class node_database toneMint
class node_layout,node_home,node_account_forms,node_reset_forms,node_item_form,node_forgot_form,node_login_form toneRose
class node_member toneIndigo
```

## Components

### Request handling

- [PHP router](https://github.com/mgoldie05/locker/blob/main/public/router.php): `public/router.php`
- [Front controller](https://github.com/mgoldie05/locker/blob/main/public/index.php): `public/index.php`

### Application logic

- [Bootstrap and rendering](https://github.com/mgoldie05/locker/blob/main/src/bootstrap.php): `src/bootstrap.php`
- [Account and sessions](https://github.com/mgoldie05/locker/blob/main/src/auth.php): `src/auth.php`
- [Password and tokens](https://github.com/mgoldie05/locker/blob/main/src/crypto.php): `src/crypto.php`
- [Vault operations](https://github.com/mgoldie05/locker/blob/main/src/vault.php): `src/vault.php`

### Persistence

- [SQLite schema and seed](https://github.com/mgoldie05/locker/blob/main/src/db.php): `src/db.php`

### Rendered screens

- [Shared layout](https://github.com/mgoldie05/locker/blob/main/templates/layout_start.php): `templates/layout_start.php`
- [Vault shelf](https://github.com/mgoldie05/locker/blob/main/templates/home.php): `templates/home.php`
- [Account forms](https://github.com/mgoldie05/locker/blob/main/templates/register.php): `templates/register.php`
- [Reset forms](https://github.com/mgoldie05/locker/blob/main/templates/reset.php): `templates/reset.php`
- [New item form](https://github.com/mgoldie05/locker/blob/main/templates/new_item.php): `templates/new_item.php`
- [Forgot form](https://github.com/mgoldie05/locker/blob/main/templates/forgot.php): `templates/forgot.php`
- [Sign-in form](https://github.com/mgoldie05/locker/blob/main/templates/login.php): `templates/login.php`

### Other components

- **Member**

## Connections

- Member → PHP router: sends requests (evidence: `README.md`)
- PHP router → Front controller: routes requests (evidence: `public/router.php`)
- Front controller → Bootstrap and rendering: loads (evidence: `public/index.php`)
- Bootstrap and rendering → SQLite schema and seed: initializes and seeds (evidence: `src/bootstrap.php`)
- Front controller → Account and sessions: uses account functions (evidence: `public/index.php`)
- Front controller → Password and tokens: uses reset functions (evidence: `public/index.php`)
- Front controller → Vault operations: reads and adds items (evidence: `public/index.php`)
- Account and sessions → SQLite schema and seed: queries users (evidence: `src/auth.php`)
- Account and sessions → Password and tokens: hashes passwords (evidence: `src/auth.php`)
- Password and tokens → SQLite schema and seed: stores reset tokens (evidence: `src/crypto.php`)
- Vault operations → SQLite schema and seed: reads and writes entries (evidence: `src/vault.php`)
- Front controller → Vault shelf: renders shelf (evidence: `public/index.php`)
- Front controller → Account forms: renders registration (evidence: `public/index.php`)
- Front controller → Sign-in form: renders sign-in (evidence: `public/index.php`)
- Front controller → Forgot form: renders recovery (evidence: `public/index.php`)
- Front controller → Reset forms: renders reset (evidence: `public/index.php`)
- Front controller → New item form: renders item form (evidence: `public/index.php`)
- Bootstrap and rendering → Shared layout: includes layout (evidence: `src/bootstrap.php`)
- SQLite schema and seed → Account and sessions: seeds accounts (evidence: `src/db.php`)
- SQLite schema and seed → Vault operations: seeds vault items (evidence: `src/db.php`)
