Skip to content

Spring boot application to search businesses using Yelp

Notifications You must be signed in to change notification settings

MontealegreLuis/yelp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published