1. Home
  2. Docs
  3. Developers
  4. System overview
  5. Integration basics

Integration basics

We have the Prototype project (\Convo\Proto) which demonstrates Convoworks integration in the custom, no framework PHP web application.

When you are bootstrapping Convoworks you have to provide it with several implementations. Some are external dependencies that just have to be included in the project (e.g. monolog, php-di), while some should be concrete Convoworks interface implementations for the particular target system.

Service data layer

You have to provide IServiceDataProvider, IServiceParamsFactory and IServiceParams. Service data layer serves for reading and storing all service related data.

Along with CacheInterface implementation you can check or use already provided file system implementation (\Convo\Data\Filesystem package)

Configuration provider

ISystemConfigurationProvider is required to provide system level configuration. Right now we are using it for configuring Amazon API access.

User data layer

User data layer serves for user authentication and saving user related configuration data ( e.g OAuth access tokens for accessing Amazon or Dialogflow APIs). This layer has to be implemented in the target web application where we want to integrate Convoworks.
Example implementations \Convo\Proto\AdminAuthMiddleware for injecting the auth user into request to be available for request handlers, \Convo\Proto\AdminUserDao for accessing actual admin users.

Other classes that can be found in the \Convo\Proto package, like OAuthRestHandler, ServiceUsersRestHandler and ServiceUserDao, are completely in the application domain and could be completely different in your implementation.

Load available component packages is to be determined by the host application which knows where packages are and which are allowed for current user. Example implementation can be found in \Convo\Proto\LoadPackagesMiddleware

Other required facilities

HTTP client factory wraps any PSR-18 compatible Http client into \Convo\Core\Util\IHttpFactory interface which is used in Convoworks itself. We have an example Guzzle implementation in \Convo\Guzzle\GuzzleHttpFactory.

We also use PSR-16 CacheInterface as a simple caching facility. Example implementation can be found in \Convo\Data\Filesystem\FilesystemCache

PSR-11 Container implementation is also required. Autowiring is not required because we reference objects by class name or id.

And last, you have to include a PSR compatible logger (e.g. monolog).

Was this article helpful to you? Yes No

How can we help?