Skip to content

NASA-OCO/oco3-car

Repository files navigation

Orbiting Carbon Observatory 3 (OCO-3) Command Access Request (CAR) System

This is for the OCO-3 CAR website that was designed using Python's Bottle library.

DOI

Language Language Language

Overview

The OCO-3 Command Approval Request (CAR) system was built using Python's Bottle library, with a MySQL database backend. The site employs very basic styling from Bootstrap 5, so you are left to style the site the way you would like.

Setup

Authentication to the database, LDAP server, port numbers, and server names are stored in a config.json file that is setup outside of the webroot. Make sure to indicate the path to the file in main.py and any other scripts. This code will require updates to make it work for your use case.

Directories

Several directories store reports, images, and other files. Some may need to be added as empty directories manually as they are not included in the repo.

Directory Structure

Directory Purpose
database/ database architecture files
reports/ reports generated by the site
site/ HTML templates for Bottle
site/includes/ menu and footer files for HTML templates
site/js/ Javascript files for HTML templates
utils/ maintenance and ingest scripts

The Website

The website is powered by Python's Bottle library, but launching the main.py script. Remember to set debug=False if using in production. Any credentials should be in the config.json file.

The front end of the tool icludes the following pages:

  • Homepage: Page with a short message that introduces the site.
  • Target Sites: A list of all potential targets for th mission.
  • Add/Update Sites: Allows users to add new target sites or update existing ones.
  • Selected Targets: All targets selected during the mission. There are scripts in the utils folder to update certain fields.
  • API: A list of API endpoints that generate reports.
  • Token: Generates a token for a registered user that they can use with some scipts in utils to update info about target selections.
  • Search: A deprecated page that is commented out in main.py but can be uncommented (and improved). There is an HTML tempate for this page in the site folder.

Database Backend

This website is backed by a local MySQL database. For MySQL, the Python Bottle-MySQL is utilized. The structure of the database can be found in db/oco3car_db_structure.sql.

Example Files

Sample reports are provided in the reports file. Also note that there are several places in main.py and the scripts in utils that you will need to fill in appropriate paths to different files.

Authentication

The site uses LDAP authentication to control access to specific pages. Use the config.json file to add in your LDAP server's information. It also uses a token for registered users so they can easily use scripts to update data, which call various endpoints.

A Note on requirements.txt

You may need to remove the mysqlclient requirement from the file, and install it separately through pip or conda.

About

OCO-3 planning software

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published