Giter Site home page Giter Site logo

astronomy-flashcard-app's People

Contributors

cjjordan avatar kpoeltler avatar susanrbryant avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

astronomy-flashcard-app's Issues

jupyter.org/widgets

using jupyter.org widgets with our data
Ideas on how to incorporate would be awesome

Create PUT route for path '/api/description'

Create a PUT route the accesses the req.body and updates the userDesc in the db where the id matches.

This issue is complete when:

  • A PUT route exists for path '/api/description'
  • the route recieves the req.body
  • the db is updated appropriately
  • the new entry is returned to the front-end

Unit tests required for all functions

Unit Tests are required for each function.
Here is a list of functions that will need to be included in this project:

  • a toggle function for flipping the card
    -api ajax call function
    -incorporate pictures and data from api function
    -I have a drop-down menu function links to the deck of cards

Write Basic Pure functions

This is complete when

  • increment function
  • decrement function
  • resetCount function
  • updateArr function
  • resetArr function
  • removeSubject
  • All tests pass

source license

This project needs to have a license file due to the use of the starter code from Stanford's CS Homework assignment 3

Testing userDesc field e.g. Must not contain JS Script

Be able to edit Description by user

TESTING
-- Must not have " inside the input from used -- escape them
-- Must not be HTML or JS Script too protect the integrity of the db from attack

SQL Code
USE astronomy_db;

INSERT INTO cards (userDesc)
values ("");

Make a GET request to '/api/all' route

Make sure we are getting data from our server for '/api/all' route

This issue is complete when

  • Use AJAX to make a get request to path '/api/all'
  • console.log the data
{
    copyright: "Xiaohan Wang",
    date: "2018-03-06",
    explanation: "Why would the sky glow like a giant repeating rainbow?  Airglow.  Now air glows all of the time, but it is usually hard to see. A disturbance however -- like an approaching storm -- may cause noticeable rippling in the Earth's atmosphere. These gravity waves are oscillations in air analogous to those created when a rock is thrown in calm water.  Red airglow likely originates from OH molecules about 87-kilometers high, excited by ultraviolet light from the Sun, while orange and green airglow is likely caused by sodium and oxygen atoms slightly higher up.  While driving near Keluke Lake in Qinghai Provence in China, the photographer originally noticed mainly the impressive central band of the Milky Way Galaxy.  Stopping to photograph it, surprisingly, the resulting sensitive camera image showed airglow bands to be quite prominent and span the entire sky. The featured image has been digitally enhanced to make the colors more vibrant.    Follow APOD on: Facebook,  Google Plus,  Instagram, or Twitter",
    hdurl: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_3887.jpg",
    media_type: "image",
    service_version: "v1",
    title: "Colorful Airglow Bands Surround Milky Way",
    url: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_1080.jpg",
    userDesc : ""
}

APOD API

Using the APOD API
-https://api.nasa.gov/api.html
-see what the data looks like at https://api.nasa.gov/index.html#live_example
-read the documentation to find out which parameters we can get from the Ajax request.
-parse the images
-importing the APOD data into the MySQL database.
-need at least 365 pictures coupled with its matching data/description.
If the picture does not have a description one will be written for it and added to the database

Create a Model for cards

We need a model for card items

This issue is complete when:

  • There is an astronomy db
  • There is a model synced to the db
  • The model has all the fields from issue #35

Create a GET route '/api/all'

Add a get route for the path '/api/all' return a sample JSON

{
    copyright: "Xiaohan Wang",
    date: "2018-03-06",
    explanation: "Why would the sky glow like a giant repeating rainbow?  Airglow.  Now air glows all of the time, but it is usually hard to see. A disturbance however -- like an approaching storm -- may cause noticeable rippling in the Earth's atmosphere. These gravity waves are oscillations in air analogous to those created when a rock is thrown in calm water.  Red airglow likely originates from OH molecules about 87-kilometers high, excited by ultraviolet light from the Sun, while orange and green airglow is likely caused by sodium and oxygen atoms slightly higher up.  While driving near Keluke Lake in Qinghai Provence in China, the photographer originally noticed mainly the impressive central band of the Milky Way Galaxy.  Stopping to photograph it, surprisingly, the resulting sensitive camera image showed airglow bands to be quite prominent and span the entire sky. The featured image has been digitally enhanced to make the colors more vibrant.    Follow APOD on: Facebook,  Google Plus,  Instagram, or Twitter",
    hdurl: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_3887.jpg",
    media_type: "image",
    service_version: "v1",
    title: "Colorful Airglow Bands Surround Milky Way",
    url: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_1080.jpg",
    userDesc: ""
}

This issue is complete when:

  • a GET route is created with the path '/api/all'
  • when the route is hit the above JSON is returned to the front-end.

Test logic for API - match titles from API to column headings, remove titles

For example
-- Receiving and testing

-- GET the API data after midnight of every day
Set a default of "" empty string - just in case the INSERT INTO cards do not match
E.g. the 3rd one did not have a copyright

PUT the API call into db cards table

Match titles from API with column names
Remove column titles "copyright" :
Remove { at the start and } at the beginning and the end
Trim each value using trim()

Scaffold Back-End

This issue is complete when:

  • The server is listening
  • The public folder is indicated as the express static folder
  • a routes folder exists with and api-routes.js
  • a models folder exists with card.js, index.js
  • a config folder exists with config.json

Render Image

Write a function to render the image to the page

This issue is complete when:

  • add each object in the result to an array called cardsArr
  • add a currentCard var that defaults to 0
  • hdurl property of the cardArr[currentCard] is rendered to the page as an image

Test PUT route

Make an AJAX put request to test the PUT route.

This issue is complete when:

  • A PUT request is made with path '/api/description'
  • an object is sent with a userDesc and id
  • an object is returned from the server and console.logged

Wireframe

Wireframe Front-end

This issue is complete when:

  • and index.html exists in public folder with a link to the css and js files
  • style.css file exists in public/css
  • app.js file exists in public/js
  • index.html has the following divs:
    • div with id card

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.