Platform Architecture Modules Developers Security Integrations Articles
Modules / Documents & Storage
Production-Ready Specification

Documents & Storage

S3-compatible asset pipeline, metadata indexing, and access-controlled streaming.

The Documents module unifies binary asset management across cloud storage providers (S3, Cloudflare R2, MinIO) with deterministic access verification, automated thumbnailing, and document version history.

Capabilities

Core Functional Capabilities

Direct-to-S3 signed URL uploads with checksum validation
Tenant-scoped storage drivers and encryption at rest
Asynchronous processing pipeline (PDF rendering, resizing, text extraction)
Document versioning, soft deletion, and retention policy enforcement
Content-type verification and anti-malware scan hooks
Time-limited ephemeral download links with rate limiting

Contracts

Public Interface Contracts

Other modules and domain action classes interact exclusively via these typed PHP contracts.

interface DocumentStorageInterface
interface DocumentProcessorInterface
interface SignedUrlGeneratorInterface
interface DocumentValidatorInterface

Reactivity

Dispatched Domain Events

Dispatched upon state mutation for downstream audit recording, webhook firing, and asynchronous notifications.

DocumentUploaded
DocumentProcessed
DocumentVersionCreated
DocumentDeleted
MaliciousContentDetected

Customization

Extension Points

  • Custom file transformation processors (e.g. CAD, Audio, Video, DICOM)
  • Custom anti-virus / sandboxing integrations
  • Storage adapter drivers for specialized on-premise SAN/NAS

🛡 Security & Isolation

  • MIME sniffing and extension mismatch rejection
  • Strict tenant directory prefixes preventing path traversal
  • Pre-signed short-lived token expiration (default 15 minutes)

Core Entities & Models

  • Document (UUID, filename, mime, size, checksum, disk, path, tenant_id)
  • DocumentVersion (Document_id, version_num, path, created_by)
  • DocumentMetadata (Key-value tags, indexed attributes)