Skip to content

Postamentovich/store-find

Repository files navigation

Find nearest store

  1. Features
  2. Technologies and libraries used
  3. Project structure
  4. ENV Variables
  5. Google Sheet Description
  6. API
  • Getting data about stores from google sheet
  • Searching store by radius 20km, 50km, 100km and then by all stores
  • Return nearest store by user location
  • Node.js
  • Express
  • Turf
  • TableTop
├── config/                     # Config module for app
├── controller/                 # Route controller
├── repository/                 # Getting data from google sheet
├── route/                      # Express routes
└── service/                    # Main app logic
index.js                        # Entry point
variable description
PORT Application port
GOOGLE_SHEET_URL Google sheet url

Data updated from google sheets every 30 minutes.

IMPORTANT! DO NOT CHANGE COLUMN Latitude and longitude title, this is will broken app. You can change other coolumns and rows, all data will be on response

Endpoint:

GET - /api/store?lat="LATITUDE"&lng="LONGITUDE"

Parameters:

variable type description
lat number latitude
lng number longitude

Example:

Request: https://find-nearest-store.herokuapp.com/api/store?lat=13.221898190099632&lng=77.23114013671875

Response:

{
    "Store Name": "",
    "Address": "Unit No UG 76, Mantri Mall,, Sampige Road, Malleshwaram Bengaluru 560003 Karnataka, IN",
    "Latitude": "12.991523",
    "longitude": "77.570311",
    "location": "Bengaluru, Karnataka",
    "distance": 44.78193627144007
}

About

Find nearest store by user location

Topics

Resources

Stars

Watchers

Forks