In this video:
- Erin McKean, LoopBack Developer Advocate, IBM
Erin McKean’s goal was to get on the game show Jeopardy!, so she was determined to prototype an app that would help her learn how to answer the types of questions the producers ask. She wanted to win big bucks AND also beat IBM Watson’s score on the program (as Erin would say, she likes to aim high), but she needed two things – an API and data.
The way it works: Erin intended to prototype an API against a dataset. She chose LoopBack, the Node framework for creating APIs and connecting them with backend data sources, MongoDB, the open-source cross-platform document-oriented database, and IBM Bluemix as the platform.
“I like to think of the framework as cake mix for APIs … you open it, add your data, stir, and you’ve got APIs.”
Erin points out that just like box cake mixes, you can make the standard cake with the basic LoopBack program or you can make the cake of your dreams with a little customization.
LoopBack is a tool for quickly generating Node.js REST APIs. Based on Express.js, it is open source, free to use, and you can deploy it anywhere you can deploy a Node app. It consists of a library of Node.js modules; client SDKs for iOS, Android, and web clients; a command-line tool,
loopback-cli, to create applications, models, data sources, etc.; and Yeoman generators for scaffolding applications. (Scaffolding is a specification-oriented technique that allows the programmer to specify how the application database may be used in order to generate the final code that the application can use to create, read, update, and delete database entries. Yeoman provides a generator ecosystem of plugins that can be run with a single command to scaffold complete projects or useful parts.)
These are the capabilities that make LoopBack perfect for rapid app development:
- It requires little to no coding to create dynamic end-to-end REST APIs
- It gives you access to data from Oracle, MySQL, PostgreSQL, MS SQL Server, MongoDB, SOAP, and other REST APIs
- It lets you incorporate model relationships and access controls for complex APIs
- You can use built-in push, geolocation, and file services for mobile apps
- It allows you to run your application on-premises or in the cloud (deploy wherever Node can)
Erin talks at length about the process, describing her dataset (200,000-plus questions from the show, converted into a nice simple JSON format), outlines the setup for the prototyping, then takes you through the tweaking and execution of the program to end with a nice, easy-to-use demo that generated random questions that are likely to be asked on the show.
Thanks to Cloud Foundry Summit 2017 for promoting such a great resource.
Resources for you
- Run LoopBack apps on Bluemix
- Examine a LoopBack example for Bluemix
- Tasty LoopBack Bluemix recipes
- Create and expose APIs for enterprise data using LoopBack
- Check out some LoopBack modules here
- Explore utilities for generating Bluemix LoopBack artifacts
- Try a sample StrongLoop LoopBack Node.js application on Bluemix
- Try Bluemix free