hassanjamal / modus-nhtsa-api

Backend API to get information about crash test ratings for vehicles.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

modus-nhtsa-api

Modus PHP Backend API using Laravel

This is a short coding assignment, which implement an API in PHP Laravel that calls a "backend API" to get information about crash test ratings for vehicles.

The underlying API that is to be used here is the NHTSA NCAP 5 Star Safety Ratings API

Requirements

  • PHP : 7.2.15
  • Laravel : 5.8.*
  • Composer

Installation

# Clone git repository
$ git clone git@github.com:hassanjamal/modus-nhtsa-api.git

# Change working directory
$ cd modus-nhtsa-api

# Create ENV file and generate key
$ cp .env.example .env && php artisan key:generate

# Install Composer dependencies
$ composer install

Run development server

$ php artisan serve --port=8080

Run tests

$ ./vendor/bin/phpunit

Assignment Details

GET http://localhost:8080/vehicles/<MODEL YEAR>/<MANUFACTURER>/<MODEL>
POST http://localhost:8080/vehicles
GET http://localhost:8080/vehicles/<MODEL>/<YEAR>/<MANUFACTURER>/<MODEL>?withRating=true

TroubleShoot

$ php artisan config:clear && php artisan clear-compiled && php artisan cache:clear

About

Backend API to get information about crash test ratings for vehicles.


Languages

Language:PHP 96.3%Language:HTML 3.1%Language:Vue 0.6%