MicroBlog

This web application allows users to post micros (small messages like tweets). It is a mimic of Twitter.com.

It allows user to do the following:

Here is the snapshot of this web application.

Architecture Of the Project

This project uses JSF to build the interface. Managed Beans talk to DAO (Data Access Objects), which talk to database using JDBC.

So overall architecture is - JSF Components -> Managed Beans -> DAO -> JDBC -> Oracle Database.

It also uses a filter (Intercepting Filter design pattern) to ensure only authenticated users access secured pages.

It uses AJAX with JQuery to validate username as user registers.

It uses JavaMail to send mail to user with password in forgot password page.

It uses Apache Commons-FileUpload and Commons-IO libraries to upload photo of the user.

Products used in this project

Steps to download and deploy this project

  1. Download microblog.rar. The .rar file contains the entire source code for the project. Unzip the file into c:\ so that c:\microblog folder is created with all the components of the project.
  2. However, in order to keep the download small, the project does not contain .jar files related to JSF, Oracle and  Java Mail and apache commons-fileupload and commons-io. So you need to add them by taking the following steps.
  3. Open the project in NetBeans 7.0
  4. Go to properties of the project using popup menu. Select libraries node and delete existing libraries using  Remove button. Then add - Oracle - ojdbc14.jar and mail.jar (assuming you have downloaded JavaMail API) for Java Mail. You have to add these .jar files to the project using Add Jar/Folder button.
  5. Download Apache Commons-FileUpload and Commons-IO libraries and add .jar files to project using Add Jar/Folder options
  6. Add JSF 1.2 libraries using Add Library button
  7. Create microblog account with password microblog in Oracle10g Express Edition. This must be done after you log in as SYSTEM user. Then create tables listed below after connecting to Oracle as microblog
    
    create table users 
    ( userid number(5) primary key,
      username varchar(10) unique,
      password varchar(10),
      email    varchar(50) unique,
      onlinebio varchar(500),
      photoid   number(5) default 0,
      followingcount number(5) default 0,
      followerscount number(5) default 0,
      microscount   number(5) default 0
    );
    
    create sequence  userid  nocache;
    
    insert into users values( userid.nextval, 'srikanth','s','srikanth@gmail.com','Software Trainer',0,0,0,0);
    insert into users values( userid.nextval, 'robin','r,'robin@st.com','Musician',0,0,0,0);
    
    create sequence microid nocache;
    
    create table micros
    ( microid number(5) primary key,
      micro   varchar(150) not null,
      postedon date,
      userid  number(5) references users(userid)
    );
    
    create table followers
    (  userid  number(5) references users(userid),
       followerid number(5) references users(userid),
       primary key (userid,followerid)
    )
    
    
  8. Run login.jsp, login and try the remaining pages.