Package Overview
ModularityJS is organized as a monorepo with packages grouped by role.
Core
| Package | Description |
|---|---|
@modularityjs/di | Abstract DI contract — decorators and container interface |
@modularityjs/di-inversify | InversifyJS implementation of the DI contract |
@modularityjs/modularity | Module system — loader, lifecycle, pools, validators |
@modularityjs/plugins | Plugin system with before/after/around interception |
Contracts and Drivers
Each service follows the contract/driver pattern: an abstract contract package and one or more concrete driver packages. See Architecture for details on the two variants (service contracts and module-level contracts).
Service Contracts
| Service | Contract | Drivers |
|---|---|---|
| Cache | @modularityjs/cache | cache-memory, cache-redis |
| Lock | @modularityjs/lock | lock-memory, lock-redis |
| Queue | @modularityjs/queue | queue-memory, queue-redis |
| Storage | @modularityjs/storage | storage-memory, storage-local, storage-s3 |
| Logger | @modularityjs/logger | logger-console |
Module-Level Contracts
| Service | Contract | Driver | Description |
|---|---|---|---|
| HTTP | @modularityjs/http | http-fastify | Pool-based controller discovery with framework-owned decorators |
| CLI | @modularityjs/cli | cli-commander | Pool-based command discovery with Commander.js |
Infrastructure
| Package | Description |
|---|---|
@modularityjs/redis | Shared ioredis client for all Redis drivers |
@modularityjs/config | Scoped configuration with pluggable sources |
@modularityjs/config-env | Environment variable config source |
@modularityjs/database | TypeORM integration with entity pools |
@modularityjs/deployment-config | Static per-module deployment configuration |
Extensions
| Package | Description |
|---|---|
@modularityjs/events | Domain event bus with listener pools |
@modularityjs/scheduler | Cron-based job scheduler with distributed locking |
@modularityjs/health | Health check indicators |
@modularityjs/scope | Scope chain resolver for multi-tenant contexts |
@modularityjs/exception | Structured exception hierarchy |
Facades
| Package | Description |
|---|---|
@modularityjs/core | Re-exports all framework APIs for app developers |
@modularityjs/core-cli | Re-exports all CLI modules |
App developers should import from @modularityjs/core for framework APIs and directly from driver packages for specific drivers.