Sunrise is a small bundle that allows to write a dedicated single page, frontend application. It was inspired by the short timings in hackathons and same-day release deadlines. It includes several libraries to help you move, like Twitter Bootstrap, LESS CSS, a small web server, and a simple JS framework. Sunrise's intention is to get you off the ground so there's little to learn.
You can do two things, you can either clone the repository. Or you can you can download a copy.
git clone --recursive firstname.lastname@example.org:sjlu/sunrise.git
When you're finished with that, you'll need to have node.js installed. Run the following command to install the dependencies.
npm install -g grunt-cli npm install
That's it, it's on to learn how to use Sunrise now.
There are only a couple files and folders you'll need to recognize. It's not as bad as it looks.
assets/less: This folder contains your LESS CSS styles. When you add a new LESS file, you'll need to include it in base.less.
$(document).ready()function. You'll need to declare your models in here, such as the frontpage.js file.
index.html: Anything requiring your HTML document goes here. You can create new HTML files in this root directory, but it is not recommended since the purpose is a "single-page" application.
Not done yet! You need to compile all your JS and LESS files together. You'll also need to run a simple server. By default, the server will run and listen to
To start it up, all you need to do is run:
Note that it'll fork a process in. Anytime you change a file, it'll automatically compile your JS and LESS files and snapshot it into the
public/ directory. You do not need to touch this directory ever.
You can deploy to Github Pages really easy by running this command.
This will create a new branch,
gh-pages which will have a clean root structure of your
/public directory with minified files.
Run the following command in order to view it at
git push origin gh-pages
You can easily deploy to Heroku also, you'll need to use a custom buildpack in order to do so.
heroku create --stack cedar --buildpack https://github.com/sjlu/heroku-buildpack-static.git git push heroku gh-pages:master
Note that the push will take the
gh-pages and make it the master branch on the remote since Heroku will ignore all branches other than
If you need help using this, feel free to submit an issue. If you encounter something that's intuitive, please help revise this document.