Coder Social home page Coder Social logo

straw-hat-labs / straw_hat_map Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 3.0 470 KB

Map Information and Addresses Management

Home Page: https://hex.pm/packages/straw_hat_map

License: MIT License

Elixir 99.68% Makefile 0.32%
otp elixir elixir-lang map addresses usps world-map

straw_hat_map's Introduction

StrawHat.Map

Hex.pm CI Status Code Coverage

Map and addresses management.

Configuration

Important

StrawHat.Map requires an Ecto repository with Geo.PostGIS.Extension extension enabled.

You need to create or extend your current PostgreSQL types:

Postgrex.Types.define(
  MyApp.PostgresTypes,
  [Geo.PostGIS.Extension] ++ Ecto.Adapters.Postgres.extensions()
)

Then make sure that you add the types to your repository connection.

# In your config files

config :my_app, MyApp.Repo,
  # ...
  types: MyApp.PostgresTypes

Use cases

All the APIs are contain in the business use cases are under Use Cases documentation section. Check the available modules and the public API.

You should be able to comprehend the API by reading the type spec and the function name. Please open an issue or even better make pull request about the documation if you have any issues with it.

Migrations

Since this library does not have any repository, it does not run any migration. You will need to handle the migrations on your application that contains the repository.

The migrations directory contains a series of migrations that should cover the common use cases.

Note

Each migration module has a Created at timestamp, this information is useful to decide when and the order on which the migrations should be run.

Using migrations

After creating an Ecto migration in your project you could call one of the migrations from your change callback in your module.

defmodule MyApp.Repo.Migrations.CreateCountriesTable do
  use Ecto.Migration

  def change do
    StrawHat.Map.Migrations.CreateCountriesTable.change()
  end
end

straw_hat_map's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar ozorrilla avatar yordis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

straw_hat_map's Issues

Fix scrievener

Do not use repo.pagination but instead, call Scrivener directly

   config = %Scrivener.Config{
        module: Scrivener.Ecto.Repo,
        page_number: 2,
        page_size: 4,
        options: [total_entries: 130]
      }
      page =
        Post
        |> Post.published
        |> Scrivener.paginate(config)

Future Features

Addresses

Data

We need to find a way to load the database in a clean way. Some people care about specific countries and others the full database.

We need to find a trustful source that this import becomes a single command.

https://github.com/mledoze/countries
https://timezonedb.com/download

Add timestamp() to Location

It is useful to know when the location was inserted and the last update.

  • Add timestamps() to the migration
  • Add timestamps() to Schema
  • Add documentations for the schema keys

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.