The Discover tab within Beer Drinkin is probably the most important area of the app. This is where users can discover new beers and we make recommendations about beers that they may enjoy.

It uses a number of services to deliver a 5-star experience.

Search

The Search API is built on top of Azure Search, which itself is running atop of Elastic Search. The API for calling into the Search API is extremely simple with Beer Drinkin due to high level of abstraction.

//Create an instance of our Search view model
readonly SearchViewModel viewModel = new SearchViewModel();

//Searching will currently only return beers. This wont work offline.
var beers = await viewModel.Search(searchBar.Text);

Barcode Scanning

Barcode scanning uses RateBeers open endpoint to query their database as BreweryDB doesn't have enough data regarding barcodes to be considered useable.

I fully expect at some point in the future that they'll notice we're calling into their system and block us.

Every call we make store into our DB in order to link as many UPC with beers.

var beers = await viewModel.LookupBarcode(upc);

Trending Beers

🚧

User Location

You will require the users location to fetch beers for a local area.

Please use the GeoLocator plugin from Motz to fetch the users current position.

//Default (world-wide trending beerS)
var beers = await viewModel.TrendingBeers(10);

//Unique to the local area
var beers = await viewModel.TrendingBeers(10, 48.29767, 2.678604);