Skip to content

Posts tagged ‘postgresql’

13
Dec

New Project Launched: Spectacular.Gift

It began like this: Amazon.com’s vast product catalog contains many clever and unique items, the sort that you may not know you wanted until you’ve heard of it. Alternately, these items might make an ideal gift when shopping for the person “who already has everything”. So I figured it would be a neat idea to curate a collection of these items and build a gift recommendation site around them. Doing so would allow me to explore some new server-side technologies and help keep my skills fresh.

Technologies used:

  • Ubuntu VPS from Linode
  • Apache2 HTTP server
  • Apache Tomcat 7
  • Apache ActiveMQ
  • Spring 3.1 with Spring MVC
  • PostgreSQL 9.3
  • HTML5 + CSS3
  • jQuery, flot, TinyMCE
  • Java libraries such as Joda Time, Jsoup, Jackson, Logback, and Commons DBCP
  • Amazon Product Advertising API
  • Reddit REST API

To get some data populated in the database as a starting point, I set up a scheduled task to pull data from several Reddit forums where Amazon links are shared.  Reddit conveniently makes this data available via their REST API.  All products discovered in this way are set to unapproved status pending manual review.

Next, I set up another scheduled task to populate and refresh metadata about the products via Amazon’s Product Advertising API.  Per Amazon’s terms in order to display price information, this data has to be refreshed hourly.  For efficiency I request data on batches of ten products at a time, which is the maximum limit.

I created a manual process for reviewing and approving products to be shown.  This process includes writing a custom description, adding relevant tags (e.g. “For Kids” or “Gadget Lovers”), and setting an age range and gender specificity (if applicable).

The UI is written in JSP and outputs HTML5.  Some features are powered by javascript, such as the price history button which uses flot to render the graph of historical price data.

Spring 3.1 ties it all together.  Spring MVC handles the front-end.  Spring JDBC is used for interacting with PostgreSQL.  I could have used Spring’s event system, but I wanted to get some experience with ActiveMQ.  There are a number of message senders and listeners set up for events such as “price changed”  or “product suggested”.

I’ll probably think of a snappier name eventually, but for now I registered http://spectacular.gift (new “.gift” TLD).  Have a look if you like!  It’s basically in beta, and I’m still adding new products and tags.