This is prospective code that may soon power the new https://www.getlantern.org.
In the meantime, a live demo is available at https://getlanternsite.appspot.com/.
- Node
- Yeoman, Grunt, Bower (npm install -g yo grunt-cli bower)
- Ruby (comes with OS X)
- Compass (gem install compass)
- Python (comes with OS X)
- App Engine Python SDK
After forking this repository, run:
$ git clone git@github.com:<username>/www.getlantern.org.git
$ cd www.getlantern.org
$ npm install
$ bower install
npm and bower will fetch all the dependencies necessary to develop and run the site.
This site is built with the following tools:
- Yeoman
- Grunt
- Bower
- AngularJS
- AngularJS Yeoman Generator
- Angular-Translate
- AngularUI Bootstrap
- Compass
- Compass-Twitter-Bootstrap
Before jumping in, it's worth taking some time to get familiar with any of these you may not have used before.
To start up a development session using grunt's default dev server, run
grunt server
. That will start watching the source files, start the dev
server, open a browser pointing to the dev server, and detect when any source
files are changed and automatically compile any reload them in the browser.
To use the Google App Engine dev server, run the custom grunt task I hacked
together grunt gae_devserver
.
Don't hardcode any text in the html; instead add it to the translations file in
app/scripts/translations.js
and use
Angular-Translate to
translate it when the site is loaded.
Add automated tests in the tests
directory to make sure the site continues
to work as development progresses.
Protip: If you add a controller (or service, etc.) via yo angular:controller <newcontroller>
(or yo angular:service <newservice>
,
etc.), the Angular generator will stub out a test spec for you.
Run grunt build
when ready to locally preview a production build of the site.
This should lint-check the code, run the automated tests, then compile, minify,
concatenate, and otherwise modify source files for production. The resulting
built site will be output to the dist
directory. You can cd into it, run
python -m SimpleHTTPServer
, and then point a browser at the local built
version to make sure it looks the same as the development version.
To deploy to App Engine, go to https://appengine.google.com and make sure you can access the "getlanternsite" app there. Then open app.yaml and change the version to .
When ready to deploy, run grunt deploy
(another custom grunt task I wrote).
This will run the build
task mentioned above, and then
upload the files in dist
to production. You can then go to
https://-dot-getlanternsite.appspot.com/ to make sure
everything looks good on the production server.