Nexus is a package-only monorepo containing 50+ atomic, reusable PHP packages for building Enterprise Resource Planning (ERP) systems. Each package is framework-agnostic, making them usable with Laravel, Symfony, Slim, or any other PHP framework.
The core philosophy of Nexus is Framework Agnosticism. Business logic should be portable and reusable across different frameworks and applications.
- π― Pure Business Logic: Packages contain only business rules and domain logic
- π Interface-Driven: All external dependencies defined as contracts
- π¦ Atomic & Publishable: Each package can be published independently to Packagist
- π§ͺ Testable: Pure PHP logic with mockable dependencies
- π Framework-Agnostic: Works with Laravel, Symfony, or any PHP framework
All packages in packages/ are self-contained units of functionality designed to be:
- Framework-Agnostic: Pure PHP 8.3+ logic with no framework dependencies
- Persistence-Agnostic: No migrations or models - data access defined via interfaces
- Publishable: Each package can be published independently to Packagist
- Contract-Driven: All external dependencies injected as interfaces
- Stateless: Long-term state externalized via storage interfaces
Nexus\Tenant- Multi-tenancy context and isolation engineNexus\Setting- Global and tenant-specific configuration managementNexus\Sequencing- Auto-numbering with atomic counter managementNexus\Period- Fiscal period management and transaction validationNexus\AuditLogger- Timeline feeds and audit trailsNexus\EventStream- Event sourcing for critical domains (Finance GL, Inventory)Nexus\Uom- Unit of measurement management and conversionNexus\Monitoring- Observability with telemetry, health checks, alerting, SLO tracking
Nexus\Identity- Authentication, RBAC, MFA, session/token managementNexus\Crypto- Cryptographic operations and key managementNexus\Audit- Advanced audit capabilities (extends AuditLogger)
Nexus\Finance- General ledger, journal entries, double-entry bookkeepingNexus\Accounting- Financial statements, period close, consolidationNexus\Receivable- Customer invoicing, collections, credit controlNexus\Payable- Vendor bills, payment processing, 3-way matchingNexus\CashManagement- Bank reconciliation, cash flow forecastingNexus\Budget- Budget planning and variance trackingNexus\Assets- Fixed asset management, depreciationNexus\Currency- Multi-currency management and exchange rates
Nexus\Sales- Quotation-to-order lifecycle, pricing engineNexus\Inventory- Stock management with lot/serial trackingNexus\Warehouse- Warehouse operations and bin managementNexus\Procurement- Purchase requisitions, POs, goods receiptNexus\Manufacturing- Bill of materials, work orders, MRPNexus\Product- Product catalog, pricing, categorization
Nexus\Hrm- Leave, attendance, performance reviewsNexus\Payroll- Payroll processing frameworkNexus\PayrollMysStatutory- Malaysian statutory calculations (EPF, SOCSO, PCB)
Nexus\Party- Customers, vendors, employees, contactsNexus\Crm- Leads, opportunities, sales pipelineNexus\Marketing- Campaigns, A/B testing, GDPR complianceNexus\FieldService- Work orders, technicians, service contracts
Nexus\Connector- Integration hub with circuit breaker, OAuthNexus\Workflow- Process automation, state machinesNexus\Notifier- Multi-channel notifications (email, SMS, push, in-app)Nexus\Scheduler- Task scheduling and job managementNexus\DataProcessor- OCR, ETL interfaces (interface-only package)Nexus\Intelligence- AI-assisted automation and predictionsNexus\Geo- Geocoding, geofencing, routingNexus\Routing- Route optimization and caching
Nexus\Reporting- Report definition and execution engineNexus\Export- Multi-format export (PDF, Excel, CSV, JSON)Nexus\Import- Data import with validation and transformationNexus\Analytics- Business intelligence, predictive modelsNexus\Document- Document management with versioning
Nexus\Compliance- Process enforcement, operational complianceNexus\Statutory- Reporting compliance, statutory filingNexus\Backoffice- Company structure, offices, departmentsNexus\OrgStructure- Organizational hierarchy management
Nexus\Storage- File storage abstraction layerNexus\ProjectManagement- Projects, tasks, timesheets, milestonesNexus\FeatureFlags- Feature flag management
- PHP 8.3+
- Composer
-
Clone the repository:
git clone <repository-url> nexus cd nexus
-
Install Dependencies:
composer install
-
Explore Packages:
# Browse available packages ls packages/ # Read package documentation cat packages/Tenant/README.md cat packages/Finance/README.md
Each package can be installed independently in your PHP application:
# In your Laravel, Symfony, or other PHP application
composer require nexus/tenant
composer require nexus/finance
composer require nexus/receivablePackages define interfaces, your application provides implementations:
// Package defines the interface
namespace Nexus\Tenant\Contracts;
interface TenantRepositoryInterface
{
public function findById(string $id): ?TenantInterface;
public function save(TenantInterface $tenant): void;
}
// Your Laravel application implements it
namespace App\Repositories;
use Nexus\Tenant\Contracts\TenantRepositoryInterface;
use Nexus\Tenant\Contracts\TenantInterface;
use App\Models\Tenant;
final class EloquentTenantRepository implements TenantRepositoryInterface
{
public function findById(string $id): ?TenantInterface
{
return Tenant::find($id);
}
public function save(TenantInterface $tenant): void
{
Tenant::updateOrCreate(['id' => $tenant->getId()], [
'name' => $tenant->getName(),
'status' => $tenant->getStatus()->value,
]);
}
}
// Bind in service provider
$this->app->bind(
TenantRepositoryInterface::class,
EloquentTenantRepository::class
);use Nexus\Tenant\Contracts\TenantContextInterface;
use Nexus\Finance\Contracts\GeneralLedgerManagerInterface;
class InvoiceController
{
public function __construct(
private readonly TenantContextInterface $tenantContext,
private readonly GeneralLedgerManagerInterface $glManager
) {}
public function store(Request $request)
{
$tenantId = $this->tenantContext->getCurrentTenantId();
// Use package business logic
$this->glManager->postJournalEntry($journalEntry);
}
}- No Laravel, Symfony, or framework-specific code in packages
- Use PSR interfaces (
psr/log,psr/http-client,psr/cache) - All framework integration happens in consuming applications
- Packages define needs via interfaces
- Consuming applications provide implementations
- Dependency injection for all external dependencies
- No session state in package classes
- Long-term state externalized via storage interfaces
- Horizontally scalable by design
- PHP 8.3+ with strict types
- Constructor property promotion
- Readonly properties for dependencies
- Native enums for fixed value sets
- Match expressions over switch statements
- ARCHITECTURE.md - Architectural guidelines and rules
- docs/NEXUS_PACKAGES_REFERENCE.md - Complete package capabilities reference
- .github/copilot-instructions.md - Development guidelines
- Package READMEs - Individual package documentation (e.g.,
packages/Finance/README.md)
Please refer to ARCHITECTURE.md for detailed architectural guidelines.
- Packages must be framework-agnostic - No Laravel, Symfony, or framework-specific code
- Packages define persistence needs via Contracts - No migrations or models in packages
- All dependencies must be interfaces - Use dependency injection
- Modern PHP 8.3+ standards - Use latest language features
- Consult NEXUS_PACKAGES_REFERENCE.md - Avoid reimplementing existing functionality
- Create
packages/NewPackage/directory - Run
composer init(require"php": "^8.3") - Define PSR-4 autoloader:
"Nexus\\NewPackage\\": "src/" - Create
src/Contracts/,src/Services/,src/Exceptions/ - Write comprehensive
README.mdwith usage examples - Add MIT
LICENSEfile - Update root
composer.jsonrepositories array
This project is licensed under the MIT License - see the LICENSE file for details.
- Package Reference Guide: docs/NEXUS_PACKAGES_REFERENCE.md
- Architecture Documentation: ARCHITECTURE.md
- Implementation Summaries:
docs/*_IMPLEMENTATION_SUMMARY.md
Nexus - Building the future of modular ERP systems with framework-agnostic PHP packages.