Skip to content

feat: Smart digest with weekly financial summary (#121)#678

Open
zacharylyonstx wants to merge 1 commit intorohitdash08:mainfrom
zacharylyonstx:feat/smart-digest-weekly-summary
Open

feat: Smart digest with weekly financial summary (#121)#678
zacharylyonstx wants to merge 1 commit intorohitdash08:mainfrom
zacharylyonstx:feat/smart-digest-weekly-summary

Conversation

@zacharylyonstx
Copy link
Copy Markdown

Summary

Implements weekly financial digest as described in #121.

What's included:

Backend (Flask):

  • DigestService generating weekly summaries with income/expense totals, week-over-week comparison, per-category breakdown, daily spending, top 5 transactions, and auto-generated insights
  • Two new endpoints: GET /digest and GET /digest/weeks
  • Redis caching (1h TTL) with automatic invalidation on expense CRUD operations

Frontend (React):

  • Full digest page at /digest with summary cards, daily bar chart, top transactions, category breakdown with progress bars, and numbered insights panel
  • Week navigation (prev/next) with available-weeks picker
  • Protected route, added to navbar

Tests:

  • 15 backend tests covering payload structure, defaults, empty weeks, week-over-week comparison, transaction ordering, daily spending shape, categories, auth, and insight generation
  • 7 frontend integration tests covering rendering, data display, navigation, and error states

Documentation:

  • README updated with feature description, API reference, and caching details

Acceptance Criteria

  • ✅ Production ready implementation
  • ✅ Includes tests (22 total)
  • ✅ Documentation updated

Closes #121

Implements issue rohitdash08#121 - Smart digest with weekly financial summary.

Backend:
- New digest service (packages/backend/app/services/digest.py) that generates
  weekly summaries from transaction data including:
  - Period totals (income, expenses, net flow, transaction count)
  - Week-over-week comparison with percentage change
  - Per-category breakdown with share percentages
  - Daily spending breakdown (all 7 days, zero-filled)
  - Top 5 largest transactions
  - Auto-generated insights (spending trends, savings, peak days, top categories)
- New API routes (GET /digest, GET /digest/weeks) with JWT auth
- Redis caching (1h TTL) with auto-invalidation on expense changes
- OpenAPI spec updated with full schema documentation

Frontend:
- New Digest page with week navigation (prev/next controls)
- Summary cards for net flow, income, expenses, week comparison
- Visual daily spending bar chart
- Top transactions list with amounts
- Category breakdown with progress bars
- Numbered insights panel
- API client module (app/src/api/digest.ts)
- Route registered in App.tsx, nav link in Navbar

Tests:
- 15 backend tests covering digest generation, week-over-week comparison,
  daily spending, category breakdown, insights, empty weeks, auth
- 7 frontend integration tests covering rendering, data display, navigation,
  error handling

Documentation:
- README updated with digest feature description, API docs, caching policy
- Project structure updated
@zacharylyonstx
Copy link
Copy Markdown
Author

Hi @rohitdash08 — friendly follow-up! This PR has been open for 8 days. The Smart Digest feature is fully implemented with backend service, frontend UI, and comprehensive tests (15 backend + 7 frontend). Would love your feedback when you get a chance. Happy to make any changes needed. 🙏

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.

Smart digest with weekly financial summary

1 participant