We’re very happy to publish a guest blog post today by Ian Landsman, founder of UserScape and creator of Snappy, detailing how and why Snappy utilises Pusher to function.
Snappy is a streamlined customer support application for small teams. It is designed to make handling customer support emails quick, simple, and painless. As well as handling email Snappy has reporting so you can easily stay up to date so customers are getting a response fast.
One of our primary goals from the beginning was to make the app very fast and have the primary areas work in real time. We came across Pusher in April 2012 and have been loving the service ever since. Snappy utilizes all three of Pusher’s channels in various places.
We use public channels in two primary areas. The first is for communicating any important news. It’s also integrated with our deployment process. Once we make a new deploy we notify any connected clients that we are rolling out an update. Also we have a way of kicking out all connected clients in case we need to make some weird changes. This happens very rarely but we have this safeguard in place when we need it.
Private channels are used throughout the app and handle everything from our messages, settings, phrases, etc. With Pusher we are able to keep all connected clients up to date in real time. This means that once you login the client rarely has to make many server requests unless you are performing some type of create, update, delete request.
Finally, by utilizing presence channels we are able to show any team members that are currently viewing the same request. This allows our users to get that instant feedback and see if someone else is handling the request already.
For the code side we use existing plugins and code whenever possible. Snappy’s backend is written in PHP so we used the Pusher Server available from packagist. From here we just decoupled the calls in our own class.
On the client side we are using Backbone and I would recommend the BackPusher plugin. We didn’t use this because we handle our main Ticket collection in an unusual way but that plugin should work in 90% of use cases.
For the presence channels all we did was subscribe a user when they view a ticket. The pusher:subscription_succeeded event then returns a list of any other users on the channel and from here we just create a dummy collection to hold the list of users. With that setup you then have access to all the typical Backbone collection events.
Pusher is really easy to work with and the docs are great. The Pusher team has done an excellent job and we found them really useful before and during our development of Snappy.
Want to publish a guest post on the Pusher blog? We’d be happy to have you – just give us a tweet or get in touch by email!