Skip to content

feat: spending trend heatmap visualization#575

Open
mendarb wants to merge 1 commit intorohitdash08:mainfrom
mendarb:feat/spending-heatmap-116
Open

feat: spending trend heatmap visualization#575
mendarb wants to merge 1 commit intorohitdash08:mainfrom
mendarb:feat/spending-heatmap-116

Conversation

@mendarb
Copy link
Copy Markdown

@mendarb mendarb commented Mar 20, 2026

Summary

  • Backend: New GET /api/expenses/heatmap?months=12 endpoint (JWT-protected) that returns daily spending totals aggregated from the Expense model
  • Frontend: SpendingHeatmap component -- a calendar-style heatmap grid (52 weeks x 7 days, like GitHub contributions) with color scale from gray (no spending) through green/yellow/orange/red, and hover tooltips showing date + amount
  • Integration: Heatmap added to the Analytics page, rendered independently of the Gemini-powered insights section
  • Tests: Backend tests for auth, aggregation, and param validation; frontend tests for loading, grid rendering, tooltip interaction, error state, and legend

Test plan

  • Backend: pytest tests/test_heatmap.py -- verifies empty state, daily aggregation of multiple expenses, auth requirement, and invalid param handling
  • Frontend: jest SpendingHeatmap.test.tsx -- verifies loading state, 364-cell grid rendering, tooltip show/hide on hover, error display, and legend presence
  • Manual: Navigate to Analytics page and verify the heatmap renders below the budget coaching section

Closes #116

🤖 Generated with Claude Code

Add a calendar-style heatmap (like GitHub contributions) that visualizes
daily spending intensity over the past year.

Backend:
- GET /api/expenses/heatmap?months=12 endpoint with JWT auth
- Aggregates daily spending totals from Expense model

Frontend:
- SpendingHeatmap component with 52x7 grid, color scale, and tooltips
- Integrated into the Analytics page
- Pure CSS/Tailwind, no charting library needed

Tests:
- Backend: test_heatmap.py (auth, aggregation, validation)
- Frontend: SpendingHeatmap.test.tsx (loading, grid, tooltip, error, legend)

Closes rohitdash08#116

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mendarb mendarb requested a review from rohitdash08 as a code owner March 20, 2026 13:16
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.

Spending trend heatmap visualization

1 participant