Appearance
Statistics module overview
"If you don’t measure, you cannot improve" — Peter Drucker
The Statistics system aims to collect and display statistics about our platform.
We keep records of certain values from the platform which are tracked on a daily basis. This is especially helpful for calculating the growth of our foundation and engagement of our members on the platform. You can find the statistics control panel here.
TIP
Statistics calculated in this module, often make comparisons with the last year corresponding day. From a business perspective not all week days are the same, so it's necessary to make this comparison on the weekday. For this reason, we use subtract 52 weeks to calculate 1 year gaps to calculate the corresponding day of the week. E.g:
- If today is Thursday 3rd of October 2024, then 1 year ago would result in Tuesday 3rd of October 2023
- If today is Thursday 3rd of October 2024, then 52 weeks ago would result in Thursday 5th of October 2023
Deprecation note
We have decided to use the Laravel Nova API to build views of statistics whenever possible. If it’s not possible, we should create/use a "Laravel Nova"-like API.
Technical description
DB Scheme:

We use two models:
Every Statistic model has a related StatisticCalculation implementation to collect statistics. There are two types of statistics values:
- Values that can and should be collected in real time (usually based on
created_at,updated_atand otheraction_atdatetime fields). - Values that shouldn’t be collected in real time and we should instead create snapshots via a cron job (see \App\Modules\Statistic\Console\Commands\CalculateStatisticValues console command).