Skip to content

Commit

Permalink
Statistics and graphs (#971)
Browse files Browse the repository at this point in the history
* feat(frontend): only send gql request if item visible

* feat(frontend): select colors from predefined

* chore(config,providers): remove deprecated config variable

* chore(database): remove old migration files

* chore(backend): update migrations to new major version

* feat(migrations): add new migration to track v7 upgrade

* chore(backend): change applied time for v6 main migrations

* feat(migrations): add new migration for weekly stats

* fix(backend): show correct log

* feat(migrations): make statistics a materialized view

* chore(migrations): export constant for view name

* feat(services): refresh materialized view periodically

* chore(migrations): drop views/indices before creating them

This ensures that the migration can be re-used later.

* fix(migrations): change name of columns

* chore(migrations): change structure of contained data

* feat(backend): create entity for querying

* refactor(migrations): convert weekly table to daily

* feat(backend): add resolver

* chore(backend): change name of column

* feat(graphql): add query for user activities

* build(frontend): update deps

* build(backend): upgrade deps

* feat(frontend): adjust to new remix APIs

* chore(migrations): change name of column

* chore(database): adapt to new db schema

* chore(graphql): adapt to new backend gql schema

* chore(backend): change type of a column

* feat(backend): fetch correct data for ranges

* feat(migrations): add new dashboard section

* fix(backend): get daily activities in the correct order

* fix(migrations): do not coalesce for seen

* refactor(frontend): include mantine chart css in root

* fix(ts-utils): export more functions

* feat(frontend): add new key

* feat(frontend): display basic graph

* chore(ts-utils): remove useless import

* fix(frontend): change color of series label

* feat(frontend): display text when no activity

* fix(frontend): use correct conditional

* feat(graphql): also fetch the total counts

* feat(frontend): better data display

* fix(migrations): add new section to the top of dashboard

* feat(migrations): include time of day in view

* feat(migrations): query to not include duplicate elements

* fix(migrations): cast columns as bigint

* fix(migrations): create json structure

* feat(backend): allow querying for time of day

* fix(migrations): include hour in query

* chore(models,graphql): adapt to new database schema

* feat(frontend): add more plugins to dayjs

* feat(frontend): use new component for loading

* feat(frontend): better display when no data

* feat(frontend): display total entries

* refactor(frontend): extract function to get time of day

* feat(frontend): import more lodash

* feat(frontend): display most active time of day

* refactor(migrations): change name of file

* feat(backend): enhance response for user activities

* chore(frontend): adapt to new gql schema

* chore(database): hide hour counts from response

* feat(services): return grouped by for user activities

* refactor(frontend): extract enum to generals module

* feat(frontend): select for changing timespan

* chore(frontend): remove conditional

* feat(frontend): allow actual control using select

* fix(backend): return correct total count

* feat(services): add tokio dep

* fix(frontend): change size of label

* fix(services): do not order again

* feat(migrations): change how metadata is counted

* fix(migrations): select distinct hours

* fix(services): set the most active hour correctly

* fix(services): make most active hour column nullable

* fix(frontend): adapt to new gql schema

* fix(migrations): calculations for daily user activity

* fix(services): remove unwrap

* chore(services): change name of function

* fix(frontend): handle cases when no data

* docs: add migration docs for v7

* feat(frontend): change tick format when grouped by is changed

* feat(services): changed grouped by value dynamically

* chore(migrations): more consistent sql statements

* fix(frontend): do not use localstorage hook from mantine

* chore(migrations): add todo comment

* perf(services): fetch only the required fields

* fix(services): remove extra filter

* fix(services): fetch the correct field

* feat(services): complete grouping for activities

* fix(backend): sort items by key

* perf(frontend): load stats only when in viewport

* refactor(services): move function into utils module

* fix(frontend): adjust for small screens

* fix(backend): set correct rust log level

* fix(frontend): display only month in graph

* refactor(frontend): remove repeated code

* chore(migration): change name of migration

* chore(migrations): add new file

* feat(migrations): add new daily user activity table

* fix(migrations): change order of columns

* chore(migrations): remove materialized view

* chore(services): do not refresh materialized view

* refactor(backend): change names of functions

* fix(frontend): adapt to new gql schema

* perf(backend): use more limits in summary calculation

* refactor(services,resolvers): extract new service and resolver for statistics

* chore(migrations): remove unused deps

* refactor(services): move summary calculation and querying to statistics service

* refactor(services): change name of function

* perf(services): do not own value

* refactor(services): add new fn for user statistics calc

* feat(frontend): calculate color from measurement name

* feat(models): add duration column to daily user activities

* feat(services): add new grouping method

* chore(frontend): adapt to new gql schema

* fix(services): change grouping logic for daily user activities

* chore(providers): format file

* feat(migrations): add index to new table

* perf(utils): do not allocate beforehand

* feat(services): process workouts, measurements and reviews

* fix(services): delete all old user activities if calculating from begin

* refactor(services): common function to update activity count

* feat(services): handle seen items

* refactor(database): change data types of columns

* fix(services): add correct ordering before quering

* chore(services): bring back summary calculation

* fix(services): do not specify useless attribute

* chore(services): do not allocate extra closure

* chore(services): change order of function calling

* fix(services): get default summary if not exists

* chore(database): remove useless column

* perf(services): fetch only the required columns

* refactor(services): do not declare new model

* fix(services): better processing of elements

* refactor(backend): better imports

* refactor(resolvers): specify dependencies explicitly

* refactor(backend): move stuff to common module

* refactor(backend): add explicit imports from services

* refactor: utils simgle removed

* chore(backend): add more imports

* chore(models): remove common crate

* chore(backend): use correct path for imports

* feat(migrations): add duration column to workouts

* feat(backend): adapt to new database schema

* feat(frontend): do not calculate duration manually

* fix(services): handle generated column correctly

* fix(statistics): use new column for calculations

* chore(migrations): order of imports

* docs: add info about final version

* perf(backend): only get collection name

* fix(frontend): add negative margin for small screens

* refactor(services): create a collection service

* style(frontend): get rid of identity function

* Revert "chore(database): remove useless column"

This reverts commit 4da924d.

* dev: install zip in devcontainer

* chore(services): start adding duration to stats

* chore(backend): addressed more backend type errors

* chore: extract seen stream to function

* chore(services): add common utils

* feat(statistics): update activity counts

* fix(statistics): rename one metadata column

* feat(statistics): calculate duration for activity

* feat(backend): return total duration for selected range

* feat(frontend): display duration consumed

* feat(frontend): center text for total stat

* fix(services): handle correct workout duration

* chore(frontend): minor spacing issues

* refactor(services): move preferences away

* refactor(services,resolvers): new stuff for user related operations

* feat(frontend): add discord link in footer

* chore(backend): do not return author name

* ci: add opencontainers description

* build(backend): update deps

* build(frontend): update deps

* chore(migrations): add comment about unit of storage

Run CI.

* chore(frontend): use dayjs for duration conversion

* chore(backend): update deps

* chore(services): rename variables

* build(backend): remove usage of outdated crate for base url

* fix(utils): do not use base url

* chore(providers): explicitly provide base url

* chore(integrations): adapt to new reqwest usage

* chore(importer): use new reqwest requirements

* chore(frontend): add negative margin for all screens

* chore(frontend): change order of props

* feat(common-utils): create new macro for common logging

* feat(backend): use new logger

* feat(backend*): use new logger

* feat(miscellaneous): use new logger

* feat(migrations): change structure of daily user activity table

* chore(migrations): add space

* chore(migrations): add dev comments

* chore(backend): remove more fields

* feat(services): new calculation for daily user activities

* build(dependent-models): add strum as dep

* feat(dependent): add `Display` derive on enum

* chore(services/collection): do not use old API

* feat(backend): use better optimized totalling strategy

* feat(services): get item counts

* chore(services): log which item is being processed

* chore(services): log which item is being processed

* chore(backend): do not keep track of most active hour

* chore(frontend): adapt to new gql schema

* chore(frontend): formatting issues

* feat(backend): allow grouping by millenium

* feat(migrations): add new metadata counts column

* chore(frontend): handle new enum variant

* feat(backend): calculate generated columns in application code

* chore(migrations): order of declarations

* feat(backend): add entity lot to review

* fix(backend): update review counts correctly

* refactor(statistics): do not send more data than necessary

* fix(frontend): adapt to new gql schema

* chore(migrations): add columns for new metrics to track

* chore(backend): make total of summary non nullable

* chore(frontend): adapt to new gql schema

* feat(backend): store more total stats now

* refactor(services): do not explicitly use `SimpleExpr::FunctionCall`

Run CI.

* perf(statistics): do not perform DB query if group by is already supplied

* chore(backend):  change name of column

* chore(backend): fetch more columns and calculations

* feat(services): fetch all columns necessary

* chore(statistics): remove models

* chore(statistics): user summary now returns daily user activites grouped by millenium

* chore(graphql): adapt to new backend gql schema

* chore(frontend): adapt to new gql schema

* feat(*): more calculation changes

* chore(*): remove old user summary stuff

* chore(*): remove metadata units consumed stuff

* refactor(statistics): hardcode a default date for items without a finished on date

* fix(services): select the correct element

* feat(frontend): format the number being displayed
  • Loading branch information
IgnisDa committed Aug 24, 2024
1 parent 5ef81a7 commit e31071f
Show file tree
Hide file tree
Showing 120 changed files with 4,859 additions and 3,772 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ignisda/archlinux:latest

RUN npm install --global yaml-language-server@next
RUN paru -Syy --noconfirm caddy postgresql
RUN paru -Syy --noconfirm caddy postgresql zip
RUN cargo binstall sea-orm-cli --locked --secure --no-confirm
RUN curl -L https://fly.io/install.sh | sh
RUN fish_add_path -Ua "/home/$USERNAME/.fly/bin"
Expand Down
Loading

0 comments on commit e31071f

Please sign in to comment.