gem install foreman
npm install -g bower brunch
brunch new https://github.com/mikew/brunch-flask myapp
cd myapp
virtualenv venv
source venv/bin/activate
pip install -r server/requirements/development.txt
# or pip install -r server/requirements/test.txt
foreman start -f Procfile.dev
That's it. Visit http://localhost:5000
, as you save files in app/
that
page will update.
- Brunch (JS/Coffeescript/CSS/Sass)
- Flask (SQLAlchemy/Flask-cache)
- Karma
- Nose
Brunch compiles all your frontend assets for you. Just start
adding things to the app/
folder. By default this skeleton only comes
with support for JS, Coffeescript, CSS and Sass, but Brunch has support
for many, many, many more languages (Less, Stylus, Jade, ECO, EJS,
React, etc).
The server uses Flask + SQLAlchemy + Flask-cache.
Review server/config.py
and server/main.py
to see if there are any
changes you need to make, then start adding things in
server/blueprints/
, server/views/
or server/models/
.
I would suggest using one of Karma, Test'em or the browser, as those
will update as files in app/
are modified.
Using Karma:
node_modules/.bin/karma start
Using Test'em:
node_modules/.bin/testem
Using the browser:
foreman start -f Procfile.dev
Open http://localhost:5000/static/test/index.html
in your browser.
Using mocha-phantomjs:
node_modules/.bin/mocha-phantomjs public/test/index.html
server/tests/runner.py server/tests/ # Run all tests
server/tests/runner.py server/tests/test_foo.py # Run specific test
There is a Guardfile included that will run any tests whenever a file is saved.