Skip to content

This is conceived as a proof of concept to try and use GraphQL - React to visualize RRD files

License

Notifications You must be signed in to change notification settings

ckhardin/collectd-graphene

Repository files navigation

Flask+Graphene+RRD Project

This project shows a simple integration between Graphene, Flask, and a Collectd RRD datasets. The goal is to show a python only implementation of serving the RRD dataset to a Client side renderer based on d3.js.

In reviewing other collectd front ends, it appearred that they relied on a perl runtime to generate images and so the main objective for this implementation is to only user python on the server side and a javascript client visualization.

Getting Started

The sources of the project are organized as a flask application and run under virtualenv. Unfortunately, the python-rrdtool package from the pip needs to be compiled which is not always possible on all systems. So, the virtualenv is setup to allow the system site packages, which is not the default

cd collectd-graphene
virtualenv --system-site-packages env
source env/bin/activate

And now install the requirements/dependencies in the virtualenv

pip install -r requirements.txt

Start the server and run the application

python ./runserver.py

This would provide a service on the localhost at http://127.0.0.1:5000/graphql to access and run the basic queries.

Frontend

The directory layout for this project was done with a create-react-app tied to the backend flask server to create a full stack implementation.

sudo npm install -g get-graphql-schema
sudo npm install -g create-react-app

create-react-app frontend
cd frontend
npm install --save d3 relay-runtime react-relay react-faux-dom
npm install --save-dev graphql relay-compiler babel-plugin-relay@dev babel-plugin-macros

About

This is conceived as a proof of concept to try and use GraphQL - React to visualize RRD files

Resources

License

Stars

Watchers

Forks

Packages

No packages published