Git Product home page Git Product logo

adidas-book-bus-coding-challenge's Introduction

BOOK BUS BACKEND

1. Technologies

  • Java 1.8
  • Maven 4.0
  • Spring BOOT 2.0
  • Srping Cloud // FEATURE
  • Srping Integration Kafka
  • Spring Data JPA
  • PostgreSql
  • Undertow web server
  • Redis // FEATURE
  • Lombok
  • Mapstruct

2. Install

  • zookeeper - tested on version 3.4.11
  • kafka - tested on version 2.12-1.0.0
  • postgresql - tested on version 9.6
  • create db 'adidas'

3. Run app

  • Run zookeeper. From the zookeeper bin folder:
zkserver
  • Run kafka broker. From the kafka folder run the command (for windows):
    (notes: maybe you need to clean folder "kafka-logs" and "zookeeper-*.data" if broker doesn't start)
.\bin\windows\kafka-server-start.bat .\config\server.properties
  • Start modules:
BackOfficeApplication
MidofficeApplication
  • In your browser run
http://localhost:8080/route/MAD/LON

It will return shortest route and the one with the less stops

{
   "shortestRoute": [
       "MAD",
       "BCN",
       "PAR",
       "LON"
   ],
   "lessStopsRoute": [
       "MAD",
       "VLC",
       "LON"
   ]
}

###4. Get API Documentation (Swagger) Notes: see documentation http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api

  • Run target web module
  • Open documentation of the module in your browser
    Pattern: http://://swagger-ui.html
    e.g.:
http://localhost:8082/swagger-ui.html
  • Get documentation as JSON
    Pattern: http://://v2/api-docs
    e.g.:
http://localhost:8082/v2/api-docs

###5. Run in docker TO BE DONE Is done:

  • midoffice-app/Dockerfile. To create docker image for midoffice-app run
$ cd to the midoffice directory
$ docker build -f Dockerfile -t book-bus-midoffice-app .
  • to run midoffice with kafka in containers use docker compose. Previously change in application.yml localhost -> kafka
$ docker-compose up

as a result zookeeper, kafka and book-bus-midoffice-app should be run, it should say partitiona assigned... that means that kafka client connected to kafka broker

adidas-book-bus-coding-challenge's People

Contributors

sabfir avatar

Watchers

James Cloos 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.