Download the PHP package azaharizaman/nexus-export without Composer
On this page you can find all versions of the php package azaharizaman/nexus-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download azaharizaman/nexus-export
More information about azaharizaman/nexus-export
Files in azaharizaman/nexus-export
Package nexus-export
Short Description Framework-agnostic export/output rendering engine for ERP system
License MIT
Informations about the package nexus-export
Nexus\Export
Framework-agnostic export/output rendering engine for converting structured data into downloadable formats.
Purpose
Nexus\Export is a stateless, atomic package that transforms domain data from any Nexus package into various output formats (PDF, Excel, CSV, JSON, etc.) through a standardized ExportDefinition intermediate representation. The package never knows the source domain (financial statements, payslips, purchase orders) or final usageβit simply converts structured data to the requested format.
This package handles the "getting data out of the system" use case, complementing the planned Nexus\Import package which will handle the reverse process.
Key Design Principles
- Stateless & Atomic: Zero state persistence, zero Laravel dependencies in core
- Schema-Validated: All ExportDefinitions validated against versioned schema before processing
- Resilient: Circuit breaker support for external formatters, rate limiting for webhooks
- Streaming-Capable: Memory-efficient processing of large datasets (100K+ rows)
- Format-Agnostic: Domain packages never reference output formats directly
Architecture
Core Components
Contracts (Public API)
ExportGeneratorInterface- Converts domain data β ExportDefinitionExportFormatterInterface- Converts ExportDefinition β output formatTemplateEngineInterface- Renders templates with variable substitutionExportStorageInterface- File persistenceExportRepositoryInterface- Export history trackingDefinitionValidatorInterface- Schema validationFormatterCircuitBreakerInterface- Failure handling for external formatters
Value Objects
ExportDefinition- Standardized data structure (metadata + structure + styling)ExportMetadata- Author, timestamp, schema version, watermark, security settingsExportSection- Hierarchical section with nesting (0-8 levels)TableStructure- Headers, rows, footers, column widthsExportResult- Execution result with file path, duration, success status
Enums
ExportFormat- PDF, EXCEL, CSV, JSON, XML, HTML, TXT, PRINTERExportDestination- DOWNLOAD, EMAIL, STORAGE, PRINTER, WEBHOOK, DOCUMENT_LIBRARY
Core Engine (Framework-Agnostic)
DefinitionValidator- Validates ExportDefinition against schema v1.0TemplateRenderer- Variable substitution, conditionals, loopsDataTransformer- Array transformations for different formatsCsvFormatter- Streaming CSV generation using PHP generatorsJsonFormatter- UTF-8 JSON with pretty printTxtFormatter- ASCII tabular formatXmlFormatter- Well-formed XML 1.0
Installation
Usage Examples
1. Generate Financial Statement PDF
2. Generate Payslip PDF with Email Delivery
3. Stream Large CSV Export
4. Export from Template
ExportDefinition Schema (v1.0)
Integration Points
With Nexus Packages
- Nexus\Storage - File persistence via
ExportStorageInterface - Nexus\AuditLogger - Log all export operations
- Nexus\Tenant - Multi-tenancy context
- Nexus\Connector - Rate limiting for webhooks, circuit breakers for external services
- Nexus\Notifier - Email delivery of exports
- Nexus\Identity - User context and RBAC
With Domain Packages
- Nexus\Accounting - Financial statement exports
- Nexus\Payroll - Payslip PDF generation
- Nexus\Receivable - Invoice PDFs
- Nexus\Payable - Payment advice documents
- Nexus\Procurement - Purchase order printing
- Nexus\Hrm - Employee directory exports
Performance Targets
- PER-EXP-001: Export 100K rows to CSV < 30s using streaming (< 50MB memory)
- PER-EXP-002: Financial statement PDF generation < 5s for 1K accounts
- PER-EXP-003: Definition validation < 100ms
- PER-EXP-004: Template rendering < 200ms for 1000 variables
Security Features
- Password-protected PDFs for sensitive documents
- Watermarking support for draft/confidential documents
- Digital signatures for finalized statements
- Audit trail for all export operations
- Tenant isolation enforcement
- Rate limiting for webhook/email destinations
Roadmap
Phase 1 (MVP)
- [x] Core package structure
- [ ] ExportDefinition schema v1.0
- [ ] Native formatters (CSV, JSON, TXT, XML)
- [ ] Definition validator
- [ ] Template renderer
- [ ] ExportManager orchestration
Phase 2 (Atomy Integration)
- [ ] PDF formatter (DomPDF)
- [ ] Excel formatter (Maatwebsite/Excel)
- [ ] HTML formatter (Blade templates)
- [ ] Database models & migrations
- [ ] Service provider bindings
Phase 3 (Domain Integration)
- [ ] Financial statement generators
- [ ] Payslip generators
- [ ] Invoice generators
- [ ] Purchase order generators
Phase 4 (Advanced Features)
- [ ] Printer destination support
- [ ] Webhook formatter with circuit breaker
- [ ] Schema versioning (v1.1+)
- [ ] Advanced template builder UI
Documentation
π Complete Documentation
- Getting Started Guide - Quick start tutorial with examples
- API Reference - Complete API documentation for all interfaces, services, and value objects
- Integration Guide - Laravel, Symfony, and custom PHP integration examples
- Basic Usage Examples - Simple export scenarios (CSV, JSON, XML, invoices, large datasets)
- Advanced Usage Examples - Template rendering, custom formatters, nested sections, error handling
π Package Documentation
- REQUIREMENTS.md - Detailed package requirements (42 requirements)
- IMPLEMENTATION_SUMMARY.md - Implementation tracking and metrics
- TEST_SUITE_SUMMARY.md - Test coverage plan (38 unit + 8 integration tests)
- VALUATION_MATRIX.md - Package valuation analysis ($121,600 estimated value)
- DOCUMENTATION_COMPLIANCE_SUMMARY.md - Documentation compliance report
π― Quick Links
- Architecture: See IMPLEMENTATION_SUMMARY.md for ExportDefinition intermediate representation pattern
- Testing: See TEST_SUITE_SUMMARY.md for planned test suite (46 tests)
- Integration: See docs/integration-guide.md for framework integration examples
- Examples: See docs/examples/ for runnable code examples
License
MIT License - See LICENSE file for details