yarn install
yarn start
Browse to localhost:3000 and enjoy!
Brewery Life is an entirely static site hosted on S3. All of the information displayed is scraped at build time and embedded into the App using webpack.
We depend on the following APIs and expect corresponding API Keys in your environment variables.
YELP_CONSUMER_KEY
YELP_CONSUMER_SECRET
YELP_TOKEN
YELP_TOKEN_SECRET
GOOGLE_MAPS_API_KEY
UNTAPPD_CLIENT_ID
UNTAPPD_CLIENT_SECRET
FOURSQ_CLIENT_ID
FOURSQ_CLIENT_SECRET
Our brewery data is aggregated from a number of different sources. It utilizes the hand picked breweries in config.json
file to generate src/breweries.json
.
You'll need to add a new object to config.json
in the following format:
{
"BreweryName": {
"yelpBusinessId": "string",
"googlePlacesId": "string",
"untappdBreweryId": "string",
"foursquareVenueId": "string"
}
}
You can get those ids using our script:
node deploy/search-brewery.js "brewery name" "city"
Paste the JSON result into config.json
. If any of the results are null or don't make sense (sometimes the searches can be a bit wonky), try searching manually using the below techniques:
You can retrieve the yelpBusinessId
by searching Yelp for the brewery and extracting the part of the url after https://yelp.com/biz/
.
You can retrieve the googlePlacesId
here.
You can retrieve the untappdBreweryId
by inspecting the URL you are routed to when searching for the brewery on https://untappd.com.
You can retrieve the foursquareVenueId
by looking at meta tags on the brewery's foursquare page.
You may find some breweries do not have profiles on all of these sites. The only required ID is the untappdBreweryId
. If the place doesn't exist on Google Places, you'll have to hardcode the location object like this:
"location" {
"lat": 12.1244
"lng": 43.12313
}
You can include the "valid": false
key to prevent people from catching Ubers to places we aren't 100% sure exist at that location.
Travis CI is responsible for deploying our code on every merge to master. Essentially, it runs:
./deploy/deploy.sh
This script is responsible for creating a sitemap, generating static versions of each URL (for SEO purposes), scraping location information, and synchronizing the result to S3.
The content that is synchronized are the local build/
and ssr/
directories with the S3 folder in AWS. It also invalidates the CloudFront cache so that users get the updates more quickly.
Thanks to Greg at Untappd for giving us access to their API
This project was bootstrapped with Create React App. If you have questions about webpack configuration, babel, etc. you should start there.