Skip to content

[Feature]: Add exportable Points & Activity Audit Log for transparency into score changes #643

Description

@Priyanka0205-CSE

Feature Description

Description

Users have no way to see a history of how their points/HubCoins changed over time — only the current total is shown. There's no audit trail distinguishing streak points, referral points, CodingVerse rewards, or manual adjustments, which makes disputed or unexpected score changes impossible to investigate (relevant given past issues like #429 stale-state HubCoin overwrites and #427 points-threshold bypass).

Proposed Solution

  • Add a pointsHistory subcollection per user, written to (not overwritten) whenever points/coins change, with fields: amount, source (streak/referral/codingverse/purchase/manual), timestamp
  • Add a "Activity Log" tab on the Profile page showing a paginated, chronological list of these entries
  • Add a "Export as CSV" button so users can download their own history

Scope

  • Backend: refactor all point/coin-mutating writes (streak, referral, CodingVerse, shop) to also append a pointsHistory entry in the same transaction
  • Frontend: new ActivityLog.jsx component with pagination (reuse existing leaderboard pagination pattern)
  • CSV export utility (client-side generation from fetched history)

Impact

  • Restores user trust when balances change unexpectedly
  • Gives maintainers an audit trail for debugging economy bugs
  • Foundation for future anti-cheat/anomaly detection work

Notes

This is a cross-cutting change touching most point-mutating code paths, hence Level 3.

Metadata

Metadata

Labels

NSoC'26NSoC 2026backendBackend/Firebase related changesbugSomething isn't workingenhancementNew feature or requestfrontendFrontend related changes (HTML/CSS/JS/React)needs-reviewIssue needs reviewneeds-triagensocNSoC

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions