Skip to content

feat: weekly financial digest with insights & WoW trends#404

Open
TallowX92 wants to merge 2 commits intorohitdash08:mainfrom
TallowX92:feat/weekly-digest
Open

feat: weekly financial digest with insights & WoW trends#404
TallowX92 wants to merge 2 commits intorohitdash08:mainfrom
TallowX92:feat/weekly-digest

Conversation

@TallowX92
Copy link

@TallowX92 TallowX92 commented Mar 14, 2026

/claim #121

Demo

demo.mp4

Summary cards, week-over-week spend tracking, category breakdown with animated bars, insights panel, and previous/next week navigation.


Summary

Full-stack weekly financial digest — backend aggregation endpoint + frontend digest page with navigation, week-over-week trends, and auto-generated insights.

Backend — GET /digest/weekly

Param Description
week_start Optional YYYY-MM-DD (defaults to current Monday)

Response includes:

  • summary — total_spent, total_income, net_flow, prev_week_spent, wow_change_pct
  • category_breakdown — per-category totals with delta and delta_pct vs previous week
  • top_spending_category — highest spend category name
  • upcoming_bills — bills due within the next 7 days
  • insights[] — auto-generated trend sentences:
    • Week-over-week total change (≥5% threshold)
    • Top spending category with % of total
    • Biggest category increase/decrease (≥20% threshold)
    • Upcoming bill alerts

Redis caching with 1-hour TTL, graceful fallback if Redis is unavailable.

Frontend

  • api/digest.ts — fully typed API client
  • pages/Digest.tsx — summary cards, animated category bar chart with WoW delta badges, insights panel, upcoming bills list, previous/next week navigation
  • /digest route added to App.tsx and Navbar

Tests (tests/test_digest.py — 10 tests, all passing)

  • Empty week returns zero summary
  • Expenses appear in category breakdown with correct totals
  • Income excluded from spending, included in net flow
  • Custom week_start param respected
  • Upcoming bills surfaced correctly
  • Top spending category is highest spend
  • WoW change computed correctly (100% increase verified)
  • Cache hit returns cached response without DB hit
  • Auth required — 401 without JWT
  • Insights list non-empty when data present

…#121)

Adds a weekly financial summary endpoint and frontend page showing
spending totals, category breakdowns, week-over-week changes, upcoming
bills, and auto-generated insights.

Backend (GET /digest/weekly):
- Aggregates current and previous week expenses by category
- Computes total_spent, total_income, net_flow, wow_change_pct
- Category breakdown with delta and delta_pct vs previous week
- Upcoming bills due within the next 7 days
- insights[] — human-readable trend sentences (top category, WoW
  changes ≥5%, biggest category increase/decrease ≥20%, bill alerts)
- Redis cache with 1-hour TTL, graceful fallback if Redis unavailable
- Optional ?week_start=YYYY-MM-DD param (defaults to current Monday)

Frontend:
- api/digest.ts — typed API client
- pages/Digest.tsx — summary cards, category bar chart with WoW delta
  badges, insights list, upcoming bills panel, prev/next week navigation
- /digest route registered in App.tsx and Navbar

Tests (tests/test_digest.py — 10 tests):
- Empty week returns zero summary
- Expenses appear in category breakdown
- Income excluded from spending totals
- Custom week_start param
- Upcoming bills included
- Top spending category is highest spend
- WoW change computed correctly
- Cache hit returns cached response
- Auth required (401 without JWT)
- Insights list is non-empty when data present
@TallowX92 TallowX92 force-pushed the feat/weekly-digest branch from f0e5f8b to 5fd7928 Compare March 17, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants