Building the simplest online feed reader (using ExtJS, ASP.NET MVC and MongoDB)

by 27. December 2009 00:30

Try it now! – Note: it’s still buggy.

I’ll write about changes in original ExtJS FeedReader as soon as I can. Stay tuned! However you can still grub plain (not minified) Js from server but note this is pre-alpha quality code. ALSO: this installation uses my home PC as mongodb host.

 

What an online feed reader is? Definitely it’s a web application. The application that has at least two components. The components are listed here:

  • User interface (executed in browser, ExtJS)
  • Controller (executed on server, ASP.NET MVC)
  • Data store (located somewhere, MongoDB)
  • Feeds downloader (of course we can update our feed only when browser request occurs, but we can lose some entries for example in case of a long pause in usage of the reader)
  • And last but not least is a syndication library (Argotic framework)

Our feedreader will have the following features:

  • Feed list (adding, deleting, feeds)
  • Feed items viewer
  • Standalone feeds downloader

INTRODUCTION

Here i just talk general things.

1. Feeds and MongoDB

(using ExtJS, ASP.NET MVC and MongoDB)

Well, in spite of the fact that MongoDB is “schema free, document oriented database engine”, we still need to develop at least document’s structure that reflects our domain. What do we have? Feeds and feed items and, since we build the simplest feed reader we will not bother ourselves with such things like users and categories.

Document Feed may contain the following fields:

  1. _id (which is built-in and will be used as unique id (see one of my previous posts)
  2. url
  3. title
  4. description
  5. author

Values for fields 2-5 will be given to us by Argotic.

Document Post may contain the following fields:

  1. _id
  2. feed_id
  3. title
  4. author
  5. content (this field will be discussed separately)
  6. comment
  7. pubDate
  8. item_id
Post content discussion

What data structure is used by Mongo to store our data? BSON… And from our point of view it’s just like json which means that we can develop very interesting things. The first problem we address to this JSON structure is really marvelous variety of RSS/ATOM extensions. And this variety brings us to two issues:

  1. How to properly display these feeds
  2. How to properly extract information such as text from these feeds

At this point I should remind you that Feed data is just a xml. So we can convert it to JSON with no pain (well, in most cases). We can strip all standard data like title, id and leave just that very mutative body then convert it to json and store in content field. Then we can send it to Javascript just like any JSON!

2. Feeds and Argotic Syndication Framework

Argotic Syndication Framework is a really excellent syndication library. It’s powerful, extensible, and flexible.
And I'm very proud to be the part of the team.

How Argotic can facilitate our job? To answer the question let list some common operations first

  • Load user entered address and determine the type of the content – OPML, ATOM, RSS.
  • Parse this content
  • If it is an OMPL load listed feeds and then again determine their type and parse
  • While parsing feed’s content appropriately handle format extensions

Firstly, Argotic offer powerful GenericSyndicationFeed class. With the class we can load an address without concerning about its type. We can load it from an URI, a stream, or a string. Secondly, Argotic supports OPML. And finally it has an extensible extension support.

3. Feeds downloader

Feeds downloader is a standalone application responsible for schedule updates and update feeds. The problem comes form the fact that one feed updates each hour but another one  just once a day. In this simple version we will ignore this fact and will update feeds every hour.

4. User interface

You will see it constantly and we should do it at least usable :-). Well, for this project I will use client part from the ExtJS feed-reader sample.

5. Putting things together: ASP.NET MVC

Our server code will be very thin. So MVC is a good choice since we are going to write only controller.

6. Setting-up Mongodb

It’s pretty straightforward. Just download it, unpack wherever you want, and create data directory (in Windows case it will be c:\mongo\db). To get Mongo working you need to run mongod from the bin folder.

7. Setting-up Argotic Syndication Framework

Download it – note that it will probably be better to build library from the latest sources.

8. Setting-up ASP.NET MVC

Well, again just download it and install. If you are using Visual Studio 2010 skip this step.

9. Setting-up ExtJS

Download it and unpack. Later we will prepare feed-reader sample

And finally we will get something like this

Yes it looks totally like extjs sample but it has a lot of differences under hood.

feedreader

and slightly modified version (I’m working hardly on it now)

feedreader_content

Tags: , ,

My code

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name: Ilya Khaprov (rus Илья Хапров)

Age: 23

Sex: Male

I'm a postgraduate (an "aspirant" in Russian terminology see Wikipedia for details) at Bryansk State Technical University.

I'm working with .Net since 2004. Also i like lisp.

My research interests lie in the area of Intelligence. In particular i am studing personal information filters, ontology learning, and some other stuff.

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2009

Recent Visitors