# harvey-kun/local-file-storage-with-php architecture

> Architecture diagram of the GitHub repository harvey-kun/local-file-storage-with-php, 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/harvey-kun/local-file-storage-with-php
- Repository: https://github.com/harvey-kun/local-file-storage-with-php

## Overview

Storage_test is a PHP web application for uploading, browsing, managing, and previewing stored files; version 3.0 adds signed-in accounts and access controls. The principal flow is a user interacting with the file page, which sends management actions to the files endpoint, while preview requests are served separately. Earlier numbered directories preserve successive application versions. The README documents MySQL and an uploads directory; their detailed wiring is not shown in the excerpts, so those relationships are marked unverified.

Main entry points: [`3.0/auth.php`](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/auth.php) (Authentication and sharing), [`3.0/preview.php`](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/preview.php) (File preview), [`3.0/index.php`](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/index.php) (File workspace), [`3.0/files.php`](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/files.php) (File actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["File application"]
  node_page["File workspace<br/>[index.php]"]
  node_api["File actions<br/>[files.php]"]
  node_database[("MySQL data")]
  node_uploads[("Uploaded files")]
end

subgraph group_media["Media handling"]
  node_preview["File preview<br/>[preview.php]"]
  node_types["File type rules<br/>[filetypes.php]"]
  node_audio["Audio metadata<br/>[audiometa.php]"]
end

subgraph group_identity["Accounts and access"]
  node_auth["Authentication and sharing<br/>[auth.php]"]
  node_login["Login<br/>[login.php]"]
  node_logout["Logout<br/>[logout.php]"]
end

subgraph group_history["Earlier versions"]
  node_v10["Version 1.0<br/>[1.0]"]
  node_v11["Version 1.1<br/>[1.1]"]
  node_v20["Version 2.0<br/>[2.0]"]
  node_v21["Version 2.1<br/>[2.1]"]
  node_v22["Version 2.2<br/>[2.2]"]
  node_v23["Version 2.3<br/>[2.3]"]
  node_v24["Version 2.4<br/>[2.4]"]
  node_v25["Version 2.5<br/>[2.5]"]
end

node_user(("User"))

node_user -->|"uses"| node_page
node_page -->|"sends actions"| node_api
node_page -->|"requires login"| node_auth
node_preview -->|"checks access"| node_auth
node_preview -->|"classifies file"| node_types
node_preview -->|"reads tags"| node_audio
node_preview -->|"queries file record"| node_database
node_auth -->|"manages account and access data"| node_database
node_api -.->|"uses file records"| node_database
node_api -.->|"stores uploaded files"| node_uploads
node_login -.->|"uses account services"| node_auth
node_logout -.->|"uses session services"| node_auth

click node_page "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/index.php"
click node_api "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/files.php"
click node_preview "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/preview.php"
click node_types "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/filetypes.php"
click node_audio "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/audiometa.php"
click node_auth "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/auth.php"
click node_login "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/login.php"
click node_logout "https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/logout.php"
click node_v10 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/1.0"
click node_v11 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/1.1"
click node_v20 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.0"
click node_v21 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.1"
click node_v22 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.2"
click node_v23 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.3"
click node_v24 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.4"
click node_v25 "https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.5"

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_page,node_api,node_database,node_uploads,node_user toneBlue
class node_preview,node_types,node_audio toneAmber
class node_auth,node_login,node_logout toneMint
class node_v10,node_v11,node_v20,node_v21,node_v22,node_v23,node_v24,node_v25 toneRose
```

## Components

### File application

- [File workspace](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/index.php): `3.0/index.php`
- [File actions](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/files.php): `3.0/files.php`
- **MySQL data**
- **Uploaded files**

### Media handling

- [File preview](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/preview.php): `3.0/preview.php`
- [File type rules](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/filetypes.php): `3.0/filetypes.php`
- [Audio metadata](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/audiometa.php): `3.0/audiometa.php`

### Accounts and access

- [Authentication and sharing](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/auth.php): `3.0/auth.php`
- [Login](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/login.php): `3.0/login.php`
- [Logout](https://github.com/harvey-kun/local-file-storage-with-php/blob/main/3.0/logout.php): `3.0/logout.php`

### Earlier versions

- [Version 1.0](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/1.0): `1.0`
- [Version 1.1](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/1.1): `1.1`
- [Version 2.0](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.0): `2.0`
- [Version 2.1](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.1): `2.1`
- [Version 2.2](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.2): `2.2`
- [Version 2.3](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.3): `2.3`
- [Version 2.4](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.4): `2.4`
- [Version 2.5](https://github.com/harvey-kun/local-file-storage-with-php/tree/main/2.5): `2.5`

### Other components

- **User**

## Connections

- User → File workspace: uses
- File workspace → File actions: sends actions (evidence: `3.0/index.php`)
- File workspace → Authentication and sharing: requires login (evidence: `3.0/index.php`)
- File preview → Authentication and sharing: checks access (evidence: `3.0/preview.php`)
- File preview → File type rules: classifies file (evidence: `3.0/preview.php`)
- File preview → Audio metadata: reads tags (evidence: `3.0/preview.php`)
- File preview → MySQL data: queries file record (evidence: `3.0/preview.php`)
- Authentication and sharing → MySQL data: manages account and access data (evidence: `3.0/auth.php`)
- File actions → MySQL data: uses file records
- File actions → Uploaded files: stores uploaded files
- Login → Authentication and sharing: uses account services
- Logout → Authentication and sharing: uses session services
