Code Monkey home page Code Monkey logo

ut_bitinc_project's Introduction

BIT Inc. 2020 - Bolk Assignment

Transics TX-TANGO Data Importer & Driver Style Analysis

The program will import data from Transics directly into the database. It will checks what fields are already present in the database before importing.

The program can also generate reports aimed at drivers for a given period of time.

Requirements

  • Go
  • R
  • SQL Server

Configuration

.env

The credentials of used services must be filled in the .env file. You can find an example of what information to fill-in in .env.example.

MSSQL

When newly creating a MSSQL database, it is necessary to set a default schema in the database prior to use the program so as following:

ALTER USER [DATABASE_USER_NAME] WITH DEFAULT_SCHEMA=[dbo]
GO

Dependencies

Install the required dependencies (on a Ubuntu/Debian based distribution) by running config/install.sh. You need read/write access to the folder tx2db is installed. More information in config/README.md

Installation

After having installed the necessary dependencies:

  1. git clone https://github.com/julienrbrt/ut_bitinc_project/
  2. cd ut_bitinc_project
  3. go build .

An executable tx2db is now available in your folder.

Usage

An efficient way to import or generate report periodically data is to use CRON (for instance every 4h for the importer and every wednesday for the analysis). This can of course be done manually using directly the tx2db commands.

An exaustive list of available commands can be found by running tx2db --help. A list of most common example will follow:

Importer

Run the import manually tx2db import

Options exist for this command, more information by running tx2db import --help

Report

Generate the report manually tx2db gen-report

Generate a report from specific date tx2db gen-report --startTime 2020-02-22

Generate a report of a specific range (default 7 days) tx2db gen-report --reportRange 30

Options exist for this command, more information by running tx2db gen-report --help

Architechture

  • analysis contains the driver analysis. Graphs are built with R and the different metrics in SQL via Go. The template of the report is written in .html. The reports are then converted to a .png thanks to phantomjs.
  • cmd are the commands accessible in tx2db
  • config are configuration files: please read config/README.md.
  • txtango implements the TX-TANGO API
  • utils implements the FTP upload, jokes, mail and PDF generation.

Emails

Emails are sent by tx2db at different occasions:

  • a mail is sent to SYSTEM_ADMINISTATOR_EMAIL when a new driver is imported or when a report has to be sent to a driver without email. The mail of that driver needs to be manually added into tx2db database under the drivers table.
  • a mail is sent to the drivers when a report is generated (unless --skipSendDriverMail is specified). The mail is sent to the address present in the drivers table.
  • a mail is sent to INSTRUCTOR_EMAIL with all the generated report in one pdf (ready to be print). That pdf has to uploaded to the FTP server defined in the .env.
  • a mail is sent to SYSTEM_ADMINISTATOR_EMAIL if there is a failure during the upload of the weekly report to the FTP server.

More Info

More info about Transics TX-TANGO API:

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.