GithubHelp home page GithubHelp logo

nasa / code-nasa-gov Goto Github PK

View Code? Open in Web Editor NEW
236.0 23.0 68.0 31.67 MB

code.nasa.gov site leveraging the Open Source Catalog on github.com, powered by Polymer

Home Page: https://code.nasa.gov

HTML 13.46% JavaScript 1.58% CSS 84.46% Python 0.38% Shell 0.12%
nasa open-source code catalog gov-tech

code-nasa-gov's Introduction

CODE.NASA.GOV

Build Status

Catalog of Open Source Software from NASA. Built using Polymer.

Do You have a Open-Source Code Project For This Site?

Instructions

Instructions for releasing a NASA open-source project can be found on https://code.nasa.gov/#/guide.

Code.json vs Category.json

Newly approved code projects for release are added to code.json. You can add your approved open-source NASA project to code.json, here.

All federal agencies are mandated to have a code.json that is then harvested by the General Services Adminstration (GSA) and aggregated into code.gov.

Code.json is reformatted by a script run by NASA's open-innovation team into category.json. Category.json has some attributes not in code.json and is used to build the project page on code.nasa.gov.

Additionally, at this time, only category.json has the A.I.-generated keyword tags in addition to the human-generated tags. This may change in the future.

Why code.json is bigger than category.json

Some of the code projects in code.json have open-source licenses. Other projects in code.json have government-source only licenses, meaning sharing is constrainted to government agencies. All of the code projects listed in category.json have open-source licenses.

Making your own data visualization with the JSONs that drive code.nasa.gov:

If you make your own visualization, please add it as an issue. We would love to see it!

Running The Code In This Repository

Setup

test

Prerequisites

Install bower and polymer-cli:

npm install -g bower polymer-cli

Check that you are using Node v8+

node -v

Install dependencies

bower i

Start the development server

This command serves the app at http://localhost:8080 and provides basic URL routing for the app:

polymer serve --open

Build

This command performs HTML, CSS, and JS minification on the application dependencies and generates a service-worker.js file with code to pre-cache the dependencies based on the entrypoint and fragments specified in polymer.json. The minified files are output to the build/unbundled folder, and are suitable for serving from a HTTP/2+Push compatible server.

In addition the command also creates a fallback build/bundled folder, generated using fragment bundling, suitable for serving from non H2/push-compatible servers or to clients that do not support H2/Push.

polymer build

Preview the build

This command serves the minified version of the app at http://localhost:8080 in an unbundled state, as it would be served by a push-compatible server:

polymer serve build/unbundled

This command serves the minified version of the app at http://localhost:8080 generated using fragment bundling:

polymer serve build/bundled

Deploying

When deploying to a static web server (with no HTTP/2+Push), be sure to copy only the files from build/bundled directory (NOT the project directory) which contains a functional service worker and minified files. Put them in a top level part of the directory, not within another build/bundled directory within the production directory.

Adding a new view

You can extend the app by adding more views that will be demand-loaded e.g. based on the route, or to progressively render non-critical sections of the application. Each new demand-loaded fragment should be added to the list of fragments in the included polymer.json file. This will ensure those components and their dependencies are added to the list of pre-cached components (and will have bundles created in the fallback bundled build).

code-nasa-gov's People

Contributors

aakashrajput avatar addyosmani avatar andynoelker avatar badersur avatar briantoliveira avatar da505819 avatar danielcrendon avatar dcrendon avatar dcslagel avatar denar90 avatar dependabot[bot] avatar evantayloryates avatar frankiefu avatar jasonduley avatar jmhorn2015 avatar justingosses avatar keanulee avatar michaelficarra avatar open-nasa-robot avatar rubiojeffery avatar samccone avatar shivaylamba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code-nasa-gov's Issues

Decrease cost of fetching/parsing partials

Fetching partials currently costs us almost 2000ms:

and a whole lot of time in $apply and $digest. Given this isn't particularly complex, we're doing a little too much work here (across tags, social buttons, licenses)

Slow first load

I was trying to load it using my phone (Mi Redmi 3) and got this results.
Either very very first load or after clearing all browser data it takes > 10 seconds.

code nasa gov first

Hot stuff is code-nasa-app.html.

With second load everything is fine (files are precached).

code nasa gov second

We can use here either vulcanize/crisper. @addyosmani any thoughts?

Update:

Moreover, here pwmetrics results

nasa code gov pwmetrics

Introduce a build-step

There's some low-hanging fruit (such as concat/minification) we could tackle by adding a build step. To start, I was thinking of doing something very simple with npm scripts/adding a package.json. We could evolve this once we come up with a larger refresh.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular-resource.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular-route.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

404 Page is inaccessible

If an invalid URL is entered, e.g. https://code.nasa.gov/#/guid, a 404 page will be displayed.

I think the 404 Page (mainly composed from src/code-nasa-invalid.html) is inaccessible for the following reasons:

  • <a href="/#/">Go to homepage</a> is unable to click.
  • The style is inconsistent, like font-family, font-size, margin, padding, etc.

Suggestions: maybe some helpful guidance on navigation would be helpful? Or even suggest URL(s) that the user is intended to visited (e.g. in the above example, a use may actually want to visit https://code.nasa.gov/#/guide) with algorithms in calculating edit distance or something else.

Switch to asynchronously loading Web Fonts

We rely on quite a few different web fonts served from a Google CDN. If we switched to a Web Font Loader (like this) and used it asynchronously we would avoid blocking the page while loading in Angular and Bootstrap.

<link href='//fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Exo+2:400,600,700' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Special+Elite' rel='stylesheet' type='text/css'>

Downside to this is if we use it asynchronously, the rest of the page might render before the Web Font Loader is loaded and executed, which might intro some FOUC.

Asking for general thoughts here before working on a PR. cc @samccone

need menu bar text to have background color when scrolling up after down

Need menu bar text [Project Guide Share] to have background color when scrolling up after down.

Currently, there is only text and no background, so things get hard to read when menubar text overlays normal text.

To see this you have to scroll down on projects page on desktop and then scroll up.

Screen Shot 2019-04-04 at 11 36 22 AM

SRA link in Guide doesn't work

The link to the SRA list in the first step of the guide doesn't go anywhere. What is the intent of this? is it:

a) link to SRA list lower on the page
b) link to separate page for submitting requests to SRA
c) something else

Show search summary without scrolling down

My experience is I have to scroll down to see if there were search hits. I think I should see some level search result summary without scrolling down.

Current experience...
screen shot 2016-11-14 at 4 19 13 pm

Desired summary (shows after I scroll down)...
screen shot 2016-11-14 at 4 19 26 pm

console errors on latest deployment

Move all $http invocations into new services module

/js/controller.js invokes the $http provider twice to fetch JSON files located in /data. I'm proposing that we create a new services module that will expose 2 services through the use of $resource, one that returns/data/SRA.json & another that returns /data/catalog.json. The services module will then be injected as a dependency of the controllers. This is in an effort to separate concerns & uphold the recommended best practice.

Please assign me to this issue & I'll send along a pull request.

[nasa-next] Update README

Right now it's using the stock one from polymer-starter-kit. We should update it for this project.

Controllers are not a defined Angular module

/js/controller.js does not define an angular module, but instead defines vanilla Ctrl functions. While this approach works, it would provide maximum code reuse & modularity to define an Angular module for all controllers that is then a dependency of the root app.

Please assign me to this issue & I'll happily send along a pull request.

[nasa-next] Avoid FOUC

We should try to minimize FOUC as much as possible. Currently when you reload https://polymer-nasa.appspot.com you will see the footer shows up at the top right below the tabs and then immediately disappears after the list is rendered. To avoid FOUC one way we could do is to make <code-nasa-app> has min-height: 100vh so the footer is always at the bottom.

last pull request broke scrolling on first page, only 12 results show up initially

last pull request broke scrolling on first page, only 12 results show up initially

If you go to code.nasa.gov and scroll down only 12 results show. If you go to another page under code.nasa.gov and then back to the front page, all the results show.

I suspect this is due to the last update from the most recent pull requests.

Server not found

A link in string "Submit a NAMS request by filling out the [HQ AGCY NASA GitHub Collaborator Form]. "
is broken

  • src/code-nasa-guide.html
    line: 197

Too many fonts?

Considering the following code:

 WebFont.load({
    google: {
        families: ['Inconsolata', 'Source Code Pro', 'Droid Sans Mono', 'Exo 2:400,600,700', 'Special Elite']
    }
});

This site uses 5 custom fonts, I would argure that it's a bit over the top, both considering design but also performance wise.

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.