docs: update README and tech docs for BadgerDB and thumbnails

- Reflect BadgerDB integration for metadata storage in features and
  architecture diagrams
- Add thumbnail generation and static asset subdirectories to project
  layout
- Document _MB configuration variants for size limits
- List main API request surfaces in docs/tech.md for better developer
  reference
- Align documentation with recent architectural and routing changes
This commit is contained in:
2026-04-30 02:32:45 +03:00
parent ac6e8c591b
commit 903b4eeed8
2 changed files with 96 additions and 37 deletions

View File

@@ -1,19 +1,30 @@
# WarpBox
WarpBox is a small, self-hosted file sharing app with temporary upload boxes,
simple download links, optional passwords, ZIP downloads, and a very deliberate
retro desktop mood.
simple download links, optional passwords, ZIP downloads, generated image
thumbnails, and a very deliberate retro desktop mood.
It is meant to feel quick: pick files, choose how long the box should live,
upload, and share the link.
```mermaid
flowchart LR
A[Choose files] --> B[Create box]
B --> C[Upload to box]
C --> D[Share link]
D --> E[Download files or ZIP]
E --> F[Expire or one-time cleanup]
User[Person in browser]
UI[WarpBox UI]
API[Go HTTP server]
Manifest[(Box manifest JSON)]
Files[(Uploaded files)]
Thumbs[(Thumbnail JPEGs)]
DB[(BadgerDB metadata)]
User --> UI
UI -->|create box / upload / poll status| API
API --> Manifest
API --> Files
API --> DB
Files -->|download files or build ZIP| API
Thumbs -->|preview URLs| UI
Files -->|scan image files| Thumbs
```
## Features
@@ -25,7 +36,8 @@ flowchart LR
- One-time download mode for ZIP-only handoff.
- Background thumbnails for image files.
- Plain filesystem storage, with JSON manifests next to uploaded files.
- No database required.
- Local BadgerDB metadata store for users, tags, sessions, and settings.
- No external database service required.
## How It Fits Together
@@ -36,11 +48,13 @@ flowchart TB
Manifest[Box manifest JSON]
Files[Uploaded files]
Thumbs[Generated thumbnails]
DB[(BadgerDB metadata)]
Browser -->|create box / upload / poll| Server
Browser -->|POST /box, uploads, status polls| Server
Server --> Manifest
Server --> Files
Server --> Thumbs
Server --> DB
Thumbs -->|preview URLs| Browser
Files -->|downloads / ZIP| Browser
```
@@ -101,6 +115,8 @@ settings remain environment controlled.
| `WARPBOX_THUMBNAIL_BATCH_SIZE` | `10` | Number of pending thumbnails processed per worker pass. |
| `WARPBOX_THUMBNAIL_INTERVAL_SECONDS` | `30` | Delay between thumbnail worker passes. |
Size limits also accept `_MB` variants for the same settings.
Example:
```bash
@@ -144,23 +160,29 @@ data/db/
## Project Layout
```text
cmd/ CLI entrypoint
lib/server/ HTTP handlers and server setup
lib/routing/ Route registration
lib/boxstore/ Box storage, manifests, downloads, thumbnails
lib/config/ Typed environment and runtime settings config
lib/metastore/ BadgerDB metadata store for users, tags, settings, sessions
lib/helpers/ Small shared helpers
lib/models/ Shared request/response models
templates/ Server-rendered HTML
static/ CSS, JavaScript, fonts, icons, and images
docs/ Project documentation
cmd/ CLI entrypoint
lib/server/ HTTP handlers and server setup
lib/routing/ Route registration
lib/boxstore/ Box storage, manifests, downloads, thumbnails
lib/config/ Typed environment and runtime settings config
lib/metastore/ BadgerDB metadata store for users, tags, settings, sessions
lib/helpers/ Small shared helpers
lib/models/ Shared request/response models
templates/ Server-rendered HTML
static/css/ Stylesheets
static/js/ Browser scripts
static/img/ Icons, sprites, and backgrounds
static/fonts/ Bitmap/pixel fonts
static/cursors/ Custom cursor packs
static/popups/ HTML popup content
docs/ Project documentation
```
## Notes
WarpBox is intentionally simple. It uses the local filesystem as its backing
store, relies on generated box IDs for share links, and keeps most behavior
easy to follow from the Go handlers and the small browser scripts.
WarpBox is intentionally simple. It uses the local filesystem for box data,
BadgerDB for app metadata, relies on generated box IDs for share links, and
keeps most behavior easy to follow from the Go handlers and the small browser
scripts.
For a short implementation overview, see [docs/tech.md](docs/tech.md).