Skip to content

Create a mutation to fetch top 3 closest merchants #200

Closed

Description

@Nodirbek75

Parameter: user location lat and lng (fallback ip address location)

Activity

  1. brh28 commented on Aug 25, 2025

    @brh28
    Contributor

    Unauthed query. Rate limiting is a secondary concern

    Look into how to get latitude & longitude. These will be the request parameters to the API defined by the Coordinates type.

    Response is an array of the Merchant type defined in the graphql schema.

    Look into Mongo's Geospatial queries

  2. added
    enhancement
    on Aug 25, 2025
  3. added theissue type on Aug 25, 2025
  4. patoo0x commented on Mar 20, 2026

    @patoo0x
    Contributor

    📋 Definition of Done

    ⚠️ Bundled bounty: This issue is bundled with #201 (Flash Favorites). See the full DoD and 150,000 sats bounty details on #201.

  5. chengyixu commented on Mar 21, 2026

    @chengyixu

    Proposal — Top 3 Closest Merchants Query

    I'd like to work on this issue bundled with #201 (Flash Favorites) for the 150,000 sats bounty.

    Approach for the geospatial merchant query:

    1. GraphQL schema: Add a new unauthed query closestMerchants(lat: Float!, lng: Float!): [Merchant!]! (or accept Coordinates input type if it already exists).

    2. MongoDB geospatial index: Add a 2dsphere index on the merchants collection's location field. Use $nearSphere or $near with $maxDistance to find the 3 closest merchants sorted by distance.

    3. IP fallback: If lat/lng are not provided, use a free geolocation-by-IP service (e.g. ip-api.com) to get approximate coordinates.

    4. Rate limiting (secondary): Add per-IP rate limiting middleware if needed.

    For #201 (Flash Favorites): Add merchants_featured Mongo collection, GraphQL query + mutation, and ERPNext admin page for curating the featured list.

    ETA: 3–4 days for both together.

    Lightning address: [email protected]

  6. added a commit that references this issue on Apr 17, 2026
    412e8c5
  7. islandbitcoin commented on Apr 17, 2026

    @islandbitcoin
    Contributor

    closing as a roadmap/product idea, not active implementation work right now. can reopen if top-merchants-nearby gets product priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions