Git Product home page Git Product logo

flair-notifications's Introduction

Build Status

Flair-Reporting-Engine

Application expose an api to schedule a job in cron fashion. At scheduled time, it will call grpc server and get data, render chart of that data. Type of chart depend on the request body. After that it will create a image of that chart and store in file system and then send mail to user defined in request body including that image inside html.

api end point:

curl http://localhost:8080/api/jobSchedule/

request body:

{
            "userid":"testuser",
            "cron_exp":"* * * * *",
            "report": {
              "connection_name": "Postgres-connection",
              "mail_body": "This is a test email to check api functionality",
              "subject": "API Testing",
              "report_name": "report_x8",
              "source_id":"1715917d-fff8-44a1-af02-ee2cd41a3609",
              "title_name":"Clustered Vertical Bar Chart"
            },
            "report_line_item": {
              "query_name": "test query",
              "fields": ["state","price"],
              "group_by": ["col1"],
              "order_by": [],
              "where": "",
              "limit": 5,
              "table": "Transactions",
              "visualization": "pie"
            },
            "assign_report": {
              "channel": "Email",
              "slack_API_Token":"xxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxx",
              "channel_id":"C9ZK2705U",
              "stride_API_Token":"xxxxxx-xxxxxx",
              "stride_cloud_id":"xxxxxxxxx",
              "stride_conversation_id":"xxxxxxxxxxxxx",
              "email_list":["[email protected]"],
              "condition": "test"
            },
            "schedule": {
              "timezone": "Asia/Kolkata",
              "start_date":"2019-02-04 08:25:00",
              "end_date":"2019-02-15 12:50:00"
              }
          }

#Getting started Requirements:

  • NodeJS
  • NPM
  • Docker

Clone the repository with command

git clone https://github.com/viz-centric/flair-notifications.git

Navigate to directory

cd  flair-notifications

Install dependencies

npm i

Start the database

cd deploy
docker-compose up -d
cd ..
npx sequelize-cli db:migrate

Start the Server

npm start

Enabling SSL

To enable SSL between flair notifications and flair bi, please follow the guide below.

Enable SSL between flair notifications and flair bi

To generate SSL certs, run this command:

cd certs
./generate.sh

Make sure you open that bash file and check SERVER_CN and CLIENT_CN variables there. If you plan to run in docker environment, then keep these values as is. If you plan to deploy to a real production environment, then change these values to contain real hostnames of the services.

After that, copy the whole contents from certs/* to flair-bi projects to the same location

cp certs ../flair-bi/src/main/resources/ssl/notificationscertsgen

Development

Build docker image

To build docker image, run this command

docker build -t flairbi/flair-notifications:v1.0.0 .

change v1.0.0 to any version of your choice.

flair-notifications's People

Contributors

admin-vizcentric avatar ir73 avatar johibkhan2 avatar khushbu-maurya avatar piyushmani avatar techkpi 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.