Coder Social home page Coder Social logo

in-auth's Introduction

InAuth

Steps to install

  • follow the instructions in db-schema.sql

  • load US boundaries (downloaded from here) into the DB using the following command (I used locate shp2pgsql on Mac to find the utility)

    shp2pgsql -s 4269 -g geom_4269 -I -W "latin1" "{path-to-resource}/tl_2012_us_state" inauth.tl_2012_states | psql -h localhost -p 5432 -d inauth_locations -U postgres

API usage

  • GET /inauth/locations returns all locations in DB, optional params:

    • details=true returns all locations in DB with inUSA and distances details
    • foramt=xls must be used with details=true converts the result into xls file
  • GET /inauth/locations/search?lng={lng}&lat={lat} returns a particular location if found, optional params:

    • details=true returns the found location with inUSA and distances details
    • foramt=xls must be used with details=true converts the result into xls file
  • POST /inauth/locations create a new location if doesn't already exist

    • header Content-Type=application/json;charset=UTF-8
    • body {"lng": 46.6915985,"lat": 14.7064375}
    • returns 201 and location header for newly created location /inauth/locations/search?lng=46.6915985&lat=14.7064375
    • returns 400 if location already exists

Start the application

  • Embedded Tomcat: go to the root directory and run mvn spring-boot:run (the server starts at port 7777)
  • Stand alone container: either build the war file using mvn clean install and copy target/inuath.war to tomcat or download from here
  • The application uses Google Geocoding API to get the list of cities locations (in application.properties) and store them in the DB at startup time, so the system has to be online, another appoach could have been do store these in a fixture and load to the DB, but I though it was nice to be able to add cities by modifying the config file

in-auth's People

Contributors

kayoubi avatar

Watchers

 avatar 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.