DEV/CI Environment (continuously deployed):
- Available @ http://dev.scotty.frf.me/
Demo Environment (updated weekly)
- Frontend/API: http://demo.scotty.frf.me/
email: scotty@hackandcraft.com Password: Helloworld123
- install postgres (9.3 recommended)
- install python 2.7, setuptools, virtualenv
- create a virtual environment for this project, activate it
- run
python setup.py develop
for this project - copy a local.ini config file with proper Postgres Connection Strings,
sqlalchemy.url
- note this is mentioned twice in the config file
- run
alembic -c [CONFIG] upgrade head
- start the server with
paster serve --reload configs/[CONFIG]
- open a browser on http://localhost:8080
After each pull it is advised you
- run
alembic -c [CONFIG] upgrade head
All data model changes get set up through this cmd. If you see unexpect errors in the API, make sure to run the script.
If this script fails with "Unknown revision .....", you will need to empty out the DB and run the command again. This will destroy all test data, and thats ok.
Reset the db by running the following in postgres on the relevant database:
drop schema public cascade;
create schema public;
and then
- run
alembic -c [CONFIG] upgrade head
####Installing postgres
To install postgres python drivers, youll need postgres headers installed. If you are setting up a new DB make sure to install the POSTGIS extension. You can just run
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
#####Install psycopg2 on windows
See: http://stackoverflow.com/questions/3030984/installing-psycopg2-postgresql-in-virtualenv-on-windows
### Setup frontend environment
- Enter into
/scotty/static
- Execute
bower install
The main file is at /scotty/static/public/index.html
Static pages are located at /apps/index/pages
, each one uses /apps/index/template.html
.
Static pages need to be built for development & production.
- For production
grunt build
orgrunt build-index
will output it to/dist
folder. - For development
grunt dev:static-pages
or simplygrunt dev
will output it to/apps
folder. - While editing the pages
grunt listen
will executegrunt dev
every time a static page template is modified.
No build process required for development.
For production dependencies should be installed with npm install
.
Build process is executed with grunt build
To return to development mode after build two commands are required:
grunt clean
git checkout public
If you know a simpler way to do this please let me know.
To run the test npm install
is required. Grunt tasks are:
grunt test:unit
: To run unit testsgrunt test:e2e
: To execute end to end testsgrunt test
: All tests with linting
These are built with selenium and are stored in a separate repo here