Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

The Community Resource for Innovation in Polymer Technology web application

License

Notifications You must be signed in to change notification settings

C-Accel-CRIPT/LEGACY_cript-app-v2

Repository files navigation

CRIPT app

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.

Development

CRIPT is an open-source project. We welcome contributions and suggestions from tthe community.

App code structure

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.

Description of files

  • config.py: global configuration settings of the app, including defaults for production and development environments
  • wsgi.py: used by server as entry point into the application
  • requirements.txt: package requirements file used by the deploymeent server to install dependencies
  • Procfile: used by server in delopment environment
  • \src: directory for storing all appliction resources
  • src\_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 the home blueprint
  • src\_ingest: directory for the ingest blueprint, which contains app pages related to data ingestion
  • src\_tools: directory for the tools blueprint, which contains app pages related to polymerr informatics tools
  • src\_search: directory for the search blueprint, which contains app pages related to search
  • src\database: directory for database utilities
    • db.py: retrieves credential information for connection to the database
    • models.py: defines database models
  • application\templates: holds base HTML page templates to be inherited by other pages
  • application\static: holds static assets (CSS, Javascript, images) to be iniherited by other blueprints
  • application\resources: directory for REST API reesources
    • routes.py: maps API functionality to specified URL endpoints
    • XX.py: API functionality for XX objects, where XX can span a range of databse documents

Setup

  1. Create a new directory to store the project in, navigate to the directory, and create a virtual environment inside it: python3 -m venv venv
  2. 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
  3. To run the project, navigate inside the directory with wsgi.py and use python wsgi.py. The homepage will be viewable at http://127.0.0.1:8000
    • To quit the server, use control-c

Development TODO

  1. implement oauth (github, google) logins
  2. implement the full CRIPT data model in the classes in /src/database/models/
  3. condense a user's assets into a single JSON for manipulation by the frontend

About

The Community Resource for Innovation in Polymer Technology web application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published