Push Protocol is a web3 communication network, enabling cross-chain notifications, messaging, video, and NFT chat for dapps, wallets, and services.🚀
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.
- Install docker
- Clone the repo
git clone https://github.com/push-protocol/push-showrunners-framework
- To make it easier to use, we will be using Docker. You can initialize it using the code below code , but if looking for a manual setup then Refer this.
docker-compose up
- Open the root folder in another terminal and enter
yarn install
yarn start
- To stop running the showrunners server, press
Ctrl + C
- To stop running the docker, press
Ctrl + C
and enterdocker-compose down
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.
- 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.
- 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.
- 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.
- 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.
- 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.
Now lets have a quick tour into example and understand How to actually run a Showrunner framework over a demo HelloWorld channel
For more examples Refer this.
We would need external services of:
- Mongodb - Primary Database : Installation We would be using Mongodb Atlas
- Redis - Internal Cache : Installation
- Mongodb Atlas
For local ease of development, we make use of Docker.
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.
- Bug Report: Please create a bug report if you encounter any errors or problems while utilising the Push Protocol.
- Feature Request: Please submit a feature request if you have an idea or discover a capability that would make development simpler and more reliable.
- Documentation Request: If you're reading the Push documentation and believe that we're missing something, please create a docs request.
Not sure where to start? Join our discord and we will help you get started!
Check out our License HERE