This project is built on the Hull platform, with Aura, Backbone.js and lots of other cool libraries.
You don't need an account on Hull to use it locally, the App key is already present in this app.
This is demo entirely built with Hull. Connect, and immediately know if you've won or lost.
What you'll win here is an immediate access to hull. Also, somewhere deep in the source are hidden more codes to gain immediate access to Hull, without waiting for an invite.
Play Sweepstake (http://hull.github.com/hull-sweepstake)
The following features are demoed in this app. It has no server code and barely any Javascript.
- Login with Twitter
- Use a hull Sweepstake widget to know if you've won or lost.
- Share your result on Twitter
The steps below are tailored for Mac environments. Linux should mostly work the same.
-
Create a new Hull app using our Grunt-init task.
grunt-init sweepstake
-
Create a HTML page called
admin.html
, and insert asweepstake_admin@hull
widget to write your questions.<div data-hull-widget="sweepstake_admin@hull"></div>
-
From there, create a new Sweepstake, give it a name, a description, and a hard to guess secret.
-
Enter the Prizes for this Sweepstake. The format is plain JSON. For your convenience a template for it is bundled in this repository, in
prizes.json
-
Copy the newly created Sweepstake's ID, and insert a
sweepstake@hull
widget inside the main HTML page.<div data-hull-widget="sweepstake@hull" data-hull-id="YOUR_SWEEPSTAKE_ID"></div>
-
Create
widget/sweepstake/working.hbs
to remove the default wording and add a spinner. -
Create
widget/sweepstake/won.hbs
to change the way we present prizes. -
Insert a
share@hull
widget inside the main HTML page.<div data-hull-widget="share@hull" data-provider="twitter" data-hull-label="Tweet!" data-hull-text=""></div>
This will create a "Tweet!" link that will open a Twitter popup prefiled with the value that you've put in
data-hull-text
. -
Do a bit of CSS for an effective design.
-
There's no step 10.
First, clone this repository :
git clone git://github.com/hull/hull-sweepstake.git
Install node.js (Only used for building the app, not needed for deployment)
Install grunt-cli as a global module. It's amazing so you should do it anyways.
[sudo] npm install grunt-cli -g
[sudo] npm install bower -g
then install grunt and it's modules in the project's folder.
cd hull-sweepstake/
npm install
bower install
To run the app locally, run: grunt server
.
First create your heroku app if it's not done yet :
heroku create your_amazing_app
Build your app for deployement, and commit the compiled version:
grunt build
cd dist
git init
git add dist
git commit -m "Deployment build"
Deploy your app to heroku:
git subtree push --prefix dist heroku master
open http://your_amazing_app.herokuapp.com