Giter VIP home page Giter VIP logo

data-integration-challenge's Introduction

Data Integration Challenge

Code Climate Travis CI Coverage Status

Obs.: That's a technical challenge applied by @alcmoraes to Neoway

Obs².: Refer to go-data-integration-challenge for the Go version of this challenge

Requirements

  1. Docker
  2. Docker Compose
  3. Ports 3005, 8081 and 8082

Features

It will build a mongo and restify docker containers, where the restify container automatically starts two proccess in background

  1. The API client on port 3005
  2. A node-schedule cronjob that runs each 15 seconds and takes the last file from csv/uploaded folder to import into the database.

CSV's uploaded via API are not imported right away. They are stored in csv/uploaded folder so the node-schedule crobjob can import it in another thread.

Usage

Use make to show the following commands in your terminal

Command Description
help Gets this table in your terminal
setup Installs the docker containers and import initial data
start Starts the project and open API on port 3005
stop Stops the project
logs Shows the logs from the project
check Run unit tests
nyc Serve the Tests Coverage UI on port 8081
docs Serve the Swagger Explorer UI on port 8082
lcov Output coverage lcov data
remove Stops and removes the containers from this project

API Documentation (Swagger)

Ensure the project is running (make start).

Execute make docs, this will start server on port 8082.

For running the api docs outside localhost, remember changing the host config parameter on config/{environment}.json.

Project Coverage (NYC/Mocha)

First ensure project is running. If not go and start it with make start. Execute make check. To see the coverage UI, go for make nyc. It will start a server on port 8081.

Import file via command line

The project have an importer that works via command line:

  docker exec -it yawoen_api bash

Now you can execute the following command to be given help

  node /var/www/tasks/import_from_file.js help

Example output Example output

Obs.: Please be aware that by default this script WILL NOT MERGE the content from the CSV file. For merging source into database instead of creating new entries, remember to use merge=true flag.

data-integration-challenge's People

Watchers

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