Application workflow
As stated in the application class overview, Ditsmod provides an API for writing applications with different architectural styles (REST, tRPC, GraphQL, WebSockets, Microservices, etc.). Initialization starts with creating an instance of the application class, and it is at this stage that the configuration accepted by the application class and the order of its assembly are determined.
The initialization stages of applications with different architectural styles may differ, but as a rule, the following happens:
- Application scanning using the ModuleManager starts from the root module.
- Decorators of the root module, feature modules, and init decorators allow attaching certain metadata to module classes. During application scanning, this metadata is normalized and validated.
- Then the AppInitializer analyzes this metadata, collects providers, and runs extensions.
- Application initialization is completed in the Application class, the web server is started, and the application begins operating in normal mode, accepting HTTP requests.