Coder Social home page Coder Social logo

asteroids's Introduction

Asteroids Near Earth

Shows asteroids that have had close approaches to Earth for a given week. Data source: NASA NeoWS (Near Earth Object Web Service) - https://api.nasa.gov

Getting started

Prerequisites

To run these applications locally, you need Java and Maven installed for backend, and Yarn / Npm and Node installed for frontend:

# Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install SDK Man
brew install sdkman
# Install Java:
sdk install java 11.0.16-zulu  
# Install Maven
sdk install maven
# Install Yarn:
brew install yarn
# Install Node:
brew install node

Cloning the repo

# Clone the repository
git clone https://github.com/solveigmarianes/asteroids.git

# Navigate into the directory:
cd asteroids

Backend

# Navigate into the backend app directory: 
cd asteroids-backend

# Install and run the application:
mvn clean install spring-boot:run

The app should now be running on http://localhost:8080

Frontend

# Navigate into the frontend app directory
cd ../asteroids-frontend 

# Install dependencies: 
yarn

# Run the application in development mode:
yarn start

The app should now be running on http://localhost:3000

Endpoints

GET /api/asteroids

Get all asteroids that has a close approach to Earth from the date specified and one week forward.

Required query param: startDate, format: YYYY-MM-DD

Example request: http://localhost:8080/api/asteroids?startDate=2015-08-09

GET /api/asteroids/{id}

Get asteroid by ID.

Path param id, format: ddddddd

Example request: http://localhost:8080/api/asteroids/2465633

Thoughts on future improvements

General

  • Write tests
  • But both apps into a Docker container, so it's easier to run

Backend:

  • Add Swagger docs for endpoints
  • Create DTOs that are better suited to the frontend consumers' usage.
  • Improve caching: Should cache one entry per date, instead of one entry per period when caching collections.

Frontend:

  • Add icons to improve intuitiveness. Display icons instead of 'Yes' and 'No' values.
  • Improve accessibility so that HTML markup is semantically precise.
  • Asteroid Detail page: More information - Display orbital data. Add graphics to visualize size, orbit, trajectory etc.
  • Better null-checking for possibly empty JSON objects

asteroids's People

Watchers

Solveig Maria Nes 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.