Tag Archives: Nutritionix API

Build and deploy a mobile-friendly calorie counter on IBM Bluemix with PHP, MySQL, AngularJS, and the Nutritionix API


via Build and deploy a mobile-friendly calorie counter on IBM Bluemix with PHP, MySQL, AngularJS, and the Nutritionix API.

In this article, I show you how to create an online calorie counter that enables users to:

  • Search for food items by name, with results retrieved through an API to the online nutrition database Nutritionix.
  • Group selected food items together to create meal records, and save these records to a MySQL database, together with their calorie counts, by using a PHP/AngularJS application.
  • Retrieve reports of their total calories that are consumed for the current day, the last seven days, and the last 30 days.
  • Access the app from mobile devices such as tablets and smartphones.

On the client side of things, I use jQuery Mobile to create a mobile-friendly user interface for the application and AngularJS to enable some of the application’s interactive features. On the server, I use Slim, a PHP micro-framework, to control interaction with the Nutritionix API and to save and retrieve data from the MySQL server.

In the final part of this article, I show you how to deploy the application to the Bluemix cloud, which provides a scalable and robust infrastructure for application deployment to ensure that users have around-the-clock access.

Sound interesting? Come on in, and let’s get started!