Code Monkey home page Code Monkey logo

python-flask-es-test's Introduction

Python/Flask Testing prototype

A prototype web portal for genomic information

Prerequisites

Python 2.7.8 or greater on Mac OSX. Elasticsearch 2.4

Ensure you've installed pip, virtualenv, nodejs, elasticsearch (Note: This has all been done for you already if you are actually taking the test)

Detailed install instructions (MacOSX):

>/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
>brew install python@2
>brew install git
>pip install virtualenv
>brew cask install homebrew/cask-versions/java8
>brew install [email protected]
>brew link [email protected]

Background

This application is designed to mimic a typical web programming environment in the Cherry Lab. The stack uses Python (Flask) as a web framework and API, Javascript (ReactJS) for the web front end, and Elasticsearch as a ~static, searchable database. The database is designed to connect the genomes (list of genes), the functional annotations (GO terms), and disease associations for each gene from OMIM. These data are loaded and indexed into elasticsearch and results provided by the api using /api/search/ endpoint. The system is set up to load the data from the worm C. elegans. During the test you will be asked to extend the functionality of the software.

Organization of the software

Root directory

Contains this README various python and node package requirements, and a Makefile

scripts/elastic_search directory

Contains the code for loading the data and indexing it in Elasticsearch. The data files are located in scripts/elastic_search/data.

src directory

Contains the python Flask code to handle routing, search, and API functions (and dev server).

src/js_src

ReactJS code for the front end

src/templates

A single boilerplate jinja file.

src/build

Compile JS from node; recreated with make build.

src/public

Public libraries for Select CSS and Sigma plugin

Getting started with the Application

Create a virtualenv for isolating the python dependencies:

In one terminal, start elasticsearch

See: Elasticsearch Docs for more info

elasticsearch

In a second terminal (the prototype currently requires Python2)

:

virtualenv -p python2 prototype
source prototype/bin/activate (csh)
OR
. prototype/bin/activate

In the repository directory

make build
make index
make run

To run tests

source prototype/bin/activate
make tests

Development Environment Pro Tips

Assets are compiled using webpack. To enable hot module replacement in your development environment, run npm start while the dev server is running and refresh the page. Subsequent JavaScript changes will go to your browser as a "hot update" without refreshing.

You can run JavaScript unit tests automatically on each file change by running npm run test:watch.

JavaScript coding style is enforced with ESLint. The rules are configured in the .eslintrc file.

python-flask-es-test's People

Contributors

hitz avatar zoldello avatar

Stargazers

 avatar

Watchers

 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.