Skip to content

mikew/brunch-flask

Repository files navigation

Brunch + Flask

Getting Started

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.

Features

Frontend

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).

Server

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/.

Testing

Frontend

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

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.

About

Brunch + Flask + Karma + Nose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •