Skip to content

: [Feature] Smart Location Intelligence: Geocoding & Geospatial Expense Analysis #635

@SatyamPandey-07

Description

@SatyamPandey-07

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):

  1. 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, and formattedAddress based on merchant name inference.
  2. Geospatial Models:
    • Update models/Transaction.js to store GeoJSON points.
    • Create models/Place.js to cache recognized locations (e.g., "Starbucks on 5th Ave").
  3. Geospatial Analysis:
    • Implement findNearby(lat, lng, radius) queries.
    • Create a clustering algorithm to group expenses by neighborhoods or cities.
  4. 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.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions