Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Categorization, Rate Limiting, and Feature Flags #177

Merged
merged 17 commits into from
Mar 23, 2025

Conversation

kevingatera
Copy link
Contributor

Key Changes

  • Added feature flag system for dynamic configuration
  • Implemented robust rate limiter with token bucket algorithm
  • Added new category suggestions with similarity matching
  • Integrated web search for merchant context
  • Improved transaction processing with batch support

Testing

  • Enable features via FEATURES env var
  • Test with dry run mode first
  • Verify rate limiting with low API quotas
  • Test web search with unfamiliar merchants

Configuration

All features configurable via environment variables as documented in README.md. Maintains backward compatibility while adding new capabilities.

@kevingatera kevingatera force-pushed the smart-uncategorized branch from f16010c to 5a81371 Compare March 8, 2025 07:02
@sakowicz
Copy link
Owner

sakowicz commented Mar 8, 2025

This looks amazing. I will take a closer look and test it in following days.
I really appreciate your contribution 🍻

@kevingatera
Copy link
Contributor Author

Thank you! Let me know what you'd need. Also you can get a valueserp API key with about 1000 requests for free so you can test

@kevingatera
Copy link
Contributor Author

What do you think @sakowicz ? Needs more work? I put most work behind feature flags and most setups should not be affected

@sakowicz
Copy link
Owner

sakowicz commented Mar 17, 2025

I'm sorry this is taking so long. The PR is really big and I've never had a chance to to test it yet.

However:

  1. I don't see any Open Source/free alternative to web search. Can we implement some alternative so everyone can selfhosted it?
  2. I think we could migrate CLASSIFY_ON_STARTUP, SYNC_ACCOUNTS_BEFORE_CLASSIFY and DRY_RUN to Feature Flags. What do you think?
  3. "If the transaction is a Credit Card Payment, categorize it as "Transfer" unless it is a fee." This seems strange to me. Why is that? Seems like something that not everyone would've like as default.
  4. RateLimiter class seems pretty complicated. Could you add some Unit tests to cover it?

Thank you for the contribution. I'm going to test it soon. I'm doing this CR from my phone 🙈

@kevingatera
Copy link
Contributor Author

Those are valid points and I will be fixing them soon. I will look into implementing bing/duckduckgo

For the credit card, that's a mistake from my own rules bleeding into my pr. It's quite large and I kept needing this and that until everything depended on everything else so I pushed it here as a self contained featureset

@kevingatera
Copy link
Contributor Author

I've made the changes and update, for search we will be using Duck Duck Go's public search, it's surprisingly good. It will be enabled through the freeWebSearch, updated the features except for dry_run. Finally, removed the credit card rule I had accidentally added.

@sakowicz sakowicz merged commit dbfdaed into sakowicz:master Mar 23, 2025
@sakowicz
Copy link
Owner

Thank you for the contribution. And sorry that it took so long.

@sakowicz
Copy link
Owner

FYI: I've split the transaction-service into the multiple files bdc9ad1

If you've time it would be nice to unit test src/similarity-calculator.ts and src/category-suggestion-optimizer.ts

Transaction-service becomes huge and we'd have to refactor it if we want to maintain this project.
Sadly I have no time for that at the moment,

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.

2 participants