Giter Site home page Giter Site logo

locationlookup's Introduction

Address Verification

  • NodeJS
  • Express
  • Postgres
  • Google Map Geocode API

How to install

npm install

How to seed DB

npm run db:reset

How to run

npm run dev

How to run tests

npm run test

also included postman json file for integration tests

example CURL:

curl -X POST \
  http://localhost:3001/address/verify \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '[{
    "address_line_one": "525 W Santa Clara St",
    "city": "San Jose",
    "state": "CA",
    "zip_code": "95113"
}]'

Design

Consideration

  • I think there are 2 approach that can be taken with this problem. First is to be less strict about how address matches to the DB dataset and what returns from google. This generally will allow more address being validated and potentially more false positive. Second is to be more strict about validation, enforce exact match, this will reject more addresses, but there won't be false positives. However, the address that does not match the official name will be reject. IE - Mount Laurel vs Mount Laurel Township. I took apprach #2 because it's easier to enforce strict DB and relax it later than to relax and have to clean up later.
  • There are a lot of edge cases, probably more than I'm aware of, so adding a logger to log the rejected addresses and google returned address could help look at some of the rejected cases. Since google map API does fuzzy matching, it would be interesting to compare dataset and see how to relax matching function and create something more robust.
  • Since the premise of this design is to be strict with data, it was important to make sure that we normalize all the data. An parsing address lib was used heavily to standarize street prefix, street type, street sufix, and state.

Logic flow chart

Database Design

locationlookup's People

Contributors

joedou avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.