Averos Global Initializer

Averos framework introduces a global initializer that is triggered at application startup/reload.
The initializer is part of the core framework module that is loaded from within the application entry point module and which is responsible of initializing all the aspects that are needed by the framework in order to run. The global initializer service will perform the following initializations actions:

  • Initialize and load all entities view layouts using ViewLayoutService
  • Initialize and load the user/default menu using ApplicationMenuService
  • Initialize and load application resources (SVG icons…) using ResourceLoaderService
  • Initialize, configure and load Application Environment Configuration (service to api mapping) using EnvironmentConfiguratorService

🔖 Again, executing ng add @wiforge/averos will configure your application at your stead.
ng g @wiforge/averos:averos-config will add a service to api mapping.

One important thing that is done at application bootstrap level is loading the business entities meta-data.
These entities’ metadata are the core framework data that are needed by the whole application in order to bootstrap all related views, controls and generic behavior.

Besides, Averos comes with predefined entities, which are User and Role, that are involved in the default authentication process.

🔖 Note that averos users can override User and Role by providing their custom entities implementation.

Additional entities can be created and registered within the averos application context by means of the entity decorator @AverosEntity. A set of entity centric decorators are made available by averos in order to handle all entity creation aspects (entity creation, member creation, relationship creation, identifier creation…). Those aspects are detailed in the averos entity section further in this documentation.

🔖 Note that, in order to be averos compliant, a business entity should follow a set of averos convention when created. Those conventions are detailed in the averos entity section further in this documentation.
Although creating a business entity that is compliant with averos could be done manually; we recommend using the averos workflow ng g @wiforge/averos:averos-entity that will take care of all the convention aspects and creates a fully averos compliant business entity at your stead.

🙋‍♂️ Additional entities should be registered within the averos application context by means of a custom application initializer that is triggered before the Global initializer in order to register the related custom entities’ metadata. A custom application initializer will be created for this purpose, when executing the workflow command ng add @wiforge/averos, and which will be responsible of the custom entities registration process at application bootstrap.