Skip to content

PhakamaniXulu/scoda

 
 

Repository files navigation

SCODA - Flask

SCODA Website Repository

Readme Contents

Information Resources

Creative Resources

Website Environments

Frontend Setup

Setting up Frontend Boiler Plate with Gulp and NPM

The following dependencies are being used:

  • Util - Log custom messages to the terminal
  • Sass - CSS pre-processor
  • Uglify - Minifies all JS files
  • Concat - Concatenate any JS or CSS files in the styles or js directories
  • Connect - Live Server Reload

Before starting, make sure the gulpfile.js and package.json files are in the root/app directory. Then do the following:

  1. Make sure you have node.js installed on your local machine
  2. NPM should be installed with node already, press the following to check if it has and what version npm -v
  3. Now we want to install gulp globally npm install --global gulp
  4. Now install the dependencies in the package.json file npm install
  5. Now all your node plugins are installed, and all that's left is to run the gulp task manager by typing: gulp

Backend Setup

Setting up the Environment with Python and pip

  • clone the repo
  • install a virtual env and activate it: virtualenv --no-site-packages env; source env/bin/activate
  • install requirements: pip install -r requirements.txt

Setting up the Database with PostgreSQL

Setup the PostgreSQL database (minimum version 9.6.*)

psql -U postgres
=# CREATE USER scoda WITH PASSWORD 'scoda';
=# CREATE DATABASE scoda;
=# GRANT ALL PRIVILEGES ON DATABASE scoda TO scoda;
=# \q

Construct your db app-side:

from opendatadurban.models import db
from opendatadurban.models.seeds import seed_db
run 'python rebuild_db.py'

Deploying database changes

  • SCODA App uses Flask-Migrate (which uses Alembic) to handle database migrations.
  • To add a new model or make changes, update the SQLAlchemy definitions in opendatadurban/models/. Then run python app.py db migrate --message "a description of your change"
  • This will autogenerate a change. Double check that it make sense. To apply it on your machine, run python app.py db upgrade head

Module list and syntax

// Coming Soon

Technical Specs for QA

Device and Browser Information

V1.0 will be a mobile first web-app, designed purely for mobile but viewable by web. The following browsers and devices need to be 100% design match:

  • Latest 3 Chrome, IE, Edge, Firefox Desktop
  • Latest 2 Chrome, Edge, Safari Mobile

Caveats, Dev Notes and or Outstanding Bugs

About

The South African Cities Open Data Alamanac

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 29.4%
  • JavaScript 27.7%
  • HTML 19.8%
  • SCSS 16.5%
  • Python 6.3%
  • Less 0.3%