Giter Club home page Giter Club logo

five-0's Introduction

Five-0

Build Status license

The word five-0 is a skateboard trick. I'm a huge fan of skateboarding and when I started to develop open source projects, I decided to use skate tricks as project names.

Introduction

The image bellow shows the five-0 architecture. Basically, five-0 is a microservice that read information from elasticsearch and make available through HTTP endpoints:

architecture

The sample data stored into elasticsearch is shown down below:

sample

How to build

$ git clone https://github.com/greatjapa/five-0.git
$ cd five-0
$ make up
$ make load

How to run

The make up command build the microservice code with maven and raise a docker container with it. As database, we use elasticsearch (see docker-compose.yml):

Five-0 has 2 endpoints:

  • GET /connection?city=\<city\>&depth=\<depth\>

As an example, you can try:

curl http://localhost:8080/connection?city=Rio%20de%20Janeiro

and the result will be:

[
    {
        "city" : "Belo Horizonte",
        "steps" : 0
    },
    {
        "city" : "São Paulo",
        "steps" : 0
    },
    {
        "steps" : 1,
        "city" : "Campinas"
    },
    {
        "city" : "Trindade",
        "steps" : 2
    }
]

you also may define a max depth as argument:

curl http://localhost:8080/connection?city=Rio%20de%20Janeiro&depth=2

the result is:

[
    {
        "city": "Belo Horizonte",
        "steps": 0
    },
    {
        "city": "São Paulo",
        "steps": 0
    },
    {
        "city": "Campinas",
        "steps": 1
    }
]
  • GET /time?city=\<city\>

The following example shows how this endpoint works:

curl http://localhost:8080/time?city=Rio%20de%20Janeiro

the result is:

[
    {
        "city": "Belo Horizonte",
        "time": 2.29
    },
    {
        "city": "São Paulo",
        "time": 5.19
    },
    {
        "city": "Campinas",
        "time": 9.89
    },
    {
        "city": "Trindade",
        "time": 19.75
    }
]

five-0's People

Contributors

greatjapa avatar

Watchers

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