How nasa/code-nasa-gov works
Project Overview
• This project is a front-end driven, static website that catalogs NASA’s open-source software. It is built using Polymer and uses JSON files as the data source (e.g., code.json, catalog.json). In addition, there are supporting scripts (in cron_scripts) and build configurations that help transform and deploy content.
• The primary goal is to display NASA’s open-source software projects, using a data visualization approach that leverages pre-built JSON catalogs and dynamically loaded Polymer components.
Main Components
a. Frontend Application:
• UI Assets: Include the HTML, CSS, and JS files found in directories such as AR/ and src/. These are the main building blocks for the visible interface.
• Polymer Components: Highlight how Polymer (with its CLI and configuration in polymer.json) is used to structure the application, including lazy-loading fragments (as described in the “Adding a new view” section).
• Service Worker: Represent the service-worker.js and sw-precache-config.js files. This indicates client-side offline caching and pre-caching of resources.
b. Data Layers:
• JSON Data Files: Represent the various JSON files in the data folder (e.g., catalog.json, SRA.json, code.json in the deprecated folder, etc.). These provide the application with the core content and feeds.
• Data Transformation Process: Note the role of the cron_scripts (e.g., code_to_catalog.py, release.sh) which transform the original code.json to category.json for the application’s consumption.
c. Build & Deployment Process:
• Build Pipeline: Include the build process commanded by Polymer CLI (with commands such as “polymer build” and “polymer serve”). This builds the project into two main outputs: “unbundled” (optimized for push-enabled servers) and “bundled” (for legacy or non-H2 servers).
• Deployment Artifacts: Emphasize that the built output (especially folder build/bundled) is the one that’s deployed, with configurations in files like app.yaml (which suggests possible deployment on a cloud platform such as Google App Engine).
d. Development & CI/CD:
• Source Control & CI: Indicate that the project uses Git (with .gitignore and .gitattributes) and continuous integration via Travis CI (and GitHub workflows such as stale.yml and test.yml). These can be shown as peripheral components that ensure code quality and automated testing.
e. Static Assets and Miscellaneous:
• Supporting assets like images, fonts, and additional static documents (e.g., NASA-M-16-21-Framework.pdf) should also be shown as resource feeds for the frontend.
Relationships and Data Flow
• How the cron scripts update or transform the JSON data.
• The build step where Polymer CLI reads configuration (polymer.json, sw-precache-config.js) to bundle assets and generate a service worker.
• The flow of data from the transformed JSON towards the Polymer components, which render the UI.
Final Advice
• Be very detailed where possible. Capture even the “supporting” components such as the CI scripts and deployment configurations.