A simple client-side pastebin clone.
In this example, we build on the the Firepano example that uses unguessable locations to serve shared content. Like Firepano example, we use the content as the hash into Firebase for storing the data that was uploaded.
We add a couple of new features with this example: a view count as well as a count of the number of people currently viewing the page. We use transactions to properly increment the count value; we use the Firebase presence API to keep track of when people start viewing the page as well as when they browser off the page. A couple of new rules make sure we secure the new metadata.
You can find the rules for this application in rules.json.
- Add security rules enforcing monotonically increasing counts.
- Add a secret token allowing anonymous uploaders to delete a paste.
- Add simple login using Singly to let users manage bins long term.
No part of this project, except sha256.js, may be copied, modified, propagated, or distributed except according to terms in the accompanying LICENSE file.
sha256.js is part of CryptoJS which is distributed under the terms of this license (BSD 3-clause).