Skip to content

kalpeshmahida/BackendDeveloperAssignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment Submission for Backend Developer

This repository is part of assignment for Backend Developer.

This document contains information on how to install, and setup this assignment script.

Installation

To install this script, run the below commands

$ git clone https://github.com/kalpeshmahida/BackendDeveloperAssignment.git
$ cd BackendDeveloperAssignment
$ composer install

If you want to run the script using built-in server, execute this command

$ php bin/console server:run

Feed Command

Run this command specifying API-KEY to retrive the data from the last 3 days from nasa api.

NOTE: It is assumed parameters.yml is configured with mysql details and specified database in details is created already.

It is important to run below command to populate data in database before proceeding further

$ bin/console  doctrine:schema:create
$ php bin/console neo:feed API-KEY

The command is implemented inside AppBundle\Command\NeoFeedCommand

Default Controller

AppBundle\Controller\DefaultController - the index method returns {"hello":"world!"}

REST Services

Neo SDK - Inside src\Neo basic rest client implementation to access nasa api

/api/doc - is the route to access API documentation

/neo/hazardous - implemented into hazardousAction method of ApiBundle\Controller\AsteroidController

/neo/fastest?hazardous=(true|false) - implemented into fastestAction method of ApiBundle\Controller\AsteroidController

/neo/best-year?hazardous=(true|false) - implemented into bestYearAction method of ApiBundle\Controller\AsteroidController

/neo/best-month?hazardous=(true|false) - implemented into bestMonthAction method of ApiBundle\Controller\AsteroidController

Tests

To run all tests

$ phpunit

To run home page test

$ phpunit tests/AppBundle/Controller/DefaultControllerTest.php

To run Webservices tests

$ phpunit tests/ApiBundle/Controller/AsteroidControllerTest.php

TODO

  • Exception handling
  • Returning proper error responses
  • /neo/hazardous API - using pagination
  • More generic feed command which can be used to fetch feed by specifying date range.
  • A command to retrive / fetch more historic data from nasa api, to make analysis on local data real and accurate
  • Unit testing for Neo SDK

What's inside?

The assignment is configured with the following Symfony bundles and third party PHP libs apart from Symfony's default distribution:

About

Repository for Programming Assignment for Backend Developer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published