bbokorney / hold-my-beer

A sample application for AWS CloudSearch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hold My Beer

Hold My Beer is a sample application for AWS CloudSearch. It's a static web app for querying a dataset of beers.

AWS Setup

CloudSearch

  1. Go to the CloudSearch Dashboard.
  2. Click Create a Domain.
  3. Give it a name (e.g. hold-my-beer).
  4. In the Access Policies, set policy to "Search and Suggester service: Allow all. Document Service: Account owner only."
  5. Wait until access policies are done processing.

Suggester

  1. Suggesters > Add Suggester
  2. Give it a name. Set "Source Field" to "name", and "Fuzzy Matching" to "high".
  3. Re-index your domain. This can take a while.

API Gateway

  1. Create a resource for /search.
  2. Create a GET for /search.
  3. Select the integration type HTTP.
  4. Specify the Endpoint URL as https://.us-east-1.cloudsearch.amazonaws.com/2013-01-01/search
  5. Method Request > URL Query String Parameters add q, q.parser, q.options.
  6. Actions > Deploy API
  7. Create new stage, give it a name.
  8. Click Deploy

Running the app

Export the url of your API gateway domain.

export REACT_APP_SEARCH_URL='https://abc123defg.execute-api.us-east-1.amazonaws.com/stage-name'

Install dependencies and start the project.

npm install
npm start

Credits

Beer stein favicon from freefavicon.com.

About

A sample application for AWS CloudSearch.

License:MIT License


Languages

Language:JavaScript 77.3%Language:CSS 19.5%Language:HTML 3.2%