Download the PHP package azaharizaman/nexus-document without Composer
On this page you can find all versions of the php package azaharizaman/nexus-document. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download azaharizaman/nexus-document
More information about azaharizaman/nexus-document
Files in azaharizaman/nexus-document
Package nexus-document
Short Description Framework-agnostic document management engine for Nexus ERP monorepo
License MIT
Informations about the package nexus-document
Nexus\Document
Framework-agnostic Enterprise Document Management (EDM) engine for Nexus ERP monorepo
Overview
Nexus\Document is a pure PHP, atomic package providing comprehensive document lifecycle management for the Nexus ERP ecosystem. It serves as the centralized authority for document storage, versioning, access control, integrity verification, and compliance-aware retention across all vertical packages (FieldService, Finance, HR, Procurement, etc.).
This package follows the "Logic in Packages, Implementation in Applications" principle, providing framework-agnostic contracts and services that are implemented by the consuming application (Nexus\Atomy).
Key Features
- S3-Optimized Nested Storage: Year/month partitioned paths for millions of documents with optimal performance
- Version Control: Complete version history with rollback capabilities and manual pruning
- Checksum Integrity: SHA-256 verification on every download to prevent data corruption
- Access Control: Permission-based document access (view, edit, delete, share)
- ML Classification: Optional content processing for auto-classification and metadata extraction
- Retention Policies: Compliance-aware retention and purging via
Nexus\Complianceintegration - Document Relationships: Link documents (amendment, supersedes, related, attachment)
- Temporary URLs: Secure, time-limited download links for external sharing
- Batch Operations: Efficient multi-document uploads with transaction safety
- Audit Trail: Complete activity logging via
Nexus\AuditLoggerintegration - Multi-Tenancy: Full tenant isolation via
Nexus\Tenantintegration
Architecture
Framework-Agnostic Design
This package contains zero Laravel dependencies. All logic is pure PHP 8.3+ code that defines:
- Contracts (Interfaces): What the package needs from the outside world
- Services: Business logic and orchestration
- Value Objects: Immutable data structures
- Exceptions: Domain-specific error handling
The consuming application (apps/Atomy) provides concrete implementations of all contracts using Laravel Eloquent, migrations, and service providers.
Package Structure
Core Contracts
Entity Interfaces
DocumentInterface: Primary document metadata (ID, tenant, owner, type, state, storage path, checksum, version)DocumentVersionInterface: Version history record (version number, change description, creator, checksum)DocumentRelationshipInterface: Document relationship link (source, target, type)
Repository Interfaces
DocumentRepositoryInterface: CRUD operations for documentsDocumentVersionRepositoryInterface: Version history persistenceDocumentRelationshipRepositoryInterface: Relationship management
Service Interfaces
PermissionCheckerInterface: Access control (canView, canEdit, canDelete, canShare)DocumentSearchInterface: Metadata-based search (tags, type, owner, date range)ContentProcessorInterface: Content transformation (PDF rendering, ML classification)RetentionPolicyInterface: Compliance-aware retention rules
Value Objects
Enums (Native PHP 8.3)
Readonly Classes
DocumentMetadata: Original filename, MIME type, file size, checksum, tags, custom fieldsVersionMetadata: Version number, change description, creator, timestampContentAnalysisResult: ML predictions (type, confidence, extracted metadata, PII detection, suggested tags)
Usage Examples
1. Upload a Document
2. Upload with Auto-Classification
3. Download with Permission Check
4. Generate Temporary Download URL
5. Create a New Version
6. Batch Upload
7. Create Document Relationship
8. Search Documents
Storage Path Strategy
Nested S3-Optimized Structure
The package uses a year/month partitioned path structure for optimal object storage performance:
Performance Benefits
- Hot Partition Avoidance: Distributes writes across multiple prefixes instead of all new documents going to one flat folder
- Lifecycle Policies: Easy to archive/delete all documents older than N years using prefix-based S3 lifecycle rules
- Query Performance: Object storage systems index by prefix - nested structure improves list/search operations
- Cost Optimization: Archive old year/month prefixes to Glacier storage class automatically
PathGenerator Service
The Core/PathGenerator service encapsulates all path logic:
Content Processing
ContentProcessorInterface Integration
The package defines a ContentProcessorInterface for extensibility:
Default Implementation (No-Op)
By default, Nexus\Atomy binds a NullContentProcessor that logs warnings:
Future Intelligence Integration
When Nexus\Intelligence is available, simply rebind in DocumentServiceProvider:
Integration with Applications
Atomy Implementation
The apps/Atomy application provides concrete implementations:
Models
Repositories
Service Provider
Dependencies
This package requires:
azaharizaman/nexus-storage(MANDATORY): File operations and temporary URL generationazaharizaman/nexus-crypto(MANDATORY): SHA-256 checksum calculation via HasherInterfaceazaharizaman/nexus-audit-logger(RECOMMENDED): Complete audit trail for all document operationsazaharizaman/nexus-tenant(RECOMMENDED): Multi-tenancy isolation and contextpsr/log(MANDATORY): Logging interface for error/debug logging
Installation
Requirements Coverage
This package fulfills all requirements documented in docs/REQUIREMENTS_DOCUMENT.md including:
- Document CRUD operations with tenant isolation
- Version control with complete history
- Permission-based access control
- Checksum integrity verification
- S3-optimized storage paths
- Batch upload operations
- Document relationship management
- Metadata-based search
- Retention policy integration
- Audit logging for compliance
- Content processing extensibility
Documentation
Core Documentation
- Getting Started Guide - Quick start with prerequisites, core concepts, and troubleshooting
- API Reference - Complete interface and service documentation
- Integration Guide - Laravel and Symfony integration examples
Implementation Details
- Requirements - Complete requirements tracking with status
- Implementation Summary - Progress metrics and design decisions
- Test Suite Summary - Test coverage and testing strategy
- Valuation Matrix - Package valuation metrics
Code Examples
- Basic Usage Examples - 15 common document operations
- Advanced Usage Examples - 18 advanced scenarios
Quick Links
- Package Reference:
docs/NEXUS_PACKAGES_REFERENCE.md - Architecture Overview:
ARCHITECTURE.md - Coding Standards:
.github/copilot-instructions.md
License
MIT License - see LICENSE file for details.
All versions of nexus-document with dependencies
psr/log Version ^3.0
symfony/uid Version ^7.0
azaharizaman/nexus-storage Version dev-main
azaharizaman/nexus-crypto Version dev-main
azaharizaman/nexus-audit-logger Version dev-main
azaharizaman/nexus-tenant Version dev-main