I am asking about the best way to add dashboard module to application software without violating the SOLID principle and clean Architecture principle in general.
My first though is to add layer(Dashboard layer) with is responsible for gathering all statistics from the application layer, but what I notice is Dashboard layer will have more than one reason to change which violate the SRP, in other word the Dashboard layer will be affected by: 1- the dashboard main user (manager) new requirements which is expected. 2- the users of the other modules which we gather the statistics from e.g. Registration module. as a result, any change from the manager or the Registration module will affect the dashboard layer.
A quick response :)
If I understood what you need to do is a Reporting module which will need to read some data of your application. What you call Dashborad layer may be just a new module that you want to add to the application.
Some developers will go quickly to introduce a new Application which will be a Reporting tool of the main one. Which is not bad idea, but what if all what you need is just 1 or 2 dashboards ?
I advise you to start by introducing a new module in your Application.
It is not a part of the Domain. What you are doing is not a new part of the domain. May be you are handling many domains in the application and this dashboard need to access all the data of all these domains.
It is not a part of the infrastructure because it is not a dependency.
=> It is in the other side.
This module is like a new Backend for future Front Application of your dashboards which will consume your data.
The responsability of this module is only agregating and may be transforming data. If you fill that this kind of thing may be done in the Front Application that display dashboards, let's go and start doing it like that. (if consuming the existing Api that you already have fill your need, and time response fill your need) Do not imagine some requirements that are not yet present. And when you feel that things are changing and you need to introduce a Backend for this reporting tool go for it. May be it will responsible to make this kind of aggregation, may persisting data to make reading them more optimized...
The conclusion that the requirement that you have is like a Query Module of your application. It doesn't have any relation with the domain of the Application. It will be nice to make this part a clear part in your Architecture without going quickly to create a new Application. And when you feel it is time to separate it, do it :)