Giter Club home page Giter Club logo

streamworks's Introduction

Streamworks

Send and recieve ethereum invoices, reconcile and audit application state with blockchain transaction data.

This app is a proof of concept for a system that lets contractors send invoices to a specified approver/manager account to fullfill those invoices. Furthermore it lets both parties track and audit the transactions in real-time.

This app uses DFuse library to reconcile invoice payment with blockchain data.

Dfuse is a set of APIs, Socket and GraphQL endpoints that lets you perform deep introspection of the blockchain and query transactions and accounts in real-time.

DFuse is used in the following specific scenarios in this app.

  1. Reconcile the app state and invoice data with the Ethereum blockchain data in real-time thus providing a user with a unified view of the app-state and the blockchain state. This is achieved through DFuse search GraphQL endpoints which is used to query "to: {address}" and "from: {address}" to track transactions originating from and to a given wallet address.

  2. Allow user to track invoice payments made and recieved in real-time through a progress-bar style transaction life-cycle view. This is done through a custom component that wraps over the transaction lifecycle subsription.

Demo website can be found here

You need to have Metamask installed on your browser in order to run the demo. Metamask can be obtained here

For the demo switch metamask to Ropsten testnet from Ethereum mainnet.

Now open two different browser windows to simulate the contractor/manager interaction and login via different metamask accounts.

One window will simulate a contractor user which will be used to create invoices.

The other will simulate a manager user which will fullfill the invoices. Note that you need some testnet ether to fullfill the invoices. You can obtain some here.

Once the contractor user creates an invoice it will appear on the manager users 'manager' tab. They can pay the invoice by clicking on the pay button which will open a Metamask popup.

Once the invoice has been paid both the contractor and the manager can track the transaction in real-time using the transaction progress-bar that will appear on the top of both users' windows.

Both types of users can audit the invoices sent and payments made in real time by navigating to the tabs belonging to the respective roles.

Screenshots

Create and list invoices

Create and list invoices

Create and list invoices

Create and list invoices

Running the demo

The uses Metamask web3 authentication.

It should technically work with any web3 provider but has only been tested with Metamask.

You need to have some Ropsten Ether to test the app. You can obtain some for your app here. One of them will act as a Manager and the other Contractor.

Installation

This repo consists of two projects

The client app is a React app. You need a DFuse API Key

Set the environment varaibles

REACT_APP_API_SERVER= // Gateway server API
REACT_APP_ETHQ_ENDPOINT= // https://ropsten.ethq.app or https://ethq.app depending on your environment
REACT_APP_DFUSE_API_KEY= // Dfuse API key
REACT_APP_DFUSE_NETWORK= // ropsten.eth.dfuse.io or mainnet.eth.dfuse.io depending on your environment
sudo npm install
npm start

To gateway is an Express/NodeJS app.

sudo npm install
npm start

The gateway requires MongoDB installed. To install MongoDB on Ubuntu follow the steps here

streamworks's People

Contributors

proy24 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.