Home

Awesome

PushBack, notification server.

A light and very simple notification server for web apps based on WebSockets. PushBack is a self-hosted notification server built to be use in a web application. It is design to be very simple of use and lightweight.

How it work ?

PushBack has been design to be simple a usage, from server to server or server to client. It work in a simple way, 4 steps to be specific :

All notifications which is been carried out through PushBack should be tied to an application, so all you need to do, is to create an application in your account, after which you will have an application's token which should be use in every request to the server.

At this level, the server already "knows" your application and you have an application token.

You should now register all your users in the notification server and the application, registering all the users is not about saving their first name etc, it is only about user's ID, in fact you will just provide a list (array) of those ID [id1, id2, etc]. The concerned endpoint is : /api/v1/register/

At this level the server already "knows" your users.

Sending a notification is quite simple, it is a POST request to a HTTP endpoint on PushBack server: /api/v1/notify/ the query's parameter are :

A javascript client sdk is available to enable a connected user to listen for the notification from the server, using it just require a pass the current user's ID and 2 callbacks, one to perform an action when a notification happen and a second when it is disconnected to the server. Here is a sample of code :

<script src="/static/core/js/pusher.js" ></script>
<script>
  PushBack.init(APP_TOKEN_HERE, USER_ID);
  PushBack.subscribe(
      function(e) {
          // when a notification happen
          console.log(e.data)
          alert(e.data);
      },
      function(e) {
          // when disconnected to the WS server (for example when changing a page)
          alert('deconnection');
      }
  );
</script>

That is all, you need to receive a notification.

How to deploy it locally

Since it is a normal django application the deployment method it quite simple, here are the steps ( assuming you already have a python development evironment ready, if not check out this video : Setup a dev env for python on ubuntu (french)). You will also need to install redis server and let it run on the default port.

$ git clone https://github.com/simo97/PushBack.git
$ cd PushBack/
$ pip install -r requirements.txt
$ python manage.py createsuperuser
$ python manage.py migrate
$ python manage.py runserver

It's done the server will be available a localhost:8000

You are done

Can't deploy it ? relax there is a cloud version ( free of use )

PushBack Cloud just create an account there

TODO

Roadmap

What i am planning for this project :

Contributing

You want to contribute ? it is simple just :