RESTful services with jQuery, PHP and the Slim Framework

NOTE: This is the PHP version of this article and its companion app. A Java version is available here.

I have been looking for a lightweight framework to build a RESTful API in PHP. There are a number of good options out there: Slim, Epiphany, Tonic, Recess, and Frapi to name a few. They all seem like good frameworks. In the end, I chose Slim for this project for two main reasons:

  1. It’s very lightweight and focused on REST and nothing else.
  2. It supports all the HTTP methods (GET, POST, PUT, DELETE), which was a key requirement for my application.

This article (and its companion app) provides an example of building a complete RESTful API using the different HTTP methods:

  • GET to retrieve and search data
  • POST to add data
  • PUT to update data
  • DELETE to delete data

The application used as an example for this article is a Wine Cellar app. You can search for wines, add a wine to your cellar, update and delete wines.


You can run the application here. The create/update/delete features are disabled in this online version. Use the link at the bottom of this post to download a fully enabled version.
[Read more...]

RESTful services with jQuery and Java using JAX-RS and Jersey

NOTE: This is the Java version of this article and its companion app. A PHP version is available here.

This is a more in depth version of my previous post on the same topic. The previous article only covered the HTTP GET method for building RESTful services. This article (and its new companion app) provides an example of building a complete RESTful API using the different HTTP methods:

  • GET to retrieve and search data
  • POST to add data
  • PUT to update data
  • DELETE to delete data

The application used as an example for this article is a Wine Cellar app. You can search for wines, add a wine to your cellar, update and delete wines.


You can run the application here. The create/update/delete features are disabled in this online version. Use the link at the bottom of this post to download a fully enabled version.
[Read more...]

Set Up an Amazon EC2 Instance with Tomcat and MySQL – 5 Minute Tutorial

Create an AWS Account

First things first: you need to create your AWS account. You can sign up here. You’ll have to provide a credit card and a phone number where you will be called as part of the online registration process for verification purposes. Amazon offers a Free Usage Tier, which is great to explore the services and even host real apps without being charged. Check the details here.

Create an Instance

Now that you have an AWS account, access the AWS Management Console and click the EC2 tab to create a new instance:

  • Choose an AMI in the classic instance wizard: I chose the Basic 64-bit Amazon Linux AMI.
  • Instance details: keep the default settings.
  • Create a new key pair. Enter a name for your key pair (i.e. christophe) and download your key pair (i.e. christophe.pem).
  • Select the quick start security group.
  • Launch your instance.

[Read more...]

Building Apps with jQuery and JAX-RS – Sample App

In my previous post, I discussed the process of building RESTful services in Java using JAX-RS and Jersey. As an example, I shared a web application that provides a simple RESTful API for an Employee directory application:

In this post, I share a simple client application that uses these services to provide a basic User Interface for the application. The client is built with jQuery and uses JSON as the data exchange format.
[Read more...]

Building RESTful Services with Java Using JAX-RS and Jersey — Sample Application

I’m working on a project that required a RESTful API implemented in Java. Jersey, the reference implementation for JAX-RS, made it easy to implement and deploy these services. I figured I’d share my sample application here.
[Read more...]

jQuery Mobile "Getting Started" Application

A couple of weeks ago, I shared an Employee Directory sample application built with jQuery Mobile and PhoneGap. That application was implemented “Ajax-style”, keeping the UI and the data access code cleanly separated. In other words: no server code intermingled in the HTML markup.

A number of people have asked for a similar example using a “classic” (non-Ajax) implementation where pages (markup + data) are entirely built at the server-side before being delivered to the client.

So, here is simpler version of the same application built “sans Ajax”. I used PHP in this version, but you can of course use your favorite server-side technology (Java, .NET, CF, RoR, etc).

[Read more...]

Sample App using the PhoneGap Database API

This is the third version of my Employee Directory application. The jQuery Mobile and the Mobile jQuery without jQuery Mobile versions both used JSON services to get data from a remote server. In this version, the application gets data from a local database using the PhoneGap database API. As a result, this version can work offline which is probably what you would expect for this type of application.

[Read more...]

Video: New Components in Flex 4.6

Holly and I have been working on an Expense Report application for tablets. We used a Flex 4.5 version in our session at MAX this year, but we have also been working on a 4.6 version in parallel. The new components in Flex 4.6 are really helping delivering a great experience on tablets. You can read more about Flex 4.6 here. Thanks to ESRI and Mansour for the great maps.

[Read more...]

Sample App: Mobile jQuery without jQuery Mobile

Let me preface this post by saying that I’m not advocating this approach versus the other. These are just experiments.

[Read more...]

MAX Session Video: How to Develop Amazing Mobile Enterprise Apps with Flex

It was great to see a lot of you at MAX this year. If you you didn’t attend MAX or my session, the video is now available. You can watch it here:
[Read more...]