Google App Engine and My Mission

June 19th, 2009 - Programming

Hi. The blog you're reading, and all of its user and content-creation functionality, is entirely written using Google App Engine (Python), with Django. In this post I write about why I decided to write my own web applications to replace every web service I use, and why I decided to do this using Google App Engine.

When I heard that Google had released a service designed for developers to create neat Python and Java-based applications for web, hosted on Google's servers, I was quite excited to see what I could build with it. It's no secret that I Google products - I'm an avid user of almost all they have come out with, including the Google Web Toolkit (GWT), designed for translating Java programs into Javascript applications for the web (by the way, this product is fantastic, and I recommend it to any web programmers comfortable with Java).

To start myself off and to learn the technology, I decided, quite ambitiously, to make an "online community for book-nerds" , where users could search for books, and then rate, favorite, and discuss any of a huge selection of books. This would create a database full of useful information which I could use to rank books, in a way similar to the top 250 films on IMDB (something I've always wanted available for books). The application linked to Amazon.com's catalogue list to provide a store full of titles, and had unique profiles for each user, including profile photos, and personal information. The idea was that of a typical online social application, based on the premise that people often struggle to find out what to read next (reading is a large investment of time), and it's difficult to find a simple website that helps with that (despite the success of imdb.com for films). Eventually, once I had already written the majority of the base code for my app, I actually found a website that deals with this, though not as effectively as I would like, but that is certainly useful, and is equipped with a vast array of interesting (though sometimes extraneous) functions - Library Thing.

As I built my application, I grew more familiar with the Google App Engine technology (after a short but steep learning curve, it gets fairly easy to include almost any popular function currently on the web - even if it's method sometimes includes a workaround Google's somewhat testy constraints). When I was finished creating some very decent functionality for my book-community idea, I decided that for any online web application that I use, I'm going design for myself a replacement on Google App Engine. For an almost obsessive internet-user like myself, with much of my computing done in the cloud, it sounded like a very daunting task. A list of the web applications I currently use include (but are not limited to), 'GMail','Facebook', 'Google Chat', 'Wordpress', and 'Google Docs'. That's quite an intimidating list, but I figured GMail and Google Chat may be quite simple to do at least . That night I fell asleep with my notebook on my bed, as usual, except that I had unknowingly of course, forgotten to put the lid back on my pen. When I woke up with blue ink-marks all over my duvet, I knew it was time to move my obsessive note-making onto the web. I searched around, but I couldn't find anything similar to Google Docs that was more tailored to taking quick notes. There was the discontinued Google Notebook that I used to use, but that didn't quite suffice either. There were many to-do-list applications, but very few that were capable of storing notes in an easy and accessible way. I knew what I had to do. Thus, PyThoughts was born.

For PyThoughts, I figure the thing I've worked hardest on so far has been making the information very accessible, meaning that I can log on and very quickly retrieve the data I'm looking for. That requires folders, with fast-loading content, and AJAXian functions to add, edit, delete, or move information. I plan to use this blog to make available some of the methods I used to include this functionality, so that those who are starting to write their own apps on GAE can bypass some of the learning curve. For example, in a future post I will provide an easy walk-through for any one wanting to include AJAX functions using Google App Engine.

Live long and prosper.

PyThoughts


16 Comments

Comment by Chris

very very cool 

Comment by graeme@pythoughts

Thanks Chris! 

Comment by Richard

suggestions: no folders. instead have tags or labels. in this way, one thought can have multiple tags. also the homepage thought field has prewritten text which I need to backspace each time.

Comment by graeme@pythoughts

Thanks Richard; that's a great idea so I went ahead and implemented it right away. I hope that's better.

Comment by Richard

Home Page still has the prewritten text - annoying.  Also the tips drag on you should just show on of those tips randomly each time.

Comment by graeme@pythoughts

thanks richard, but the prewritten text should disappear as soon as you've logged in. I just keen the prewritten text there to show new users how to use the site, and give them an example to use for their first time.

Comment by graeme@pythoughts

I just changed Pythoughts to show one randomly generated tip each time the page loads. Check it out, and thanks for suggestions!

Comment by Prakash Sankar

We need a simple helpdesk app based on Google app engine
(similar to mojo helpdesk)

Most small business need a helpdesk app, a simple robust helpdesk app on google app engine will be great.

Thanks!

Comment by Manners

I think this application and your mission is awesome. I would like to be able to challenge myself like that someday. 
I've only started using appengine with java and have just one application up on the cloud, check it out on http://www.gotomanners.com (I appreciate feedback :D)

One suggestion for this app would be to add date stamps for comment posts, it would give new users a sense of the "freshness" of the topics and issues expressed in the posts above.

Comment by graeme@pythoughts

@Manners: Hey!

I think your app is pretty cool. Like guestbook 2.0. Just the thing is, I didn't really know what it was when I first went there (which is a problem for a lot of new applications mine especially  ). It looks pretty well designed.

Add it to the app engine directory (http://blog.pythoughts.com/app). I'd like to know how you found app engine with Java, and that's a better place to talk about it.

By the way, is it "goto manners", or "got zero manners"?

Graeme

Comment by Manners

Thanks Graeme!

I'm still working on the content of the introduction page and I'm not quite there yet, so for now I'm just hoping users would follow their curiosity and "Identify themselves" lol.

The app is now listed in the directory, and its "Gotomanners" :D (don't ask how I came up with that).

Comment by graeme@pythoughts

@Manners: Yeah that is quite risky to think people will just sign in without knowing what it is. You're going to have a high bounce rate. Twitter does quite well with that I reckon.

Nice, I wrote a little review of the app in the directory. 

Comment by Person

I have just started using python... I see that python has the ability to actually create games, etc... With goole apps and python together would it be possible to create a game over the web? Also, in terms of extending python so that you can run it via the web do you just extend that main.py file and add whatever code from a python perspective that you would like?

Comment by graeme@pythoughts

@Person : Hi there,

I do think that it's possible to make fully graphical python games on the web, though, to be honest, I don't have any experience in that. I think it would be interesting to give it a try. You can definitely make the game as a Java applet or in Flash and just embed it in the html though. There are a few 'text-based' games already (there's one in the app directory here).

If you mean extending python to include C  , you can't do that with app engine. Everything has to be pure python (which I was thinking might be a problem for graphics). To  run it on the web, just import webapp from google, like this:

from google.appengine.ext import webapp

application = webapp.WSGIApplication([('/', Index)])

Then whenever someone goes to "yoursite.com/", python will look for your 'Index' class to see what you've put there. Let me know if you want me to clarify anything here, and good luck with App Engine!

Comment by Danny Tuppeny

Interesting post. I too recently wrote my blog in Google App Engine. But unlike you, I'm a .NET developer and I've always been a huge fan of Microsoft's products.

I wrote my blog in ASP.NET MVC a while ago, but then never put it live because Windows hosting sucks. Azure looked to be the solution, but the pricing is way too much. As well as not having a free quota, you pay per hour your site is living, and not per CPU hour, which works out incredibly expensive for a low(/no) traffic site.

Here's a post about moving to App Engine on my blog. The whole blog is now App Engine, and I must say it's waaaaay faster than Blogger that I was using until now (ironic, eh?):

http://blog.dantup.me.uk/2009/12/from-net-to-python-on-app-engine.html

You need to optimize your site for keyword phrases you would like your site to come up for. 

Name: (required)


Email: (required, uses gravatar)


Website (follow-friendly)


Comment: (required, obviously)