This repository stores the web application and web API for CRIPT: the Community Resource for Innovation in Polymer Technology.
For example demonstrations of how to use the CRIPT API, see this example Python notebook.
CRIPT is an open-source project. We welcome contributions and suggestions from tthe community.
The application uses Flask as a backend framework. The code is organized according to the Blueprint architecture to encourage modularity, scalability and reusability. Each blueprint is separated by function in its corresponding directory. For example, user registration and authentication pages are managed by the user
blueprint, and general application pages are managed by the home
blueprint.
Static and html
template files are avilable both in the main application directory and in each blueprint directory. Files in \static
and \templates
in the main application directory can be inherited from any blueprint. Files in \static
and \templates
inside a blueprint directory are confined to that blueprint.
config.py
: global configuration settings of the app, including defaults for production and development environmentswsgi.py
: used by server as entry point into the applicationrequirements.txt
: package requirements file used by the deploymeent server to install dependenciesProcfile
: used by server in delopment environment\src
: directory for storing all appliction resourcessrc\_home
: directory for the home blueprint, which contains general application pages, lincluding those for user registration, login, logout, general about page, and general API information\static
: contains CSS and Javascript assets for the main app which are inherited by other blueprints\templates
: contains HTML pages for thehome
blueprint
src\_ingest
: directory for the ingest blueprint, which contains app pages related to data ingestionsrc\_tools
: directory for the tools blueprint, which contains app pages related to polymerr informatics toolssrc\_search
: directory for the search blueprint, which contains app pages related to searchsrc\database
: directory for database utilitiesdb.py
: retrieves credential information for connection to the databasemodels.py
: defines database models
application\templates
: holds base HTML page templates to be inherited by other pagesapplication\static
: holds static assets (CSS, Javascript, images) to be iniherited by other blueprintsapplication\resources
: directory for REST API reesourcesroutes.py
: maps API functionality to specified URL endpointsXX.py
: API functionality forXX
objects, whereXX
can span a range of databse documents
- Create a new directory to store the project in, navigate to the directory, and create a virtual environment inside it:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- To install packages into the virtual environment from an existing
requirements.txt
file, use:pip install -r requirements.txt
- To export packages from the virtual environment, use:
pip freeze > requirements.txt
- To deactivate the virtual environment, use:
deactivate
- To install packages into the virtual environment from an existing
- To run the project, navigate inside the directory with
wsgi.py
and usepython wsgi.py
. The homepage will be viewable athttp://127.0.0.1:8000
- To quit the server, use
control-c
- To quit the server, use
- implement oauth (github, google) logins
- implement the full CRIPT data model in the classes in
/src/database/models/
- condense a user's assets into a single JSON for manipulation by the frontend