Git Product home page Git Product logo

eloquentelks's Introduction

EloquentElks - New York City Tourism Recommender

Introduction

Traveling to New York is a dream for many people. However, planning the trip such that one has the best possible experience in New York can be difficult. Finding the right place to stay is often the first but most challenging task when planning a trip. In NYC, there are just too many options. Therefore, we created a tool where users can enter their budget and their preferences for the city trip, and we recommend an area to look for an apartment as well as interesting activities to do in the city.

Code Metrics

For a current snapshot of our code quality metrics, please refer to the links below:

Component Quality
Frontend Coverage Quality Gate Status
AirBnb API Coverage Quality Gate Status
POI API Coverage Quality Gate Status
Recommender API Coverage Quality Gate Status
POI Density API Coverage Quality Gate Status

Quick Start

The easiest way to get the application up and running is to use our docker-compose.yml, which uses our Docker Hub Images

All you need in order to get started is our docker-compose.yml, as well as the db_folder_setup.sh script.

After downloading these two files, put them into an empty folder of your choice and open a command line in the same folder.

First execute bash db_folder_setup.sh

To get the application started, run the following command: docker compose -f docker-compose.yml up -d

Afterwards, open your browser and go to http://localhost:3000 to access the application.

To stop the entire application, run the following command: docker compose -f docker-compose.yml down

If you decide to re-run docker compose up at a later point, remember to rerun bash db_folder_setup.sh

This ensures that the database folders are cleared, so you can start over with fresh databases.

Development

Prerequisites

In order to be able to build all of the services, you need the following tools and environments installed on your machine:

How to get started

To build the entire application including all microservices, run the following command in the root directory of the project: bash ./build_docker_containers.sh. This builds all the projects and sets up the docker containers. For details on the individual microservices, please refer to the following pages:

Each eloquent-elks database has its own seeding docker image. We found this to be the most stable way of initially loading data into a mongodb docker container. DB-Seeds are available for the following databases:

  • eloquent-elks-airbnb-db: README
  • eloquent-elks-poi-db: README
  • eloquent-elks-poi-density-db: README

Architecture

This application consists of various microservices. Each of them runs in a docker container, which enables easy deployment on cloud platforms. As of now, the application consists of the following microservices:

eloquent-elks-frontend

The frontend is written in React. It uses grommet and leaflet for the visualizations.

eloquent-elks-airbnb-api

The AirBnb API is based on Java Spring Boot. It connects to the eloquent-elks-airbnb-db and exposes the AirBnb data to the frontend.

eloquent-elks-airbnb-db

The AirBnb database is a MongoDB containing data on AirBnbs. The data has been retrieved from Kaggle.

eloquent-elks-poi-api

The POI API is based on Java Spring Boot. It connects to the eloquent-elks-poi-db. It is responsible for exposing the Points of Interest of New York to the frontend, and also to the POI Density API.

eloquent-elks-poi-db

The POI database is a MongoDB containing data on the Points of Interest of New York. The data has been collected from OpenStreetMap.

eloquent-elks-poi-density-api

The POI Density API is implemented in NodeJS Express. Its job is to calculate the density of various types of attractions and is called by the Recommender API. In turns, it gets the POIs from the POI API. For the density calculation, it uses the TurfJS library.

eloquent-elks-poi-density-db

The POI Density database is a MongoDB acting as a cache for the POI Density API, such that it does not have to recompute the density layers if they did not change.

eloquent-elks-recommender-api

The Recommender API is written in Java Spring Boot. It is responsible for retrieving the density calculations from the POI Density API and processing these results. In particular, this involves normalization and aggregation.

UML Component diagram showing the microservices of the application.

Testing

For each microservice, we wrote unit tests during the development. For the Java Spring Boot applications, we tested with JUnit and for the Javascript-based applications, we tested with Jest.

Here is how you can run the tests of each microservice, assuming your current working directory is the EloquentElks root folder:

  • Frontend: yarn --cwd ./eloquent-elks-frontend test
  • AirBnb API: ./eloquent-elks-airbnb-api/gradlew -p ./eloquent-elks-airbnb-api test
  • POI API: ./eloquent-elks-poi-api/gradlew -p ./eloquent-elks-poi-api test
  • Recommender API: ./eloquent-elks-recommender-api/gradlew -p ./eloquent-elks-recommender-api test
  • POI Density API: npm test --prefix ./eloquent-elks-poi-density-api

The coverages of each microservice is available in the Code Metrics section.

For the frontend, we focused also on manual user acceptance testing, as it yields invaluable feedback regarding the usability of the application. Also, the frontend served for manual intergration testing, as it allows to call the microservices and verify if they work together properly.

Continuous Integration

For continuous integration, we use Travis CI. In order to build our microservice efficiently, we set up a build pipeline that consist of 5 build jobs, one for each API microservice.

For quality checks, we use Sonarcloud's Quality Gates, which are displayed at the top of this page. If a Pull Request is opened, Sonarcloud will provide the Quality Gate evaluation results automatically as comments. This is a very helpful tool to keep code quality on a good level.

The build job of each microservice takes care of building the respective database and database seed images, and pushes them to docker hub as well.

Continuous Integration Process

Other Resources

If you are interested in our working procedures, check out our YouTrack KANBAN board (requires a user account).

The rationale behind our choices and decisions is available in our YouTrack Knowledge Base (Wiki) (requires a user account).

Gantt charts for the stories and for the whole project are available at YouTrack Reports (requires a user account):

YouTrack Reports

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.