push-protocol / push-showrunners-framework

The PUSH Showrunners handles the channels created and maintaned by us. It also shows how easy it is to interact with the protocol to build highly customized notifications for your dApp, smart contracts or even centralized services.
Apache License 2.0
14 stars 14 forks source link

Push Protocol is a web3 communication network, enabling cross-chain notifications, messaging, video, and NFT chat for dapps, wallets, and services.🚀

discord twitter youtube

PUSH Showrunners (Server)

The showrunners framework is a scaffold that developers can use to build out notifications for their use cases. Showrunners framework provides the tools and helpers required for constructing the payload and sending the notification using the Push protocol infrastructure.


Installation and Set Up Guide

To exit


Channel Structure

Before we dive into an example ,Let's understand the requirements for the folder structure inside the src/showrunners folder and how you can use them to quickly refine / debug / deploy your channels.

Each folder inside src/showrunners is treated as their own channel. Showrunners is designed to be a plug and play solution for your channel which means that each of the folders designated filenames are used to add-on various functionalities.

  1. channelChannel.js [.ts] (Mandatory)
    • Example: helloWorldChannel.js
    • This file contains all the logic functions of your channel, it can for instance have a way to poll all opted in users of your channel and based on certain conditions that are met, fire notifications out.
  2. channelKeys.json (Mandatory)
    • Example: helloWorldKeys.json
    • This file contains all your private keys that you either belong to the channel you created or have authorized the wallets to send notification on your channel's behalf.
  3. channelRoutes.js [.ts]
    • Example: helloWorldRoutes.js
    • This file contains the routes that you will enable to ensure you are able to manually trigger notification or any other logic points in your channelChannel.js [.ts]
    • You will ideally use the route of this files in postman to trigger logic functions / test them out.
  4. channelJobs.js [.ts]
    • Example: helloWorldJobs.js
    • This file contains your cron jobs to trigger logic points in your channelChannel.js [.ts]
    • The file is based on node-schedule and can handle a wide variety of automated cron jobs to enable sending wide array of notifications based on triggers.
  5. channelAWSSNS.js[.ts]
    • Example: helloWorldAWSSNS.ts
    • This file contains the webhook helpers and handle the logic points for consuming a webhook.
    • This file is based on AWS-SNS and can handle the variety of logics for consuming webhook to enable sending wide array of notifications based on webhook triggers.

Examples :

Now lets have a quick tour into example and understand How to actually run a Showrunner framework over a demo HelloWorld channel

Hello World Example

For more examples Refer this.


Technical Details

External Services

We would need external services of:

For local ease of development, we make use of Docker.


Contributing

Push Protocol is an open source Project. We firmly believe in a completely transparent development process and value any contributions. We would love to have you as a member of the community, whether you are assisting us in bug fixes, suggesting new features, enhancing our documentation, or simply spreading the word.

Not sure where to start? Join our discord and we will help you get started!

Discord


License

Check out our License HERE