Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Integration Engine Laravel Package

carlosgude/integration-engine

IntegrationEngine standardizes external API integrations in Symfony: each endpoint is a predictable Action with a Request and Response DTO + Mapper. Includes scaffolding commands to generate integrations and actions, keeping HTTP/mapping logic consistent and maintainable.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Symfony-first design: The package is architected for Symfony 7.0+ (PHP 8.2+), aligning with modern Symfony’s dependency injection, configuration, and bundle systems. This ensures seamless integration with existing Symfony applications, reducing friction in adoption.
  • Hexagonal/clean architecture principles: The package enforces a clear separation between:
    • Infrastructure (API clients, DTOs, adapters)
    • Domain (gateways, business logic)
    • Application (controllers, services) This mitigates "integration rot" by isolating API-specific logic from domain models.
  • Predictable structure: The enforced directory layout ({Name}/Action/Request/, Response/, Dto/) reduces cognitive load for developers, making onboarding and maintenance easier. This is particularly valuable for teams with multiple integrations.
  • Anti-corruption layer (ACL): The Gateway pattern (e.g., MyApiGateway) acts as a buffer between domain models and external API changes, minimizing breaking changes in the domain layer.

Integration Feasibility

  • Symfony Flex compatibility: The bundle auto-registers via Symfony Flex, simplifying installation and reducing manual configuration.
  • Minimal boilerplate: The make:integration command generates all necessary classes (Action, Mapper, Response) interactively, reducing setup time.
  • Adapter extensibility: Supports REST, GraphQL, and custom adapters (e.g., SOAP) via ClientAdapterInterface, making it adaptable to diverse API types.
  • Configuration-driven: Centralized YAML configuration (integration_engine.yaml) for base URLs, auth, and action mappings reduces hardcoding and improves maintainability.

Technical Risk

  • Symfony 7.0+ dependency: If the application uses an older Symfony version (e.g., 6.x), migration effort may be required (e.g., updating HttpClient, Cache, or DI components).
  • Learning curve for strict structure: Teams accustomed to ad-hoc HTTP clients or scattered integration logic may resist the enforced discipline, though this is mitigated by the scaffolding tool.
  • GraphQL limitations: The built-in GraphQLClientAdapter does not support batching (sendMany), requiring custom adapters for concurrent GraphQL requests.
  • Cache behavior under PHP-FPM: Token caching is process-local by default, which could lead to rate-limiting issues for APIs with strict token endpoint quotas (mitigated by configuring a shared cache like Redis).
  • Dynamic auth complexity: While dynamic auth (e.g., OAuth2) is handled automatically, edge cases (e.g., token revocation mid-request) require understanding of the DynamicAuthHandler and cache eviction logic.

Key Questions

  1. API diversity: Does the application integrate with REST, GraphQL, SOAP, or other protocols? If so, are custom adapters needed, and is the team comfortable extending the package?
  2. Symfony version: Is the application on Symfony 7.0+? If not, what’s the upgrade path for dependencies like HttpClient or Cache?
  3. Concurrency needs: Are there performance requirements for parallel API calls (e.g., bulk operations)? If so, does the default rest adapter suffice, or is a custom BatchClientInterface implementation needed?
  4. Auth complexity: Are there OAuth2 or session-based auth flows? If yes, how will token revocation and shared caching (e.g., Redis) be configured?
  5. Testing strategy: How will integrations be tested? The package includes a TESTING.md guide, but teams may need to adapt their test suites to mock the IntegrationRegistry or IntegrationEngine.
  6. Monitoring/observability: How will API failures (e.g., timeouts, 4xx/5xx responses) be logged or alerted? The package uses Symfony’s LoggerInterface, so existing logging infrastructure can be leveraged.
  7. Domain model stability: Are domain models likely to change frequently? If so, the ACL (Gateway) pattern will help, but teams must discipline themselves to update gateways rather than domain models directly.

Integration Approach

Stack Fit

  • Symfony ecosystem: The package is a perfect fit for Symfony applications, leveraging its DI container, configuration system, and bundle architecture. It integrates with:
    • Symfony’s HttpClient (for REST)
    • Symfony’s Cache component (for token caching)
    • Symfony’s Serializer (for DTO mapping, if used)
  • PHP 8.2+ features: Uses named arguments, constructor property promotion, and typed properties, which align with modern PHP practices.
  • Composer dependencies: Minimal external dependencies (only Symfony components and PHP HTTP client), reducing bloat.

Migration Path

  1. Assessment phase:
    • Audit existing API clients to identify repetitive patterns (e.g., request builders, mappers, auth logic).
    • Categorize integrations by type (REST, GraphQL, SOAP) to determine adapter needs.
  2. Pilot integration:
    • Select a non-critical API (e.g., a reporting endpoint) to test the package.
    • Use make:integration to scaffold the integration and compare the generated code to existing clients.
    • Implement a Gateway to verify the ACL pattern works for the domain model.
  3. Incremental rollout:
    • Replace one integration at a time, starting with the most complex or frequently changed APIs.
    • Gradually migrate auth logic (e.g., from manual token handling to dynamic auth in YAML).
  4. Testing:
    • Update unit tests to mock the IntegrationRegistry and IntegrationEngine.
    • Add integration tests to verify end-to-end flows (e.g., GatewayIntegration → external API).
    • Test failure scenarios (e.g., API timeouts, auth failures) to ensure proper error handling.

Compatibility

  • Symfony components: Compatible with Symfony 7.0+ (tested up to the last release). For Symfony 6.x, some manual adjustments may be needed (e.g., HttpClient v6.x).
  • PHP versions: Requires PHP 8.2+ (uses features like array_key_first, Stringable).
  • Existing integrations: The package does not enforce breaking changes on domain models or business logic, only on how integrations are implemented. Existing controllers/services can depend on the new Gateway classes without modification.
  • Third-party packages: No known conflicts with popular Symfony packages (e.g., API Platform, NelmioCors). However, if other packages use HttpClient or Cache, ensure namespace collisions are avoided.

Sequencing

  1. Setup:
    • Install the package: composer require carlosgude/integration-engine.
    • Configure integration_engine.yaml with base URLs and auth settings.
  2. Scaffold integrations:
    • Use make:integration to generate boilerplate for each API.
    • Customize Action, Mapper, and Response classes as needed.
  3. Implement gateways:
    • Create Gateway classes to map API DTOs to domain models.
    • Update application code to depend on gateways instead of raw integrations.
  4. Configure auth:
    • Migrate static auth (e.g., API keys) to YAML configuration.
    • Implement dynamic auth (e.g., OAuth2) by defining token actions and cache settings.
  5. Test and iterate:
    • Verify single requests (send()) and batch requests (sendMany()).
    • Test error handling and retries (e.g., 401 responses for dynamic auth).
  6. Monitor and optimize:
    • Add logging for API calls (e.g., request/response payloads, latency).
    • Tune cache settings (TTL, shared cache for tokens) based on API rate limits.

Operational Impact

Maintenance

  • Reduced boilerplate: The package eliminates repetitive code for HTTP clients, request builders, and mappers, reducing maintenance overhead.
  • Centralized configuration: Auth, base URLs, and action mappings are defined in YAML, making changes easier to track and deploy.
  • Predictable structure: The enforced directory layout and naming conventions simplify navigation and onboarding for new developers.
  • Isolated changes: Updates to external APIs only require changes to Action, Mapper, or Gateway classes, not domain models or business logic.

Support

  • Debugging: The package provides clear error messages (e.g., PathResolutionException, IntegrationGeneratorException) and integrates with Symfony’s error handler.
  • Logging: Supports Symfony’s LoggerInterface, allowing teams to log API calls, failures, and performance metrics.
  • Documentation: Includes comprehensive README.md, DOCUMENTATION.md, and a demo repository (integrationEngine-use-example), though some topics (e.g., custom adapters) may require deeper exploration.
  • Community: Low star count (9) and no dependents suggest limited community support, but the MIT license allows forking or contributions if needed.

Scaling

  • Concurrency: The sendMany() method enables parallel API calls for the rest adapter, improving throughput for batch operations. GraphQL requires a custom adapter for true concurrency.
  • Rate limiting: The package handles token caching and retries for dynamic auth, but teams must configure shared caches (e.g., Redis) for PHP-FPM environments to avoid per-worker rate limits.
  • **Performance
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi