Skip to content

Stats interface#11

Merged
pixup1 merged 31 commits intodevfrom
stats-interface
Nov 7, 2025
Merged

Stats interface#11
pixup1 merged 31 commits intodevfrom
stats-interface

Conversation

@pixup1
Copy link
Copy Markdown
Member

@pixup1 pixup1 commented Jan 29, 2025

Add an interface for visualizing statistics, as well as the backend API endpoints to fetch them. Since #15 was merged, it also adds a Data Management tab that makes it possible to download and restore backups of the database.

Fix #3
Fix #13

@pixup1 pixup1 self-assigned this Jan 29, 2025
@pixup1 pixup1 linked an issue Jan 29, 2025 that may be closed by this pull request
@Ecnama Ecnama force-pushed the stats-logger branch 2 times, most recently from b9c5bf0 to 37cff11 Compare January 31, 2025 10:37
@pixup1 pixup1 force-pushed the stats-interface branch 2 times, most recently from 2375f86 to c347fdb Compare February 5, 2025 13:24
Base automatically changed from stats-logger to dev October 28, 2025 16:43
@Ecnama
Copy link
Copy Markdown

Ecnama commented Nov 4, 2025

I think matchId is not really readable as a user, and it could be replaced by more usable information in some cases :

  • In the player stats view : I think opponent and timestamp would be better
image
  • In the match stats view : teams name could be bigger, and the matchId smaller, under the score, and maybe copyable ?
image
  • In the matches view : matchId could be somewhere else (in 4th-5th column ?) as it is not what players will seek first
image

@Ecnama
Copy link
Copy Markdown

Ecnama commented Nov 4, 2025

Could the switch and the vertical bar be aligned ? Or does it look worse ?

image

@Ecnama
Copy link
Copy Markdown

Ecnama commented Nov 4, 2025

K/D, HS% and ADR should all be formatted with two decimals, as they are all float

@pixup1
Copy link
Copy Markdown
Member Author

pixup1 commented Nov 4, 2025

Player names should be displayed below team names in the match view

EDIT: this is normal because the teams table is empty

@pixup1
Copy link
Copy Markdown
Member Author

pixup1 commented Nov 4, 2025

Date should be displayed in DD/MM/YYYY format

@pixup1
Copy link
Copy Markdown
Member Author

pixup1 commented Nov 4, 2025

Could the switch and the vertical bar be aligned ? Or does it look worse ?

idk how to do that but i don't think it really matters tbh lol

@pixup1
Copy link
Copy Markdown
Member Author

pixup1 commented Nov 5, 2025

TODO: show "No data" in table when empty.

@pixup1 pixup1 marked this pull request as ready for review November 6, 2025 21:04
@pixup1 pixup1 requested review from Ecnama and Copilot November 6, 2025 21:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive statistics tracking and data management features to the Tournament Match Tracker application, including player stats, match stats, database management capabilities, and significant UI improvements.

Key changes:

  • Statistics tracking system with player/match stats APIs and frontend pages
  • Database management features (download, upload, delete operations)
  • UI/UX improvements including new navigation, logo updates, and improved 404 page
  • New dependencies: multer for file uploads and node-cache for caching

Reviewed Changes

Copilot reviewed 32 out of 44 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
backend/src/statsController.ts New controller providing REST endpoints for statistics queries
backend/src/storageController.ts New controller for database download/upload/management operations
backend/src/statsLogger.ts Enhanced with caching and query functions for stats retrieval
backend/src/storage.ts Added DB download, replace, and empty operations
frontend/src/pages/stats.tsx New comprehensive stats pages for matches and players
frontend/src/pages/dataManagement.tsx New page for database management operations
frontend/src/components/StatsTable.tsx Reusable table component with sorting, filtering, and grouping
frontend/src/utils/uploadUserFile.ts Utility for file upload via browser
frontend/src/utils/mustConfirm.tsx Confirmation modal utility (refactored from .ts)
common/types/stats.ts Type definitions for player and match statistics
Files not reviewed (2)
  • backend/package-lock.json: Language not supported
  • frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/utils/uploadUserFile.ts Outdated
Comment thread frontend/src/utils/uploadUserFile.ts
Comment thread frontend/src/components/StatsTable.tsx Outdated
Comment thread backend/src/storage.ts Outdated
Comment thread frontend/src/App.tsx Outdated
@pixup1
Copy link
Copy Markdown
Member Author

pixup1 commented Nov 6, 2025

thx @copilot ur da best <3 (don't take my job pls)

Copilot AI mentioned this pull request Nov 6, 2025
@InsaLan InsaLan deleted a comment from Copilot AI Nov 6, 2025
Comment thread backend/src/statsLogger.ts Outdated
Comment thread frontend/src/components/StatsTable.tsx
@pixup1 pixup1 requested a review from Ecnama November 7, 2025 08:08
Copy link
Copy Markdown

@Ecnama Ecnama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pixup1 pixup1 merged commit fdc96b7 into dev Nov 7, 2025
Ecnama added a commit that referenced this pull request Nov 10, 2025
* Add stats page

* Add backend API endpoints for stats

* Add players and matches stats pages

* Working stats views

* Add match-specific stats page

* Add player-specific stats view

* Group stats by match in player stats

* Factorize stats tables

* Add ability to sort by column

* Handle errors (a bit) better

* Handle 404s

* Improve frontend error handling

* Adapt stats for new tables

* Add team players to match view

* Insalan rebrand + highlight current tab

* Fix logo color + tweak title

* Add proper 404 page

* Add copy steamID button

* Change error color to theme coor

* Fix messed up rebase

* Fix data table name and clean files

* Various stats fixes + add color to stats

* Add data management page (#15)

* Add stats management page

* Make DB download functional + reorganize data management layout

* Add confirmation modal for database operations

* Replace and factorize confirmation modal

* Authenticate frontend routes

* Implement DB management functions

* Revert 2e241a1 because it's annoying and not really useful

* Add empty message to stats table + forbid editing database while matches are live

* Invalidate cache on DB operations

* Center float in table

* Add stats search bar and links in details

* Fix a few things

* Fix colors in light theme

* Fix DB replacement

---------

Co-authored-by: Ecnama <amance.github@famille-graindorge.fr>
@Ecnama Ecnama deleted the stats-interface branch November 10, 2025 12:39
Ecnama added a commit that referenced this pull request Nov 10, 2025
* Add stats page

* Add backend API endpoints for stats

* Add players and matches stats pages

* Working stats views

* Add match-specific stats page

* Add player-specific stats view

* Group stats by match in player stats

* Factorize stats tables

* Add ability to sort by column

* Handle errors (a bit) better

* Handle 404s

* Improve frontend error handling

* Adapt stats for new tables

* Add team players to match view

* Insalan rebrand + highlight current tab

* Fix logo color + tweak title

* Add proper 404 page

* Add copy steamID button

* Change error color to theme coor

* Fix messed up rebase

* Fix data table name and clean files

* Various stats fixes + add color to stats

* Add data management page (#15)

* Add stats management page

* Make DB download functional + reorganize data management layout

* Add confirmation modal for database operations

* Replace and factorize confirmation modal

* Authenticate frontend routes

* Implement DB management functions

* Revert 2e241a1 because it's annoying and not really useful

* Add empty message to stats table + forbid editing database while matches are live

* Invalidate cache on DB operations

* Center float in table

* Add stats search bar and links in details

* Fix a few things

* Fix colors in light theme

* Fix DB replacement

---------

Co-authored-by: Ecnama <amance.github@famille-graindorge.fr>
Ecnama added a commit that referenced this pull request Dec 3, 2025
* Add stats page

* Add backend API endpoints for stats

* Add players and matches stats pages

* Working stats views

* Add match-specific stats page

* Add player-specific stats view

* Group stats by match in player stats

* Factorize stats tables

* Add ability to sort by column

* Handle errors (a bit) better

* Handle 404s

* Improve frontend error handling

* Adapt stats for new tables

* Add team players to match view

* Insalan rebrand + highlight current tab

* Fix logo color + tweak title

* Add proper 404 page

* Add copy steamID button

* Change error color to theme coor

* Fix messed up rebase

* Fix data table name and clean files

* Various stats fixes + add color to stats

* Add data management page (#15)

* Add stats management page

* Make DB download functional + reorganize data management layout

* Add confirmation modal for database operations

* Replace and factorize confirmation modal

* Authenticate frontend routes

* Implement DB management functions

* Revert 2e241a1 because it's annoying and not really useful

* Add empty message to stats table + forbid editing database while matches are live

* Invalidate cache on DB operations

* Center float in table

* Add stats search bar and links in details

* Fix a few things

* Fix colors in light theme

* Fix DB replacement

---------

Co-authored-by: Ecnama <amance.github@famille-graindorge.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backup database Add frontend scoreboard

3 participants