Giter Site home page Giter Site logo

weddingjuma / vehicle-system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lotrietb/vehicle-system

0.0 2.0 0.0 193 KB

A Laravel application that allows you to manage vehicles and exposes RESTful endpoints to third party applications, built using Laravel 5.3.

PHP 64.61% JavaScript 0.87% Vue 0.43% HTML 34.09%

vehicle-system's Introduction

Vehicle System

This guide provides the setup instructions to get the system up and running, and also information on how to interface with the API.

Setup

  • Clone the repo.
  • CD into the application directory.
  • Copy the .env.example file to .env, then update the database information to point to your mysql database.
  • Migrate the database using the php artisan migrate command.
  • Next, seed the database using the php artisan db:seed command.
  • Lastly, generate an application key using the php artisan key:generate command.

Now, using php artisan serve you should be all set to run the application.

The login credentials are: username: [email protected] password: admin

The API

The API exposes 5 endpoints;

  • GET -/api/vehicles -> Gets all the vehicles in the system.
  • GET -/api/vehicles/{id} -> Get a specific vehicle by passing in the ID.
  • POST -/api/addvehicle -> Add a new vehicle
  • POST -/api/updatevehicle/{id} -> Update a vehicle, passing in the vehicle ID.
  • GET -/api/removevehicle/{id} -> Soft delete a vehicle from the system.

All vehicle related parameters are passed as POST fields in the request. When the login user is seeded, an api token is created in the users table. This must be used when making requests. Pass the api token as a GET parameter in the URL, eg. /api/vehicles?api_token=YOUR_TOKEN_HERE

Additionally, the api response format can be changed by passing the format GET parameter. Available formats are xml and json. The system defaults to json. eg. /api/vehicles?api_token=YOUR_TOKEN_HERE&format=FORMAT

vehicle-system's People

Contributors

lotrietb avatar

Watchers

James Cloos avatar WwddingJuma 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.