Giter VIP home page Giter VIP logo

addressr's Introduction

Addressr

Addressr

Free Australian Address Validation, Search and Autocomplete - addressr.mountain-pass.com.au

GitHub license npm npm downloads Docker Image Version (latest by date) Docker Pulls

Addressr Build Status Maintainability Test Coverage

GitHub issues GitHub pull requests Libraries.io dependency status for latest release

Quick Start

  1. Install addressr

    npm install @mountainpass/addressr -g
    

    NOTE: If you are running windows, you'll need to use wsl

  2. Start elastic search. For example run

    docker pull docker.elastic.co/elasticsearch/elasticsearch:7.2.0
    docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.2.0
    
  3. Start API server. In a second window run:

    export ELASTIC_PORT=9200
    export ELASTIC_HOST=localhost
    addressr-server
    
  4. Setup the env vars for the data loader. In a third window run:

    export ELASTIC_PORT=9200
    export ELASTIC_HOST=localhost
    export ADDRESSR_INDEX_TIMEOUT=30s
    export ADDRESSR_INDEX_BACKOFF=1000
    export ADDRESSR_INDEX_BACKOFF_INCREMENT=1000
    export ADDRESSR_INDEX_BACKOFF_MAX=10000
    
    1. Optional - enable geocodes by setting the following env vars for the data loader. In the third window run: NOTE: with geocodes enabled, indexing takes much longer and needs much more memory. Only use turn them on if you need them. You can always add them later.
    export ADDRESSR_ENABLE_GEO=1
    export NODE_OPTIONS=--max_old_space_size=8196
    
    1. Optional - limit the addresses to a single state by setting the COVERED_STATES env var for the data loader. This dramatically speeds up indexing. For example, in the third window run:
    export COVERED_STATES=VIC,SA
    

    Valid values are:

    • ACT
    • NSW
    • NT
    • OT
    • QLD
    • SA
    • TAS
    • VIC
    • WA
  5. Run data Loader. In the third window run:

    addressr-loader
    
  6. OK, so we stretched the truth a bit with the "Quick Start" heading. The truth is that it takes quite a while to download, store and index the 13+ million addresses from data.gov.au. So make a coffee, or tea, or find something else to do and come back in about an hour when it's done.

  7. Search for an address

    curl -i http://localhost:8080/addresses?q=LEVEL+25,+TOWER+3
    
  8. Wire you address form up to the address-server api.

  9. An updated G-NAF is released every 3 months. Put addressr-loader in a cron job or similar to keep addressr regularly updated

How it Works

How it works

Additional Settings

Environment Variable Value Description Default
ELASTIC_PROTOCOL http Connect to elastic search over http
ELASTIC_PROTOCOL https Connect to elastic search over https
ELASTIC_USERNAME blank Connect to elastic search without authentication
ELASTIC_USERNAME non-blank Connect to elastic search with the specified username
ELASTIC_PASSWORD blank Connect to elastic search without authentication
ELASTIC_PASSWORD non-blank Connect to elastic search with the specified password

System requirements

Elastic Search:

elasticsearch-oss >= 7.2.0 with 1.4GiB of memory

Addressr Loader

Default

Node JS >= 11.14.0 with 1GiB of memory

With Geocoding enabled

Node JS >= 11.14.0 with 8GiB of memory

Addressr Server

Node JS >= 11.14.0 with 64MiB of memory

addressr's People

Contributors

tompahoward avatar dependabot-preview[bot] avatar dependabot[bot] 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.