npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

flowhub-bigiot-bridge

v0.4.3

Published

Offer data in BigIot marketplace using Flowhub IoT platform

Downloads

17

Readme

bigiot-bridge Greenkeeper badge Build Status

Bridge for providing data as offerings in the BIG IoT marketplace, using the Flowhub IoT platform with the NoFlo Flow-Based Programming runtime.

Status

0.3: Production

  • Can expose multiple datasets as offerings in BigIoT marketplace
  • Example using the Deutche Bahn and City of Cologne public parking APIs is provided
  • A public service instance is running on https://flowhub-bigiot-bridge.herokuapp.com/ since November 2017

License

MIT

Running locally

Prerequisites

  • Docker is installed and daemon running
  • BigIot marketplace credentials (provider id+secret)
  • Redis database instance running. Can be locally, via a Docker image, or a cloud service

Setup

Create default settings files

cp .env-default .env

Edit .env to contain your provider id/secrets.

Running

Start the service

docker-compose up

Checking that it works

The new offering(s) should now be available under My Offerings

To request data from the API without going through the marketplace, you will need an authentication token. Create it using:

export TOKEN=`node -e "console.log(require('jsonwebtoken').sign({}, Buffer.from(process.env.BIGIOT_PROVIDER_SECRET, 'base64'), {expiresIn:'1h'}))"`
curl -H "Authorization: Bearer $TOKEN" http://localhost:5000/txl

Configuring and adding new offerings

The offerings are set up as a NoFlo graph, a 'Data Provider'. This graph should use the Provider component, and:

  • Set up the BigIot offering description, send it to OFFERING port
  • Setup configuration and send it to CONFIG port
  • Connect to the REQUEST port. On data, perform requested query
  • Respond with the returned data by sending to RESPONSE port

Examples can be found in the "ParkingProvider" and "WeatherProvider" graphs, and the "Provider" and "ParkingProvider" tests.

Deploying to Heroku

Prerequisites

  • An Heroku app with the Container stack enabled
  • Heroku Redis addon enabled for the app
  • Heroku CLI tools installed locally, logged into the Container registry using heroku container:login

Pushing

docker-compose build
heroku container:push web

Best practices

Local caching

The data provider may look up the data in memory or local database, or fetch from external APIs. It is recommended for data that changes slowly that they are fetched periodically separately from the HTTP requests nd cached in a local database like Redis. The data provider in the HTTP request path then only queries the local Redis database. This is expecially for third-party APIs, which have an unknown amount of latency/uptime. The third-party APIs may also not support the desired querying methods, like geo-based queries.

Changes

  • 0.3.2 (February 21 2018)
    • Updated to latest BIG IoT JS library
    • Set the example data offerings to "FREE"
  • 0.3.1 (February 19 2018)
    • Fixed datatypes used in the parking offering example
  • 0.3.0 (February 9 2018)
  • 0.2.0 (December 12 2017)
    • Added a second data source for the ParkingProvider: parking spaces in Cologne