https://github.com/cemac/swiftdb

THIS REPO IS ARCHIVED. Repository for the AfricanSWIFT Project Management Tool

https://github.com/cemac/swiftdb

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary

Keywords

flask-application gcrf-african-swift python university-of-leeds
Last synced: 5 months ago · JSON representation

Repository

THIS REPO IS ARCHIVED. Repository for the AfricanSWIFT Project Management Tool

Basic Info
  • Host: GitHub
  • Owner: cemac
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 1.7 MB
Statistics
  • Stars: 4
  • Watchers: 4
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Archived
Topics
flask-application gcrf-african-swift python university-of-leeds
Created over 7 years ago · Last pushed almost 5 years ago

https://github.com/cemac/SWIFTDB/blob/master/


SWIFT Project Management Database

![GitHub release](https://img.shields.io/github/release/cemac/SWIFTDB.svg) ![GitHub](https://img.shields.io/github/license/cemac/SWIFTDB.svg) [![DOI](https://zenodo.org/badge/134688007.svg)](https://zenodo.org/badge/latestdoi/134688007) [![GitHub top language](https://img.shields.io/github/languages/top/cemac/SWIFTDB.svg)](https://github.com/cemac/SWIFTDB) [![GitHub issues](https://img.shields.io/github/issues/cemac/SWIFTDB.svg)](https://github.com/cemac/SWIFTDB/issues) [![GitHub last commit](https://img.shields.io/github/last-commit/cemac/SWIFTDB.svg)](https://github.com/cemac/SWIFTDB/commits/master) [![GitHub All Releases](https://img.shields.io/github/downloads/cemac/SWIFTDB/total.svg)](https://github.com/cemac/SWIFTDB/releases) [![HitCount](http://hits.dwyl.com/{cemac}/{SWIFTDB}.svg)](http://hits.dwyl.com/{cemac}/{SWIFTDB}) Repository for the [AfricanSWIFT](https://africanswift.org/) Project Management Tool [(swift-pm)](https://swift-pm.herokuapp.com/). A web app that hosts an editable database for the project Management of African SWIFT. See [wiki](https://github.com/cemac/SWIFTDB/wiki) for user guide. ## Requirements ### Via anaconda - [anaconda (python3)](https://www.anaconda.com/download/) - [heroku cli](https://devcenter.heroku.com/articles/heroku-cli) _Individual python modules are managed in the pip lock file and installed as per installation instructions_ ### Pip - pip3 >= 18.0 - pipenv - autoenv - python3 - python-libs - Flaskr - postgresql-10.4 # Installation - `pipenv install --three` - there after `pipenv shell` **or** - `conda env create -f swift.yaml` - `conda activate swift` and thereafter to use
## Usage **first use** - `initdb -D ~/postgresql_data/` - `postgres -D ~/postgresql_data/ &` - assign: ```bash export APP_SETTINGS='config.DevelopmentConfig' export SECRET_KEY='key' export ADMIN_PWD='chosen password' export DATABASE_URL="postgresql://localhost/DBname" ``` - create database ```bash createdb DBname ``` - populate with ```bash python populatePSQL.py python manage.py db upgrade ``` - run on localhost `python manage.py runserver` **thereafter** - `pipenv shell` or `conda activate swift` - `postgres -D ~/postgresql_data/ &` - assign: ```bash export APP_SETTINGS='config.DevelopmentConfig' export SECRET_KEY='key' export ADMIN_PWD='chosen password' export DATABASE_URL="postgresql://localhost/DBname" ``` - run on localhost `python manage.py runserver`
## Hosting This app is currently hosted on [herokuapp](https://www.heroku.com/). For example push changes and launch the app: ```bash heroku login git config heroku.remote heroku git add -A git commit -a -m'commit messgae' git push heroku master heroku run -a swift-pm python manage.py db upgrade ``` or to populate the database: ```bash heroku config:set DATABASE_URL="postgresql://localhost/DBNAME" heroku run -a swift-pm python populatePSQL.py ```
# Backups For the SWIFT-pm app backups are scheduled daily at 00:00 (GMT) via ```bash heroku pg:backups:schedule --at '00:00 Europe/London' --app ``` These are retained for 7 days with one weekly backup stored for one week. To obtain a local copy to merge or manipulate or put to MS Access: ```bash createdb myapp_devel # start with an empty database heroku run 'pg_dump -xO $DATABASE_URL' --app | psql myapp_devel ``` ## To create copy of database in MS Access: 1. Run script dumpPSQL.sh ($ bash dumpPSQL.sh) to dump data from the postgresql database tables into csv files 2. Make a copy of the MS Access database file: $ cp SWIFTDB_template.accdb SWIFTDB.accdb 3. Fire up Windows using rdesktop (on foe-linux) and open MS Access and open the file SWIFTDB.accdb 4. Click 'External Data -> Saved Imports' from the ribbon and click 'Run' on each of the items in the Saved Imports list in turn. You may have to alter the paths to your csv files. 5. Save the database file, which should now include populated tables ## Alternatives: ``` # Create a public url heroku pg:backups:url --app sushi | cat # Download latest dump heroku pg:backups:download ```
# Web Page Information on the web page template. ## Flask The web app is built using python flask and thus the html file must adhere to the flask formatting rules. Each page builds on layout.html. ## Styling The styling for this webpage uses [BOOTSTRAP](https://getbootstrap.com/docs/3.3/) ### Custom features: To customise the bootstrap css a text css file is loaded in after the bootstrap library static/styles/stylesheet.css 1. Navbar - An additional div container is added to the nav bar in order to allow interaction with a text/css - stylesheet.css then contains an update to navbar-default 2. Tables - For admin the tables are very long added scrolling with sticky headers ## Scripting The following javascript libraries are loaded: - [jquery](https://api.jquery.com/jquery.ajax/) - [bootstrap javascript](https://getbootstrap.com/docs/3.3/javascript/) - A script is added to view.html to add in a select all check checkbox - A script has been added to redirect to https ## Static Here the custom style sheets and logos must be changed. If this system is to be used on another site the SWIFTlogo would need to be swapped and the colour coding (hex codes) in style sheet altered.

Owner

  • Name: Centre for Environmental Modelling And Computation
  • Login: cemac
  • Kind: organization
  • Location: Leeds

software to support environmental science

GitHub Events

Total
Last Year

Dependencies

Pipfile pypi
  • WTForms-Components *
  • certbot *
  • flask-migrate *
  • flask-script *
  • gunicorn *
  • jinja2 2.11.3
  • pandas <0.21
  • passlib *
  • psycopg2 *
  • wtforms *
requirements.txt pypi
  • alembic =1.3.2
  • blas =1.0
  • ca-certificates =2019.1.23
  • certifi =2019.11.28
  • click =7.0
  • et_xmlfile =1.0.1
  • flask =1.1.1
  • flask-migrate =2.5.2
  • flask-script =2.0.6
  • flask-sqlalchemy =2.4.1
  • intel-openmp =2019.3
  • itsdangerous =1.1.0
  • jdcal =1.4.1
  • jinja2 >=2.11.3
  • krb5 =1.16.1
  • libedit =3.1.20181209
  • libffi =3.2.1
  • libgcc-ng =8.2.0
  • libgfortran-ng =7.3.0
  • libpq =11.2
  • libstdcxx-ng =8.2.0
  • mako =1.1.0
  • markupsafe =1.1.1
  • mkl =2019.4
  • mkl-service =2.3.0
  • mkl_fft =1.0.15
  • mkl_random =1.1.0
  • ncurses =6.1
  • numpy =1.17.4
  • numpy-base =1.17.4
  • openpyxl =3.0.2
  • openssl =1.1.1d
  • pandas =0.25.3
  • passlib =1.7.2
  • pip =19.3.1
  • postgresql =11.2
  • psycopg2 =2.8.4
  • python =3.8.0
  • python-dateutil =2.8.1
  • python-editor =1.0.4
  • pytz =2019.3
  • readline =7.0
  • setuptools =42.0.2
  • six =1.13.0
  • sqlalchemy =1.3.11
  • sqlite =3.30.1
  • tk =8.6.8
  • werkzeug =0.16.0
  • wheel =0.33.6
  • wtforms =2.2.1
  • xz =5.2.4
  • zlib =1.2.11