Soft, but What Word Count?

Exploration of Google BigQuery

Updated:

  • JavaScript
  • Node
  • Express
  • Google App Engine
  • Google BigQuery
  • HTML
  • CSS

"Soft, but What Word Count?" was created to give me the opportunity to experiment with a start to finish Google BigQuery deployment on Google App Engine. The HTML and JavaScript is relatively simple, as is the actual query itself, however it gave me a great perspective into all the considerations I will need to make in the future on any AppEngine or BigQuery Apps.

The application consists of a vanilla JavaScript, HTML, and CSS frontend that displays an input box for a user to enter a word for which they would like to search across all of Shakespeare's known works. If the word is found, a table below the input is populated with the word, the number of times that word appears across all Shakespeare works, and in which of Shakespeare's works that word appears. If the word is not found, an error displays above the table indicated that the given word was not found.

The backend API is a simple Node server using Express. It serves the static files as well as hosts a single endpoint that takes a query parameter to send on to a custom BigQuery SQL query. That query checks the "bigquery-public-data.samples.shakespeare" public BigQuery database for a given word. Then, it returns the results of the query to the user, or an error.

One thing that cropped up almost immediately was the fact that I'd need to beware of SQL Injection. Luckily, BigQuery recently allowed for paramaterized queries, which is one of the OWASP recommended methods for mitigating SQL Injection risk.

Future work on the app: