-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Transactions currently lack spatial context. Users cannot visualize where they are spending money (e.g., "How much did I spend at the Downtown Mall vs. near home?").
Describe the solution you'd like
I propose adding a Location Intelligence layer to the backend. This involves geocoding transactions, enabling geospatial queries, and clustering expenses by physical location using MongoDB's geospatial features.
Key Technical Requirements (L3 Complexity):
- Location Service (
services/locationService.js):- Interface with a Geocoding Provider (Google Maps/Mapbox - using a mock adapter pattern for the open-source repo).
- Auto-tag transactions with lat,
lng, andformattedAddressbased on merchant name inference.
- Geospatial Models:
- Update models/Transaction.js to store GeoJSON points.
- Create
models/Place.jsto cache recognized locations (e.g., "Starbucks on 5th Ave").
- Geospatial Analysis:
- Implement
findNearby(lat, lng, radius)queries. - Create a clustering algorithm to group expenses by neighborhoods or cities.
- Implement
- Background Processing:
jobs/geocodingJob.js: A background worker to asynchronously process historical transactions and backfill location data.
Files to be created/modified:
services/locationService.js(New)models/Place.js(New)jobs/geocodingJob.js(New)routes/maps.js(New)- models/Transaction.js (Update schema/indexes)
utils/geoUtils.js(New)
Impact
Enables "Map View" features on the frontend and provides deeper insights into spending habits based on location.
Reactions are currently unavailable