Coder Social home page Coder Social logo

foodtruckapi's Introduction

FoodTruckAPI

This project is a REST API that can perform various basic operations on the food truck data set. Upon creation it fetches all the data into a Hibernate data set (presently in-memory) and can perform some basic functions. The number of available endpoints is limited since there were no specifications regarding what kind of operations it needs to be optimized for, but it wouldn't be difficult to add features (e.g. an endpoint to return all trucks whose expiration date is less than a month away).

The data for each vehicle (be it a truck, push cart, or of unspecified type) are stored in the Truck class, which is equipped with standard getters and setters via Lombok, but has no methods at this time. Specific methods could be added if the specs required it. All the truck objects are stored in a JPA repository supported by the TruckRepository class.

Below is a summary of the endpoints:

api/details/{id} (GET)

Return a POJO object with the details about a vehicle with a given id (or a 404 status if it isn't found).

api/list/{vehicleType/{status} (GET)

Returns a JSON-based list of vehicles based on type and status. Both parameters are optional - omitting one or using the "all" flag will return all vehicles without regard to the parameter's value. For vehicleType one can use the flags "truck" and "cart", while for status there are "requested", "approved", and "expired."

api/list/{vehicleType/{status} (POST)

Absent a post body, this endpoint functions like its "GET" equivalent. However, one can post a JSON object with certain predefined flags to add more granularity to the results. All strings are case-insensitive

hasSchedule (boolean) - return one those that have a schedule link (default: false)
blocks (list of strings) - return only those on specified blocks
lots (list of strings) - return only those on specified lots
applicant (string) - query for applicant names
food (string) - query for food items
location (string) - query for address or location description fields

foodtruckapi's People

Contributors

kml404 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.