Git Product home page Git Product logo

skyscan-backend's Introduction

SkyScan - Weather Visualization App

Description:

This project was designed to visualize the weather data I extracted from the NOAA RAP weather model. The backend was built using the Node/Express framework, displaying requested information with a React frontend. The backend queries an AWS MariaDB database containing weather data for the continental U.S. going back one year, and uses just a single route to retrieve requested weather information.

Technologies Used:

  • Node.js and Express
  • MySQL
  • Deployment via Heroku

Routes

All routes are GET requests, and only one is actually called by the frontend (the others are just informational)

  • '/count' - number of rows in table (was useful during loading)
  • '/size' - size in GB of the table
  • '/times' - ordered list of unique times present in the table
  • '/weather/:param/:time/:coords' This route is used to retrieve data from the front end upon loading of the map, as well as when weather parameter, time, or viewport is changed.

Code Snippet

This was the SQL query called by the front end through the weather route:

	SELECT latitude, longitude, ${param}
		FROM weather 
	WHERE latitude > ${lowerLat} AND 
		latitude < ${upperLat} AND 
		longitude > ${lowerLng} AND 
		longitude < ${upperLng} AND 
		time_start = ${time};

Problems and Solutions

Changing Project Scope

I had initially planned for the backend of my project to be Python based, using the Django framework, but as my goals shifted from a photo sharing app with users and other models to a singular weather database, it made more sense to implement the backend using Node/Express.

Removing Request Body

While working on the frontend, I realized that Axios was unable to submit a body with a get request as I had tested using Postman, so to fix this issue, I switched the information previously contained in the body (the SW and NE coordinates of the area of interest) to the params. On the frontend, this two dimensional array was first stringified to JSON format, then on the backend was parsed back to its array format to be passed into the SQL query.

Future Features

  • I may try to implement a filter for the SQL queries with large amounts of datapoints, as the plotting library used in the frontend is not able to handle large amounts of data. This might save time during the data transfer phase of the request-response cycle.
  • The backend could use some security features. Because there ended up being no users / user information held in my database, this was an afterthought, but I would love to limit requests to avoid charges to my AWS RDB account where it is hosted.

skyscan-backend's People

Contributors

esaltzm avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  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.