Giter Club home page Giter Club logo

geocoder's Introduction

Geocoder

The microservice that incorporates functionality for obtaining information about coordinates, IP addresses, etc.

Development

docker compose up -d --build
docker compose exec php composer install

Requirements ๐Ÿง

  • PHP 7,8
  • Symfony 7
  • Redis

IP-address


Obtaining basic information:

GET /ip-address/{ipAddress}/info

Important

The {ipAddress} parameter only supports IPv4.

The basic information includes two parameters: country code and name in the 'en' locale in ISO 3166 format.

Example response:

{
    "ip": "194.213.105.94",
    "country_code": "UA",
    "country_name": "Ukraine",
}

The service https://www.ip2location.io/ is used as the geocoder.

To connect to this geocoder, first register on their website and obtain a token through personal account.

The token needs to be set in the .env files under the parameter IP2LOCATION_TOKEN.

500 requests per day are available for free.

IP-address: custom provider


The new provider must implement the IpAddressInfoProviderInterface.

Additionally, it is necessary to change the alias in IpAddressInfoProviderCompilerPass

IP-address: caching


The information about the IP is cached in Redis for the time specified in REDIS_LIFETIME_IN_SECONDS.

geocoder's People

Contributors

wbrframe avatar

Watchers

 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.