Skip to content

Module Ecosystem

Module Dependency Map

This diagram shows how modules relate to the core package hierarchy and each other.

┌─────────────────────────────────────────────────────────────────┐
│                    Application Layer                             │
│                                                                  │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐          │
│  │   Backend    │  │    Front     │  │  Dashboard   │          │
│  │ (Port 4200)  │  │ (Port 4201)  │  │ (Port 4202)  │          │
│  └──────────────┘  └──────────────┘  └──────────────┘          │
└─────────────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                      Module Layer (29 Modules)                   │
│                                                                  │
│  Operations & Manufacturing (7):                                │
│  ┌──────┐ ┌──────────┐ ┌──────┐ ┌───────┐ ┌──────┐            │
│  │ Jobs │ │Piecework │ │Order │ │ Parts │ │Store │ ...        │
│  └──────┘ └──────────┘ └──────┘ └───────┘ └──────┘            │
│                                                                  │
│  Customer & Supplier (1):     Human Resources (2):             │
│  ┌─────────┐                  ┌────┐ ┌────────┐               │
│  │ CRM-SRM │                  │ HR │ │ Skills │               │
│  └─────────┘                  └────┘ └────────┘               │
│                                                                  │
│  Quality & Compliance (3):    IT & Infrastructure (3):         │
│  ┌─────┐ ┌────┐ ┌─────────┐ ┌────┐ ┌─────────┐ ┌─────┐      │
│  │ NCR │ │ TQ │ │ Health  │ │ IT │ │Hosting │ │ DMS │      │
│  └─────┘ └────┘ └─────────┘ └────┘ └─────────┘ └─────┘      │
│                                                                  │
│  Asset Management (3):        Maintenance (2):                  │
│  ┌────────┐ ┌───────┐ ┌───────┐ ┌────────┐ ┌─────────┐       │
│  │ Assets │ │ Tools │ │ Fleet │ │ Faults │ │ Routine │       │
│  └────────┘ └───────┘ └───────┘ └────────┘ └─────────┘       │
│                                                                  │
│  Business Intelligence (2):   Support & Testing (2):           │
│  ┌─────────┐ ┌──────────┐    ┌────────┐ ┌────────────┐       │
│  │Reports │ │ Projects │    │Ticket │ │Test Leads │       │
│  └─────────┘ └──────────┘    └────────┘ └────────────┘       │
│                                                                  │
│  Configuration (4):                                             │
│  ┌────────┐ ┌───────┐ ┌────────────┐ ┌─────────┐             │
│  │ Manual │ │ Sites │ │ Costsheets │ │ Website │             │
│  └────────┘ └───────┘ └────────────┘ └─────────┘             │
└─────────────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                   App-Specific Core Layer                        │
│                                                                  │
│  ┌────────────────┐ ┌─────────────────┐ ┌──────────────────┐  │
│  │ Backend Core   │ │ Frontend Core   │ │ Dashboard Core   │  │
│  └────────────────┘ └─────────────────┘ └──────────────────┘  │
└─────────────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                  Shared Infrastructure Layer                     │
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐  │
│  │          Gridster Core (Widget System - CRITICAL)        │  │
│  └──────────────────────────────────────────────────────────┘  │
│                            │                                     │
│  ┌──────────────────────────────────────────────────────────┐  │
│  │          Auth Core (ACL, Authentication, Guards)         │  │
│  └──────────────────────────────────────────────────────────┘  │
│                            │                                     │
│  ┌──────────────────────────────────────────────────────────┐  │
│  │      Core (Universal Utilities, Forms, State)            │  │
│  └──────────────────────────────────────────────────────────┘  │
│                            │                                     │
│  ┌──────────────────────────────────────────────────────────┐  │
│  │           SDK (Auto-generated API Client)                │  │
│  └──────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│                        API Layer                                 │
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐  │
│  │     LoopBack 4 API (606 Controllers, 582 Repositories)   │  │
│  │              MySQL Database (PascalCase Tables)           │  │
│  └──────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────┘

Module Categories at a Glance

Operations & Manufacturing (7 modules)

The largest category, handling the core manufacturing operations:

  • Jobs: Central hub for work orders and production tracking
  • Piecework: Piece-rate work tracking
  • Production Line Management: Line configuration
  • Order: Order processing and contracts
  • Parts: Parts catalog
  • Requisition: Purchase requisitions
  • Store: Warehouse management

Inter-module relationships: Jobs ↔ Parts, Order → Jobs, Requisition → Parts

Customer & Supplier Management (1 module)

  • CRM-SRM: Comprehensive relationship management
    • Customers, Suppliers, Partners
    • Contacts, Opportunities, Quotations, POs

Integrates with: Jobs (quotations → orders), Order (PO processing)

Human Resources (2 modules)

  • HR: Employee lifecycle, timesheets, leave management
  • Skills: Skills matrix and training

Inter-module relationships: HR ↔ Skills (employee skills tracking)

IT & Infrastructure (3 modules)

  • IT: Hardware and software asset management
  • Hosting: Server and cloud infrastructure
  • DMS: Document management system

Usage: Used across all other modules for document storage and IT asset tracking

Quality & Compliance (3 modules)

  • NCR: Non-conformance tracking (customer/supplier/internal)
  • TQ: Technical quality assurance
  • Health & Safety: COSHH and safety compliance

Integrates with: Jobs (quality tracking), Parts (COSHH for materials)

Asset Management (3 modules)

  • Assets: General company assets
  • Tools: Production tools with calibration
  • Fleet: Vehicle fleet

Integrates with: Jobs (tool usage tracking), Maintenance modules

Maintenance & Operations (2 modules)

  • Faults: Equipment fault tracking
  • Routine: Scheduled maintenance

Integrates with: Assets, Tools, Fleet (maintenance tracking)

Business Intelligence (2 modules)

  • Reports: Custom reporting engine
  • Projects: Project and task management

Usage: Reports can pull data from any module; Projects used across organization

Support & Services (1 module)

  • Ticket: Help desk and support ticketing

Usage: Internal support for all applications and modules

Testing & Validation (1 module)

  • Test Leads: Test management

Integrates with: Jobs (production testing)

Configuration & Documentation (4 modules)

  • Manual: System documentation
  • Sites: Multi-site configuration
  • Costsheets: Cost estimation
  • Website: Website contact management

Usage: Configuration modules used across system; Manual for documentation

Data Flow Examples

Manufacturing Workflow

CRM-SRM (Quotation)
    → Order (Contract)
    → Jobs (Work Order)
    → Parts (Material requisition)
    → Store (Inventory)
    → Jobs (Production)
    → TQ/NCR (Quality checks)
    → Store (Dispatch)

HR Workflow

HR (Employee creation)
    → Skills (Skill assessment)
    → HR (Training assignment)
    → Skills (Training completion)
    → HR (Timesheet tracking)

Maintenance Workflow

Assets/Tools/Fleet (Asset tracking)
    → Routine (Scheduled maintenance)
    → Faults (Issue logging)
    → Ticket (Support request)
    → Routine (Maintenance completion)

Reporting Workflow

Any Module (Generate data)
    → Reports (Schedule report)
    → Reports (Generate report)
    → Reports (Distribute results)

Module Communication Patterns

Direct API Calls

Modules communicate with the backend through SDK services:

typescript
// Module uses SDK service
this.customerController.apiCustomerControllerFind().subscribe(...)

State Sharing

Modules can share state through NGXS stores:

typescript
// Module A sets state
this.store.dispatch(new SetSelectedCustomer(customer));

// Module B reads state
this.store.select(CustomerState.selectedCustomer).subscribe(...)

Event Bus

Some modules communicate through application-wide events:

typescript
// Module publishes event
this.eventBus.publish('entity:updated', { id, type });

// Module subscribes to event
this.eventBus.subscribe('entity:updated', handler);

Parent-Child Component Communication

Within a module, components communicate through:

  • Input/Output properties
  • Service-based state
  • NGXS state stores

Module Loading Strategy

Lazy Loading

All modules are lazy-loaded:

typescript
// Only loaded when route is accessed
{
  path: 'modules/hr',
  loadChildren: () => import('@barcoding/module-hr')
    .then(m => m.HrModule)
}

Preloading Strategy

Critical modules can be preloaded:

  • Dashboard modules (for quick access)
  • Frequently used modules (HR, Jobs)

Code Splitting

Each module is a separate webpack chunk:

  • module-hr.<hash>.js
  • module-jobs.<hash>.js
  • Common dependencies in shared chunks

Performance Characteristics

Bundle Sizes (Approximate)

  • Small Modules (< 100KB): Manual, Sites, Website
  • Medium Modules (100-300KB): Ticket, Faults, Fleet
  • Large Modules (300-500KB): HR, IT, Tools
  • Extra Large Modules (> 500KB): CRM-SRM, Jobs, Projects

Loading Time

  • Initial bundle: ~2-3s (core packages + app shell)
  • Module lazy load: ~500ms-2s (depending on module size)
  • Total time to interactive: ~3-5s

Memory Usage

  • Average module: ~5-10MB heap
  • Data-heavy modules (Jobs, CRM): ~15-25MB heap
  • Grid-heavy views: Additional ~10-20MB

Module Versioning

All modules follow semantic versioning:

  • Current version: 5.17.0
  • Version sync: All modules share the same version
  • Breaking changes: Major version bump
  • New features: Minor version bump
  • Bug fixes: Patch version bump

Future Module Plans

Potential future modules (based on component analysis):

  • Contracts: Dedicated contract management (currently in Order)
  • Suppliers: Expanded supplier management (split from CRM-SRM)
  • Training: Dedicated training module (expanded from Skills)
  • Compliance: Expanded compliance tracking
  • Analytics: Advanced analytics and BI

Syneo/Barcoding Documentation