Git Product home page Git Product logo

near-earth-objects's Introduction

Back-end Test (PHP + Symfony)

How to run project on your machine

Prerequisites: docker-compose and Make

To start project run following command in the project root folder: make up

API will be available on http://localhost:8007

To load data fixtures into database run following command: make fixtures

What have been done and what have not been done yet

Done:

  • project's Docker and Makefile setup
  • API endpoints
  • fixtures
  • functional tests for API

Not done:

  • pagination for /neo/hazardous endpoint
  • documentation and sandbox for API (Swagger)
  • console command that retrieves the list of Asteroids and saves it to database
  • code style
  • CI / CD
  • small improvements for code and tests (see TODOs in source code)

Requirements

This test requires:

  • Working with PHP8.* and Symfony
  • Mysql Database
  • Use Symfony coding standards
  • Nginx

Required Functionality

Implement a call to NASA API to retrieve the list of Asteroids based on their closest approach date to Earth (Near-Earth Objects - NEOs):

  • Use api.nasa.gov.
  • API-KEY: N7LkblDsc5aen05FJqBQ8wU4qSdmsftwJagVK7UD
  • Documentation: https://api.nasa.gov/ and go to Browse APIs -> Asteroids - NeoWs
  • Limit the query to the last 3 days.
  • Persist the resulting list in your DB without duplicates.

Define the data model as follows:

  • date
  • reference (neo_reference_id)
  • name
  • speed (kilometers_per_hour)
  • is hazardous (is_potentially_hazardous_asteroid)

Create the following routes in your application:

  • GET /neo/hazardous

    • return all DB entries which contain potentially hazardous asteroids (with pagination)
    • response format: JSON
  • GET /neo/fastest?hazardous=(true|false)

    • calculate and return the model of the fastest asteroid with a hazardous parameter, where true means is hazardous
    • default hazardous value is false
    • response format: JSON
  • GET /neo/best-month?hazardous=(true|false)

    • calculate and return a calendar month in the current year with most asteroids with a hazardous parameter, where true means is hazardous
    • default hazardous value is false
    • response format: JSON

Bonus points:

  • Clean and straightforward code
  • Use restful API best practices
  • Create functional tests for API endpoints.
  • Use Docker

Good luck!

near-earth-objects's People

Contributors

sushchyk avatar

Watchers

 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.