diff --git a/examples/commentsBox/README.md b/examples/commentsBox/README.md new file mode 100644 index 00000000..3f9e1e56 --- /dev/null +++ b/examples/commentsBox/README.md @@ -0,0 +1,32 @@ +# CommentBox Example + +## Setup Instructions + +To run this example locally, either download the whole ReactFire repo or just this /commentBox/ +directory. From the /commentBox/ directory, install the needed dependencies via bower: + +```bash +$ bower install +``` + +Then replace the example Firebase app URL with your Firebase app URL in +the index.html file: + +``` +var firebaseApp = "https://my-firebase-app.firebaseio.com/" +``` + +Finally, start up a server via Python (or your favorite method): + +```bash +$ python -m SimpleHTTPServer 8080 +``` + +Now you should be able to visit the example in the browser of your choice at [http://127.0.0.1:8080/](http://127.0.0.1:8080/). + +## Description +The official [React tutorial](http://facebook.github.io/react/docs/tutorial.html) is +a great introduction to React. This example replaces the REST-like server +with Firebase and the ReactFireMixin. + +The ReactFireMixin allows us to strip out the polling concept as well as the JQuery AJAX calls. The mixin allows you to bind right to your Firebase data and everything is kept in sync in real-time. diff --git a/examples/commentsBox/bower.json b/examples/commentsBox/bower.json new file mode 100644 index 00000000..e78fd5d3 --- /dev/null +++ b/examples/commentsBox/bower.json @@ -0,0 +1,32 @@ +{ + "name": "commentsBox", + "version": "0.1.0", + "homepage": "https://github.com/llad/ReactFire", + "authors": [ + "Mark Woodall " + ], + "description": "react.js comment tutorial updated for ReactFire mixin", + "main": "index.html", + "keywords": [ + "react", + "firebase", + "reactfire", + "mixin", + "tutorial" + ], + "license": "MIT", + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "react": "~0.10.0", + "ReactFire": "~0.1.4", + "firebase": "~1.0.15", + "showdown": "~0.3.1" + } +} diff --git a/examples/commentsBox/index.html b/examples/commentsBox/index.html new file mode 100644 index 00000000..8aed218c --- /dev/null +++ b/examples/commentsBox/index.html @@ -0,0 +1,116 @@ + + + + + Hello React + + + + + + + + + + + + + + + + + +
+ + + + +