From 7bb9b9b1b0b6b7cd88eecbbaaf2b44dd623edcdf Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 9 Jun 2026 16:29:26 +0200 Subject: [PATCH] feat: initial phpfilebrowser with single-file implementation - PHP backend: directory listing, file download API - Frontend: modern dark theme, fully responsive - Features: file/folder navigation, sortable table, text filter - Media overlay: image/audio/video player with autoplay - Download trigger for non-media files - Browser history navigation (back/forward buttons) - All CSS/JS inline in single index.php, no external dependencies --- .gitignore | 2 + AGENTS.md | 90 ++++ index.php | 1232 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1324 insertions(+) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 index.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa6614e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# PHP file browser +# (index.php and AGENTS.md are the project files) diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3e19104 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,90 @@ +# phpfilebrowser — Project Instructions + +## Overview + +Single-file PHP file browser. No external dependencies. Dark modern theme, responsive, mobile-optimized. + +## Architecture + +``` +phpfilebrowser/ +├── AGENTS.md # This file — project state & agent instructions +├── index.php # Single-file application (PHP backend + CSS + JS inline) +└── .gitignore +``` + +## Current State + +**Step 1 — Project Setup:** `in_progress` (2026-06-09) +- Project directory created +- AGENTS.md created +- Git repo not yet initialized +- Gitea remote not yet configured + +## Implementation Plan + +### Step 1: Project Setup +- [x] Create project directory +- [x] Create AGENTS.md +- [ ] Create .gitignore +- [ ] Git init, configure, push to Gitea + +### Step 2: PHP Backend (`index.php` — backend portion) +- [ ] Read directory contents (realpath-based, no traversal) +- [ ] Return JSON for current directory listing +- [ ] Handle relative path from query param (`?path=`) +- [ ] Return metadata: name, type (dir/file), size, modified date + +### Step 3: Frontend — CSS (dark, modern, responsive) +- [ ] Dark color scheme with CSS variables +- [ ] Responsive table layout (stack on mobile) +- [ ] Navigation bar with breadcrumb +- [ ] Back/Forward browser-style navigation buttons +- [ ] Filter input styling +- [ ] Media player overlay styling +- [ ] Sortable column headers with indicators +- [ ] File type icons (inline SVG) + +### Step 4: Frontend — Table & Sorting +- [ ] Render file/folder table from JSON data +- [ ] Clickable rows (folders navigate, files trigger action) +- [ ] Client-side sort by name, date, size (asc/desc) +- [ ] Sort state persisted in filter bar + +### Step 5: Frontend — Filtering +- [ ] Text filter input (regex or substring match) +- [ ] Filter applied to table rows in real-time + +### Step 6: Frontend — Media Player Overlay +- [ ] Detect media file types (audio/video/image) +- [ ] Open overlay with embedded `