cloudcats

CloudCats is an example of using node.js and various Google Cloud APIs and services to solve the greatest question of our time: do developers prefer dogs or cats.

MIT License

Stars
34

CLOUD CATS

CloudCats is an example of using node.js and various Google Cloud APIs and services to solve the greatest question of our time: do developers prefer dogs or cats.

This is an adaptation of the awwvision, which uses Kubernetes to do something similar. Credit to Thea Flowers for the idea.

How it works

Cloud Cats queries for a list of images from the front page of r/aww. Each of those images is saved into Google Cloud Storage, and then analyzed using the Google Cloud Vision API.

Cloud Cats uses a few Google Cloud APIs and Services.

  • Users visit the front application, which is running in an App Engine module.
  • When you're ready to do a run, the {+} will call an endpoint on the [worker][/worker] module.
  • The worker will invoke the Reddit JSON API to get a list of images from r/aww.
  • Images are saved to Google Cloud Storage.
  • The Cloud Vision API analyzes the image, and tags it as dog or cat or other.
  • The result is placed in a Google Cloud Pub/Sub topic.
  • The front end App Engine Module subscribes to results from the topic.
  • Results are streamed to the user using PubNub.

Deployment

This code is built as a demo for running Node.js on Google Cloud, but you can run it anywhere that node.js works.

  1. Create a project in the Google Cloud Platform Console.
  2. Enable billing for your project.
  3. Enable Storage, PubSub, and Cloud Vision APIs in the API Manager.
  4. Install the Google Cloud SDK.
  5. Deploy with gcloud preview app deploy web/app.yaml worker/app.yaml --project <YOUR PROJECT>

License

MIT License

Questions?

Feel free to submit an issue on the repository, or find me at @JustinBeckwith