MontealegreLuis / yelp-demo

Spring boot application to search businesses using Yelp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot + Yelp API V3 demo

codebeat badge

This is a Spring Boot application to demonstrate how to use this Java Client for the Yelp API v3.

The client can be used in the following ways:

  • As a proxy to the original API
  • To produce a custom JSON response
  • To produce a server side HTML response

It currently support the following end-points

Installation

Use maven as usual

mvn package
./mvnw spring-boot:run

Use

As a proxy to the original API

Visit the following URLs

  • /yelp/search/{location} to search a business by its location for instance San Antonio. Take a look at the method BusinessController#searchYelp for more details
  • /yelp/business/{yelpId} to search a business by its Yelp ID, for instance zócalo-mio-san-antonio-2. Take a look a the method BusinessController#yelpBusiness for more details

Custom JSON response

The client comes with a set of DTOs that an be used to generate a JSON response different from the one returned by Yelp

Visit the following URLs

  • /businesses/{location} to search a business by its location for instance San Antonio. Take a look at the method BusinessController#showBusinesses for more details
  • /business/{yelpId}.json to search a business by its Yelp ID, for instance zócalo-mio-san-antonio-2. Take a look a the method BusinessController#showBusiness for more details

Server-side HTML response

The third alternative is to pass the DTOs provided by the library to the view layer, in this case Thymeleaf to produces an HTML response.

Visit the following URLs

  • / use the form to search a business by category and location, for instance San Antonio. Take a look at the methods YelpController#showSearchForm and YelpController#showSearchResults for more details
  • /business/{businessId} to search a business by its Yelp ID, for instance zócalo-mio-san-antonio-2. Take a look a the method YelpController#viewBusiness for more details

About

Spring boot application to search businesses using Yelp


Languages

Language:HTML 51.9%Language:Java 24.9%Language:Shell 10.1%Language:Batchfile 7.8%Language:CSS 3.2%Language:JavaScript 2.1%