Python on the backend, JS+SCSS on the front. Fully responsive, mobile-first blog-oriented framework.
-
Lean
Code weight and complexity must be as small as possible. Code stats will be tracked for every release. Code size increases must be justified.
-
Mobile-first
Everything will be designed starting from mobile. Desktop support is secondary, and must have minimal impact on the weight of pages delivered to mobile. This means lazy-loading advanced features and images. If the code is light enough, the augmentation should be seamless on the desktop.
-
Open
Dev process and code will be opinionated but open. The project will be self-documenting, as the resulting site gets deployed at mmcgahan.github.io/backflask. It will specify dependencies and make the barrier to entry as small as possible.
-
Install Python packages with
pip
.$ pip install -r requirements.txt
You might get an error here if you don't have PostgreSQL installed, because the requirements file will try to install a PostgreSQL Python driver. You can use Homebrew on Mac, or install Postgres.app and make sure
pg_config
is in your$PATH
. -
Edit the app config file
In your
instance/
directory, create aconfig.py
file that declares the following variables:SQLALCHEMY_DATABASE_URI
(e.g. postgresql://user@localhost:5432/backflask)SECRET_KEY
(a random string that is used for connections with the XML-RPC API)
-
Create and initialize the DB
For local development, just set up a simple SQL database in the flavor of your choice - Backflask uses SQLAlchemy to manage the DB, so as long as your
SQLALCHEMY_DATABASE_URI
config variable is set correctly, it will connect to any existing DB.In SQL:
CREATE DATABASE backflask;
I recommend using Postgres.app on Mac to get PostgreSQL up and running. Once installed, run
psql
from the command line to open a SQL prompt.Then run
pysetup.py
to create an Admin user, an example Category, and an example Post. -
npm install
(loades package.json dependencies, including Grunt) -
grunt
- load bower packages (not ready)
- build scripts + stylesheets (dev, uncompressed)
-
grunt watch
- flask dev server
- watch for python changes (and script+style+template), livereload
-
grunt build
(not ready)- build for production
- precompile handlebar templates
- concat and uglify
- figure out how to load different scripts in templates for production
- build for production
-
grunt release
(not ready)- git flow create release, push
- Flask
- Base template generation (Jinja2)
- JSON API
- Authentication for remote editing
- SQLAlchemy
- scrypt
- PostgreSQL
- Backbone.js
- Lodash
- Handlebars
- Foundation
- Browserify (or Require.js?)
- Grunt
- watch
- connect
- uglify
- livereload
- Bower
- SASS + Compass + libsass