Giter VIP home page Giter VIP logo

earthdata-pub-forms's Introduction

Earthdata Pub Forms

This is the Forms code repository for Earthdata Pub (EDPub).

Table of Contents

Contributing

See CONTRIBUTING.md for instruction for contributing to the EDPub project. Be sure to read that before submitting pull requests.

Installing

EDPub Forms use node v18.14.1. EDPub Forms use npm version 9.3.1. To build/run the Forms on your local machine, install nvm following the nvm Install & Update Script instructions.

We use npm for local package management, to install the requirements:

nvm install v18.14.1
nvm use
npm install

Running locally

To start and build all containers (api, dashboard, forms and overview):

npm run start-dev

The most current branch of each repo is the 'develop' branches.

You can navigate to 'http://localhost:8080/docs' to verify the api is running.

You can navigate to 'http://localhost:3000' to verify the dashboard is working. Log in initially by choosing 'Earthdata Pub System'.

After being authenticated, you can test forms is working by navigating to 'http://localhost:8081'.

Finally, test that the overview is working by clicking the forms 'Overview' link in the header.

You can spin down all containers, by running this command:

npm run stop-dev

If forms was ever previously opened, you may need to clear the localStorage in the browser. (Do this if the page is blank).

To run forms locally:

npm run start-forms-dev

The vue app can also be run locally using:

npm use
npm install
npm run build
npm run serve

To view logs from the Docker container:

npm run view-logs

Dashboard and API

The Forms application is dependent on the EDPub Dashboard and API. Follow instructions in each repo or the EDPub core repo.

The Dashboard will available at http://localhost:3000/

The API Swagger documentation will available at http://localhost:8080/docs/

Styling

EDPub uses EUI styling.

Developing

Docker setup inspired by https://daten-und-bass.io/blog/getting-started-with-vue-cli-on-docker/

Earthdata Pub Forms allows for local development without needing a local install of node.js, npm, and vue requirements by using Docker to serve the vue.js application. docker-compose makes container deployment simple. See the Dockerfile and docker.compose.yml for details.

To deploy using docker-compose:

docker-compose up

Edits to code

The vue.js application code base is mounted into the Docker container as a volume. This allows the code to be edited outside of the container while vue updates what is served within the container.

Vue builds inside Docker

The Docker container can be entered to run npm or vue commands that will persist outside of the container. To enter the container:

docker exec -it forms_forms_1 /bin/bash

You can run vue run build or other commands.

Testing

Earthdata Pub uses Cypress for e2e testing. The getting started guide was followed.

For setup, follow the instructions in the getting started guide. You may have a few system libraries to install.

Next view cypress.json to make sure your local dev settings match. To run the overview app locally along with testing, run:

npm run start-forms-dev
npm run start-overview-dev

After that it is done:

npm run cypress OR npx cypress open 

The last command will open cypress tests in browser mode. To run in headless mode:

npm run cypress-headless OR npx cypress run OR cypress-headless-all (for all browsers supported)

Firefox does not have a bypass for CORS, so at the time of this writing, the browsers cypress tests can be run on are chrome, chromium, edge, and electron. Cypress says firefox needs to add the equivalent CORS bypass like cypress.json/chromeWebSecurity.

Deploying

Earthdata Pub Forms deploys to AWS using Terraform through Bamboo. In the case that Bamboo is not available, follow instructions in terraform/README.

Documentation

Vuese auto documentation scrapes the javascript comments out of vue files and mixin file and builds markdown files for them. It creates the folder, 'autodocs', as depicted by it's config file .vueserc.

Documentation about Vuese can be found at their NPM page.

To build documentation:

install:

npm install -g @vuese/cli 

or

yarn global add vuese

then build:

npm run build-docs

then serve:

npm run open-docs

It will launch a document server and automatically open the browser.

earthdata-pub-forms's People

Contributors

broughtonkk avatar ebc0007 avatar broughtonkkornl avatar camposeddie avatar ckd002 avatar davisgauntuah avatar acharya-deepak avatar deepakacharyab avatar

Stargazers

 avatar

Watchers

Jon Carlson avatar  avatar Doug Newman avatar Nick Doty avatar

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.