Download the free facebook JSP project with source code. The project is available in JSP, Java and MySQL for students. The Student can modify the project with their own ideas to meet their requirements.
Download the JSP project of FACEBOOK using the back-end Tomcat Server, MySQL as database and front-end as JSP, Java and Bootstrap.

We have created this in Advance Java training of Zensar ESD project. This project is fully open source where you can modify and if you wish you can send me back with modification. 

I'm thankful to my friends Shabbir Ahmed Patel, Darshan Sudhir Bhavsar and my instructor Swapnil Deshpande.

Project working : The  project is based on Social media like facebook, twitter, orkut, reddit etc. where we can send Post, Comment on Post, Send Friend request, Delete user where it has the ability to automatically delete all the posts, comments, friend requests of the delete user.


The project is made using Eclipse IDE and MySQL Server. Following are the requirements.
  1. Eclipse JAVA IDE 
  3. JDBC Connector for database
  4. TomCat Server

MySQL Statements which we have used for creating Database:

In our project the database have the name : CipherBooK

Following are the Tables:
  • users (uid, uname, uemail, upass, udob, ugender, uloc, uimage);
create table users(
uid int unsigned not null primary key auto_increment,
uname varchar(30) not null,
uemail varchar(60) not null,
upass varchar(30) not null,
udob date null,
ugender enum('Male','Female') not null,
uloc varchar(30) not null,
uimage blob 
  • posts (pid, uid, ptitle, pbody, pdate);
create table posts(
pid int unsigned not null primary key auto_increment,
uid int unsigned not null,
ptitle varchar(30) not null,
pbody text not null,
pdate date not null,
constraint fk_user foreign key(uid) references users(uid) 
on delete cascade 
on update cascade

  • relationship (user_one_id, user_two_id, status, action_user_id);
CREATE TABLE relationship(
user_one_id INT NOT NULL REFERENCES Users(uid) on delete cascade on update cascade,
user_two_id INT NOT NULL REFERENCES Users(uid) on delete cascade on update cascade,
status INT NOT NULL default 0,
action_user_id INT NOT NULL,
CONSTRAINT CheckOneWay CHECK (user_one_id < user_two_id),
CONSTRAINT UQ_Friends_Pairs UNIQUE (user_two_id, user_one_id),
CONSTRAINT PK_Friends_Pairs PRIMARY KEY (user_one_id, user_two_id)
  • comments( cid, uid, pid, cbody, cdate)
create table comments(
cid int unsigned not null primary key auto_increment,
pid int unsigned not null,
uid int unsigned not null,
cbody text not null,
cdate date not null,
constraint fk_post foreign key(pid) references posts(pid) 
on delete cascade on update cascade


  1. Download the Project and extract it.
  2. The in Eclipse File-> New -> Dynamic Web Project.
  3. Select the target runt me as Tomcat Folder and keep the Dynamic web module version as 3.0
  4. Copy the files as per Folders given in project.
  5. Download and Copy the JAR file in WEB-INF -> lib folder.
Tips for errors:
  1. Make sure that Apache Tomcat server in check in eclipse Properties -> Targeted Runtime
  2. Change Build Path JRE System Library in Properties -> Java Build Path
  3. Import the packages
This Image will help you to organize the files and packages(Folders).

After Reading the whole boring stuff here is the download(Make sure you read it, Its Important):