Skip to content

victorabarros/travel-routes-optimizer

Repository files navigation

travel routes optimizer

Maintainability Go Report Card MIT Licensed

CircleCI Build Status

Software developer challenge

Disclaimer

To software's mission is to assert the cheapest travel for desired destination.

Development

The programming language choiced was Golang. As good practice using Docker.

Requirements

How to run

csv

To start the software needs a file with possibles routes. Example:

GRU,BRC,10
BRC,SCL,5
GRU,CDG,75
...

write .env file

Similar to .env.example

clean any "garbage"

make clean-containers
make clean-network

set and build

make create-network
make build

flags

./main --help

Starting Service
Usage of /tmp/go-build314365757/b001/exe/main:
  -routes string
        travel routes file (default "./input-file.txt")

start

make run ROUTES=./input-file.txt

Terminal interface client

Enter ORG-DES format. Example:

GRU-ORL

Answer:

best route: BRC - SCL - GRU - ORL > $35.00

Server

Healthcheck

Based on k8s best practices

  • /healthz
  • /started

Search

To find the cheapest transfer travel option.

  • /routes?origin=GRU&destination=ORL

Insert

To insert new route. It will be perssistent on data inputed file.

  • /routes
    • Method: Post
    • Body: {"origin": "GRU", "destination": "BRC", "price": 10}

Tests

make test-coverage

About

Software developer challenge.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published