# jhnbrd/jhn-drive architecture

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

- Interactive diagram: https://gitdiagram.com/jhnbrd/jhn-drive
- Repository: https://github.com/jhnbrd/jhn-drive

## Overview

JHN Drive is a self-hosted, multi-user file-management application. Users request access, are approved by a superadmin, then authenticate to manage quota-limited files and folders; they can also publish public share links or use an isolated PIN-gated vault. The README documents media previews and streaming, folder ZIP downloads, storage isolation, and quotas. Sampled controller excerpts support the main drive and public sharing relationships; vault and some route wiring are represented from the README and repository tree, not sampled implementation.

Main entry points: [`routes/web.php`](https://github.com/jhnbrd/jhn-drive/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/DriveController.php`](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/DriveController.php) (File management and media), [`app/Http/Controllers/ShareController.php`](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/ShareController.php) (Public share delivery), [`app/Http/Controllers/SecretController.php`](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/SecretController.php) (PIN-gated vault)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and administration"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_auth["Authentication and requests<br/>[AuthController.php]"]
  node_admin_ctrl["Access administration"]
  node_user_model["User accounts and quotas<br/>[User.php]"]
  node_admin_view["Admin panel<br/>[index.blade.php]"]
end

subgraph group_drive["Personal drive"]
  node_drive_ctrl["File management and media"]
  node_drive_view["Drive interface<br/>[index.blade.php]"]
  node_local_files[("Local drive files<br/>[filesystems.php]")]
end

subgraph group_sharing["Public sharing"]
  node_share_ctrl["Public share delivery"]
  node_share_model["Share links<br/>[SharedLink.php]"]
  node_share_view["Shared item interface<br/>[show.blade.php]"]
end

subgraph group_vault["Secret vault"]
  node_vault_ctrl["PIN-gated vault"]
  node_vault_guard["Vault session guard"]
  node_vault_view["Vault interface<br/>[vault.blade.php]"]
  node_vault_pin["Vault PIN screen<br/>[pin.blade.php]"]
end

node_user(("Drive user"))
node_admin(("Superadmin"))
node_database[("Relational database<br/>[database.php]")]

node_user -->|"sends requests"| node_web_routes
node_admin -->|"sends requests"| node_web_routes
node_web_routes -->|"dispatches auth"| node_auth
node_web_routes -->|"dispatches admin"| node_admin_ctrl
node_web_routes -->|"dispatches drive"| node_drive_ctrl
node_web_routes -->|"dispatches shares"| node_share_ctrl
node_web_routes -->|"dispatches vault"| node_vault_ctrl
node_auth -->|"checks and creates"| node_user_model
node_auth -->|"reads and writes"| node_database
node_admin_ctrl -->|"updates accounts"| node_user_model
node_admin_ctrl -->|"renders dashboard"| node_admin_view
node_admin_ctrl -->|"deletes user files"| node_local_files
node_drive_ctrl -->|"checks quota"| node_user_model
node_drive_ctrl -->|"manages and streams"| node_local_files
node_drive_ctrl -->|"updates share links"| node_share_model
node_drive_ctrl -->|"renders drive"| node_drive_view
node_drive_ctrl -->|"reads and writes"| node_database
node_share_ctrl -->|"loads link"| node_share_model
node_share_ctrl -->|"reads shared files"| node_local_files
node_share_ctrl -->|"renders shared item"| node_share_view
node_share_ctrl -->|"updates download counts"| node_database
node_vault_ctrl -->|"uses session guard"| node_vault_guard
node_vault_ctrl -->|"renders PIN screen"| node_vault_pin
node_vault_ctrl -->|"renders vault"| node_vault_view
node_vault_ctrl -->|"accesses vault files"| node_local_files

click node_web_routes "https://github.com/jhnbrd/jhn-drive/blob/main/routes/web.php"
click node_auth "https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/AuthController.php"
click node_admin_ctrl "https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/AdminController.php"
click node_user_model "https://github.com/jhnbrd/jhn-drive/blob/main/app/Models/User.php"
click node_admin_view "https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/admin/index.blade.php"
click node_drive_ctrl "https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/DriveController.php"
click node_drive_view "https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/drive/index.blade.php"
click node_local_files "https://github.com/jhnbrd/jhn-drive/blob/main/config/filesystems.php"
click node_share_ctrl "https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/ShareController.php"
click node_share_model "https://github.com/jhnbrd/jhn-drive/blob/main/app/Models/SharedLink.php"
click node_share_view "https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/share/show.blade.php"
click node_vault_ctrl "https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/SecretController.php"
click node_vault_guard "https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Middleware/SecretVaultAuth.php"
click node_vault_view "https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/secret/vault.blade.php"
click node_vault_pin "https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/secret/pin.blade.php"
click node_database "https://github.com/jhnbrd/jhn-drive/blob/main/config/database.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_web_routes,node_auth,node_admin_ctrl,node_user_model,node_admin_view,node_user toneBlue
class node_drive_ctrl,node_drive_view,node_local_files,node_database toneAmber
class node_share_ctrl,node_share_model,node_share_view toneMint
class node_vault_ctrl,node_vault_guard,node_vault_view,node_vault_pin toneRose
class node_admin toneIndigo
```

## Components

### Access and administration

- [Web routes](https://github.com/jhnbrd/jhn-drive/blob/main/routes/web.php): `routes/web.php`
- [Authentication and requests](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Access administration](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/AdminController.php): `app/Http/Controllers/AdminController.php`
- [User accounts and quotas](https://github.com/jhnbrd/jhn-drive/blob/main/app/Models/User.php): `app/Models/User.php`
- [Admin panel](https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/admin/index.blade.php): `resources/views/admin/index.blade.php`

### Personal drive

- [File management and media](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/DriveController.php): `app/Http/Controllers/DriveController.php`
- [Drive interface](https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/drive/index.blade.php): `resources/views/drive/index.blade.php`
- [Local drive files](https://github.com/jhnbrd/jhn-drive/blob/main/config/filesystems.php): `config/filesystems.php`

### Public sharing

- [Public share delivery](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/ShareController.php): `app/Http/Controllers/ShareController.php`
- [Share links](https://github.com/jhnbrd/jhn-drive/blob/main/app/Models/SharedLink.php): `app/Models/SharedLink.php`
- [Shared item interface](https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/share/show.blade.php): `resources/views/share/show.blade.php`

### Secret vault

- [PIN-gated vault](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Controllers/SecretController.php): `app/Http/Controllers/SecretController.php`
- [Vault session guard](https://github.com/jhnbrd/jhn-drive/blob/main/app/Http/Middleware/SecretVaultAuth.php): `app/Http/Middleware/SecretVaultAuth.php`
- [Vault interface](https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/secret/vault.blade.php): `resources/views/secret/vault.blade.php`
- [Vault PIN screen](https://github.com/jhnbrd/jhn-drive/blob/main/resources/views/secret/pin.blade.php): `resources/views/secret/pin.blade.php`

### Other components

- **Drive user**
- **Superadmin**
- [Relational database](https://github.com/jhnbrd/jhn-drive/blob/main/config/database.php): `config/database.php`

## Connections

- Drive user → Web routes: sends requests
- Superadmin → Web routes: sends requests
- Web routes → Authentication and requests: dispatches auth
- Web routes → Access administration: dispatches admin
- Web routes → File management and media: dispatches drive
- Web routes → Public share delivery: dispatches shares
- Web routes → PIN-gated vault: dispatches vault
- Authentication and requests → User accounts and quotas: checks and creates
- Authentication and requests → Relational database: reads and writes
- Access administration → User accounts and quotas: updates accounts
- Access administration → Admin panel: renders dashboard
- Access administration → Local drive files: deletes user files
- File management and media → User accounts and quotas: checks quota
- File management and media → Local drive files: manages and streams
- File management and media → Share links: updates share links
- File management and media → Drive interface: renders drive
- File management and media → Relational database: reads and writes
- Public share delivery → Share links: loads link
- Public share delivery → Local drive files: reads shared files
- Public share delivery → Shared item interface: renders shared item
- Public share delivery → Relational database: updates download counts
- PIN-gated vault → Vault session guard: uses session guard
- PIN-gated vault → Vault PIN screen: renders PIN screen
- PIN-gated vault → Vault interface: renders vault
- PIN-gated vault → Local drive files: accesses vault files
