Giter Club home page Giter Club logo

conp-portal's Introduction

CONP Portal

Build Status Coverage Status

Requirements

This code requires Python 3.7

Python Virtual Environment

Create a Python virtual environment called venv and install Flask dependencies

In the top level directory:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Initialize the flask environment

You can set environment variables in the .flaskenv file. A template is provided for you to start from.

In the top level directory:

cp flaskenv.template .flaskenv

You will need to specify a database environment to use. The easiest for testing purposes is sqlite3 which is a filebased database system that will run locally on your system.

First you will need to make sure you install sqlite3 for you system. Information can be found at https://www.sqlite.org/index.html. For linux we recommend using the packaged version that comes from your distribution. To make sure it installed, you can run from the terminal sqlite3 and the application should run. Type .q and return to exit.

Edit the DATABASE_URL

In .flaskenv, replace the words <ENTER FLASK TOP DIR> with path to your top level flask directory. You should already be in it, so you can find the path with pwd.

Initilize the test database

We provide some initial data for you to create a functioning database for testing purposes. To initialize this:

In the top level directory:

flask db upgrade
flask seed_test_db
flask update_pipeline_data

Run Application

In the top level directory:

flask run

The application should now be live on http://localhost:5000/

Testing

We use the pytest framework for testing all aspects of the application. This will be automatically run by TravisCI when a pull request is made.

The tests exists in the tests directory and should not effect any of the development or production builds to run. Please feel free to add unit and functional tests with any new feature. Pytest will automatically pick up any tests that start with test_ that are placed in the folder under a directory. Please adhere to the structure there.

For unit tests of classes and utilities, use the folder tests/unit_tests For database specific testing, please use the folder tests/database_tests for blueprint and route testing, please use the tests/blueprint_specific_tests folder and place it in the appropriate blueprint specific directory.

Coding standards

In order to keep the Python code maintainable and readable, please run ./lint.sh to make sure the coding is up to standards. TravisCI will be checking this.

AWS Cloud9 (Experimental)

Some experimental testing cases are being explored with AWS Cloud 9.

To run the application on a Cloud9 instance:

    flask run --host=0.0.0.0 --port=8080

Deployment

This flask application is deployed on Heroku. More information will be available soon

conp-portal's People

Contributors

cmadjar avatar paiva avatar xlecours avatar dependabot[bot] avatar emmetaobrien avatar candicecz avatar mandana-mazaheri avatar tkkuehn avatar joeyzhou98 avatar zxenia avatar natacha-beck avatar papillonmcgill avatar glatard avatar driusan avatar surchs avatar haoweiqiu avatar mathdugre avatar desm1th avatar jbpoline avatar johnsaigle avatar h0bb3s87 avatar ghpbz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.