PocketChest: Secure Temporary File Sharing for Modern Workflows

Effortless sharing with built-in expiration – Your digital file chest for secure collaboration

The Universal Challenge of File Sharing

Professionals across industries face consistent file-sharing hurdles:

  • Sending large design files to clients when email attachments fail
  • Securely sharing sensitive documents without permanent cloud exposure
  • Quickly transferring project assets between remote team members

PocketChest addresses these pain points directly by creating temporary, secure sharing containers. Like a digital safety deposit box, your files remain accessible only during their specified lifespan before automatic deletion.


Understanding the PocketChest System

The “Chest” Concept Explained

Each chest functions as a secure digital container holding:

  • 📁 Files of any type (up to 200GB each)
  • 📝 Text content (configuration details, code snippets)
    Upon upload, the system generates a unique 6-character code (e.g., X3K9MN) for retrieval. Recipients simply enter this code to access contents.

Core Capabilities Overview

Feature Technical Implementation User Benefit
Security 6-digit codes + TOTP authentication Protection against brute-force attacks
Capacity Multipart uploads + Cloudflare R2 200GB file support
Lifecycle Configurable expiration (1-15 days or permanent) Automatic content cleanup
Accessibility No registration + optional 2FA Immediate sharing

Technical Architecture Demystified

File Journey Visualization

graph LR
A[User Upload] --> B(Frontend Chunking)
B --> C{Large File?}
C -->|Yes| D[Multipart Storage in R2]
C -->|No| E[Direct Storage]
D & E --> F[Generate 6-digit Code]
F --> G[Recipient Enters Code]
G --> H[Automatic File Assembly]

Foundational Technologies

  1. Global Content Delivery
    Leverages Cloudflare’s 300+ global data centers ensuring low-latency access worldwide

  2. Automated Expiration System
    Hourly cleanup process:

    for chest in database:
        if current_time > chest.expiry_time:
            delete_associated_files(chest)
            remove_database_entry(chest)
    
  3. Security Infrastructure

    • Code entropy: 62^6 ≈ 56.8 billion combinations
    • Time-based OTP: 30-second rotating codes
    • JWT tokens: Session-based authorization

Hands-On Implementation Guide

Local Development Setup (Under 10 Minutes)

Step 1: Configuration Preparation

# Backend configuration
cp pocket-chest-backend/wrangler.jsonc.template pocket-chest-backend/wrangler.jsonc

# Frontend environment
cp pocket-chest-frontend/.env.local.template pocket-chest-frontend/.env.local

Step 2: Service Initialization

# Launch backend service
cd pocket-chest-backend
npm install
npm run dev  # API available at http://localhost:8787

# Launch frontend interface
cd pocket-chest-frontend
npm install
npm run dev  # Access at http://localhost:3000

File Upload Process

Upload Demonstration
Drag-and-drop interface with live progress tracking

File Retrieval Process

Retrieval Demonstration
Simple code-based access system


Real-World Application Scenarios

Case Study: Architectural Firm Collaboration

  • Challenge: Sharing 15GB BIM models with contractors
  • Solution:

    1. Upload Revit files with 7-day expiration
    2. Enable TOTP protection
    3. Share access code: T7B4R2

Case Study: Medical Research Team

  • Challenge: Securely sharing sensitive patient data samples
  • Workflow:

    1. Upload encrypted datasets
    2. Set 24-hour automatic deletion
    3. Include text instructions in the same chest

Cross-Platform Comparison

Traditional Methods PocketChest Approach
Permanent cloud storage Time-limited access
Manual file cleanup Automatic expiration
Account requirements Zero registration

Technical Implementation Details

Database Architecture

-- Core data structures
CREATE TABLE chests (
  id TEXT PRIMARY KEY,     -- 6-character access code
  expiry_time INTEGER,     -- Unix timestamp expiration
  totp_secret TEXT         -- Encrypted authentication secret
);

CREATE TABLE files (
  chest_id TEXT REFERENCES chests(id),
  r2_key TEXT,             -- Cloud storage identifier
  file_name TEXT           -- Original filename
);

Large File Handling Process

  1. Frontend splits 150GB video into 100MB chunks
  2. Parallel upload of chunks to Cloudflare R2
  3. Server maintains chunk sequence mapping
  4. Download triggers automatic reassembly

Frequently Asked Questions

How secure are the 6-digit codes?

With 56.8 billion possible combinations (62^6), even at 1,000 guesses/second, brute-forcing would require approximately 1.8 years

Are files truly deleted after expiration?

Two deletion mechanisms ensure compliance:

  1. Scheduled hourly cleanup of expired content
  2. Runtime expiration verification during access attempts

How does TOTP authentication work?

  1. Enable “Authenticator Protection” during upload
  2. Scan QR code with apps like Authy or Google Authenticator
  3. Recipients must provide current code for access

What file types are supported?

All file formats including:

  • Application executables (.exe, .dmg)
  • Design source files (.psd, .sketch)
  • Media archives (.zip, .rar)

Project Structure Overview

PocketChest/
├── Backend Core pocket-chest-backend/
│   ├── Multipart processing src/multipart-upload.ts
│   ├── Authentication engine src/auth/totp-validator.ts
│   └── Test suite test/ (32 validation cases)
│       ├── Large file tests multipart-upload.spec.ts
│       └── Collision tests retrieval.spec.ts
│
└── Frontend Interface pocket-chest-frontend/
    ├── Configuration components ExpirySelector.tsx
    ├── Progress visualization UploadProgress.tsx
    ├── API integration hooks/usePocketChest.ts

Why Self-Hosted Beats Commercial Alternatives

Key Advantages

  1. Data Sovereignty
    Complete control over storage location and access policies

  2. Customization Flexibility
    Modify core parameters including:

    • Access code length and complexity
    • Custom expiration timelines
  3. Cost Efficiency
    Cloudflare’s free tier includes:

    • 100,000 daily API requests
    • 10GB D1 database storage
    • 5GB monthly R2 storage

Full deployment guide available in DEPLOYMENT.md – deployable in under 30 minutes


Operational Best Practices

Security Protocols

  1. Mandatory TOTP for Confidential Files
    Adds second authentication layer beyond access codes

  2. Expiration Guidelines

    Content Type Recommended Duration
    Legal Documents 15 days
    Debugging Files 1 day
    Media Assets 7 days
  3. Secure Code Distribution

    • Prefer encrypted messaging channels
    • Avoid public code posting

Open-source project: [GitHub Repository] · MIT Licensed · Contributions welcome

PocketChest transforms temporary file sharing from a security concern into a streamlined workflow. Whether sharing 1KB configuration snippets or 200GB video projects, it maintains the crucial balance between accessibility and data control.