MasterXen / postmark

Geofenced API server for discounts (deals and coupons)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stories in Ready Postmark

A (minor) modification to KeystoneJS to add a few custom APIs for:

  • Populating a connected MongoDB with retail stores (e.g. Macy's or BestBuy) and their addresses, geocoordinates, storeId and more
  • A basic geofencing API (to be used from mobile devices) that when sending a lat/long pair determines:
    • If the request location is NEAR any stores (as a teaser)
    • If the request is IN any store (to unlock a special offer)

Screenshots

Geofence Setup & UI

Example Request & Response

API Example

Request:

http://<SERVER_ADDRESS>:<PORT>/api/nearby/30.3557437/-97.7239443

In this example, the mobile user coordinates are:

  • Latitude: 30.3557437
  • Longitude: -97.7239443

Response:

[
  {
    "isTeaser": false,
    "name": "Macy's - North Central Mall",
    "retailer": "Macy's",
    "isInactive": false,
    "latitude": 30.3557437,
    "longitude": -97.7239443,
    "discountPct": 19,
    "_id": "533ec620e461e638847f2856",
    "__v": 0
  },
  {
    "isTeaser": true,
    "name": "Macy's - Bee Cave",
    "retailer": "Macy's",
    "isInactive": false,
    "latitude": 30.3557437,
    "longitude": -97.7129443,
    "discountPct": 17,
    "_id": "533ec620e461e638847f2857",
    "__v": 0
  }
]

About

Geofenced API server for discounts (deals and coupons)


Languages

Language:CSS 72.8%Language:JavaScript 27.1%Language:PHP 0.0%