FINAL GROUP

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

DAYANANDA SAGAR UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE ENGINEERING


DAYANANDA SAGAR UNIVERSITY
KUDLU GATE
BANGALORE - 560068

MINOR PROJECT REPORT


ON

“GOT YOUR BACK”

BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING

Submitted by

ABHISHEK KUMAR - ENG19CS0012


ANJALI SHARMA - ENG19CS0035
HARSHA P- ENG19CS0362
SYED SHARIQUE HAIDER - ENG19CS0330
AYUSH KUMAR - ENG19CS0055

Under the Guidance of

Prof. Ranjini K
Assistant Professor
Dept. of CSE
Dayananda Sagar University

1
DAYANANDA SAGAR UNIVERSITY
School of Engineering, Kudlu Gate, Bangalore-560068

CERTIFICATE

This is to certify that Mr. Abhishek kumar bearing USN ENG19CS0012,Ms. Anjali
sharma bearing USN ENG19CS0035,Mr. Ayush kumar bearing USN ENG19CS0055,Mr.
Syed sharique haider bearing USN ENG19CS0330 and Mr. Harsha Pbearing USN
ENG19CS0362,has satisfactorily completed his Minor Project as prescribed by the
University for the 5th semester B.Tech. programme in Computer Science & Engineering
during the year 2021-22 at the School of Engineering, Dayananda Sagar University.,
Bangalore.

Date: ______________

Signature of the faculty in-charge

______________________
Signature of Chairman 2
Department of Computer Science & Engineering
DECLARATION

We hereby declare that the work presented in this mini project entitled – “Got Your Back”
has been carried out by us and it has not been submitted for the award of any degree, diploma
or the minor project of any other college or university.

ABHISHEK KUMAR - ENG19CS0012


ANJALI SHARMA - ENG19CS0035
HARSHA P- ENG19CS0362
SYED SHARIQUE HAIDER - ENG19CS0330
AYUSH KUMAR - ENG19CS0055

3
ACKNOWLEDGEMENT :-

The success and final outcome of this software requirement document required a lot of
guidance and assistance from many people and we are extremely privileged to have got
this all through the completion of the project. All that we have done is only due to such
supervision and assistance and we would not forget to thank them.

We respect and thank our mentor, Professors, and the Chairman for providing us an
opportunity to do the Software Requirement Document and giving us all support and
guidance which made me complete the project duly. We are extremely thankful to all for
providing such nice support and guidance

We are especially thankful to our Dean & Chairman, Dr. A Srinivas Department of
Computer Science & Engineering who continuously helped us throughout the project
and without his guidance, this project would have been an uphill task.

We are pleased to acknowledge Prof. Ranjini K Assistant Professor, Department of


Computer Science & Engineering for her invaluable guidance, support, motivation and
patience during the course of this mini-project work..

We are thankful for and fortunate enough to get constant encouragement, support and
guidance from all Teaching staff of the Computer Science Engineering department,
which helped us in completing our report. Also, we would like to extend our sincere
esteems to all staff in the laboratory for their timely support.

ABHISHEK KUMAR - ENG19CS0012


ANJALI SHARMA - ENG19CS0035
HARSHA P- ENG19CS0362
SYED SHARIQUE HAIDER - ENG19CS0330
AYUSH KUMAR - ENG19CS0055

4
ABSTRACT

As in the current scenario a lot of students are facing problem regarding the study materials
Which is in handwritten format. Ppt and pdf are easily available but handwritten notes
Are difficult to find so come up with a new idea that a single platform will be delivered
To the user which will be useful for the students as well as the teachers the whole learning
community will get benefited from our website.

5
TABLE OF CONTENTS

P
a
g
e
n
Chapter Title o
a. Declaration 6

b. Acknowledgment 7

c. Abstract 8

d. Table of contents 9

e. Table of figures 0

1. Introduction
1.1 Problem Statement
1.2 Uniqueness of the project

2
-

2. Literature Survey 3

3
-

3. Requirement Specification 4
3.1 Software Requirement
3.2 Hardware Requirement

4
-

4. System Design 5
4.1. Views Diagram

5. Project Breakdown 6

7
-
2
6. Implementation 6 2
2
7. Testing 3
2
4
-
2
8. Results/Output screenshots 7
2
9. Conclusion and Future scope 8
8.1 Conclusion
8.2 Future scope
2
10. References 9

a
TABLE OF FIGURES

Figure No Title Page no

4.1 Views diagram 12

5.1 Flowchart showing 14


implementation

8.1 Home page 20

8.2 Login page 20

8.3 21
Registration page

8.4 Upload Page 21

8.5 22
Subjects page

8.6 Download page 22

8.7 Mongodb 23

8.8 24
Console output

8
1. INTRODUCTION

As proper study material is needed for the better education so to deliver a quality study
materials to the whole community we had built this website any body can access our website
As it is user friendly too one person can upload the documents and other can download from
the website .

1.1. PROBLEM STATEMENT

Pr0viding study materials to all category of students -

• Providing the end user a quality of study material wether it will be in hand written
format or in typed form
• Renting and selling of the books

1.2. UNIQUENESS OF THE PROJECT

We are trying to establish the relationship between two type of users one who is need of good
study material as of his need and other who wants to get some benefit from his study
materials so we are providing the platform

9
2. LITERATURE SURVEY

Title /Year/journal Author Objectives Methodology

Journals and videos by Dr.Angela Yu Complete Mern Stack web Technologies to be used
The App Brewery , Development Framework to be used
London Designing The UI
Understanding the
workflow

10
REQUIREMENT ANALYSIS

3.1. SOFTWARE REQUIREMENTS

● Express js
● Node js
● Ejs
● Mongodb
● Ide (atom/vs code)
● Web browser

3.2. HARDWARE REQUIREMENTS

● 8GB ram or above

● 100 GB disk space


● Window 64 bit

11
4. DESIGN METHODS

We are using the technology embedded javascript for the front end ,Mogodb(mongoose )for
the database ,for backend we are using node js ,passport for the Api calling ,Oath for
The authentication purpose .

4.1:VIEWS DIAGRAM
Pdf view will be available on the website When the user will come to our website they can rate
the pdf and the book .client can log in to our website and use our service

12
5. PROJECT BREAKDOWN

● Client-side: For uploading the documents, Pdf, books soft copy.

● Admin side: To examine the documents

● Upload page

● Download page

● Registration page

● Login page

Website - communication

● The landing page gives an overview of the project at glance and explains the overview
of our project.
● As soon as the server is hosted on a local host, Home will show up. Home contains a
navbar, details about the page, few subject anchors etc.
● The User has to Login to view the uploaded pdfs.
● A User can also download PDFs from our website.
● If the user is not logged in to the website and tries to view their uploads, the website
will redirect the user to the login page.
● There are two ways to Login and Register to our website.
○ Google oAuth
○ Manual User Input.

13
14
Fig 5.1: flowchart showing implementation
6. IMPLEMENTATION
The project was split into four subdivisions,

.
1.Web development - Web development using HTML, CSS, and JavaScript

2.Database - Mongo db

3.Frontend(Ejs)

4.Backend (node js)

App.js

//jshint esversion:6
require('dotenv').config();
const express = require("express");
const bodyParser = require("body-parser");
const ejs = require("ejs");
const mongoose = require("mongoose");
const session = require('express-session');
const passport = require("passport");
const passportLocalMongoose = require("passport-local-mongoose");
const GoogleStrategy = require('passport-google-oauth20').Strategy;
const findOrCreate = require('mongoose-findorcreate');

const app = express();

app.use(express.static("public"));
app.set('view engine', 'ejs');
app.use(bodyParser.urlencoded({
extended: true
}));

app.use(session({
secret: "Our little secret.",
resave: false,
saveUninitialized: false
}));

app.use(passport.initialize());
app.use(passport.session());

mongoose.connect("mongodb://localhost:27017/gotYourBackDB", {useNewUrlParser:
true});
mongoose.set("useCreateIndex", true); 15
const userSchema = new mongoose.Schema ({
email: String,
password: String,
googleId: String,
secret: String
});

userSchema.plugin(passportLocalMongoose);
userSchema.plugin(findOrCreate);

const User = new mongoose.model("User", userSchema);

passport.use(User.createStrategy());

passport.serializeUser(function(user, done) {
done(null, user.id);
});

passport.deserializeUser(function(id, done) {
User.findById(id, function(err, user) {
done(err, user);
});
});

passport.use(new GoogleStrategy({
clientID: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
callbackURL: "http://localhost:3000/auth/google/secrets",
userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo"
},
function(accessToken, refreshToken, profile, cb) {
console.log(profile);

User.findOrCreate({ googleId: profile.id }, function (err, user) {


return cb(err, user);
});
}
));

app.get("/", function(req, res){


res.render("home");
});

app.get("/auth/google",
passport.authenticate('google', { scope: ["profile"] })
);

app.get("/auth/google/secrets",
passport.authenticate('google', { failureRedirect: "/login" }),
function(req, res) {
// Successful authentication, redirect to secrets.
res.redirect("/secrets"); 16
});
app.get("/login", function(req, res){
res.render("login");
});

app.get("/register", function(req, res){


res.render("register");
});

app.get("/secrets", function(req, res){


User.find({"secret": {$ne: null}}, function(err, foundUsers){
if (err){
console.log(err);
} else {
if (foundUsers) {
res.render("secrets", {usersWithSecrets: foundUsers});
}
}
});
});

app.get("/uploads", function(req, res){


if (req.isAuthenticated()){
res.render("uploads");
} else {
res.redirect("/login");
}
});

app.get("/submit", function(req, res){


if (req.isAuthenticated()){
res.render("submit");
} else {
res.redirect("/login");
}
});

app.post("/submit", function(req, res){


const submittedSecret = req.body.secret;

//Once the user is authenticated and their session gets saved, their user details are saved to
req.user.
// console.log(req.user.id);

User.findById(req.user.id, function(err, foundUser){


if (err) {
console.log(err);
} else {
if (foundUser) {
foundUser.secret = submittedSecret;
foundUser.save(function(){
res.redirect("/secrets");
}); 17
}
}
});
});

app.get("/logout", function(req, res){


req.logout();
res.redirect("/");
});

app.post("/register", function(req, res){

User.register({username: req.body.username}, req.body.password, function(err, user){


if (err) {
console.log(err);
res.redirect("/register");
} else {
passport.authenticate("local")(req, res, function(){
res.redirect("/secrets");
});
}
});

});

app.post("/login", function(req, res){

const user = new User({


username: req.body.username,
password: req.body.password
});

req.login(user, function(err){
if (err) {
console.log(err);
} else {
passport.authenticate("local")(req, res, function(){
res.redirect("/secrets");
});
}
});

});

app.listen(3000, function() {
console.log("Server started on port 3000.");
}); 18
7. TESTING :-

SUB-SYSTEM FUNCTIONALITY RESULT

Registration USer will register him/her self They will get the benefit from our website

Upload window User will upload pdf It will be shown to our website

Home window Home page will be their Basic prototype will be shown to our website

Website A convenient UI for the authorized Login mode and download mode
members .

Documents from user side will be


Database Uploaded .Books will be also there It will be shown on our website
Pdf preview will be also availiable

19
8.RESULTS/ OUTPUT SCREENSHOT:
Home page:-

Fig 8.1 (Home page)

Login page:

Fig 8.2 Login page

20
Registration page:

Fig 8.3(Registration page)

Upload page:

Fig 8.4(Upload page)

21
Fig (8.5) subjects page

Fig 8.6(Download page)

22
Mongodb (data base)

Fig 8.7(Database)

23
Console Output

Fig 8.8(Console output)

24
9. CONCLUSION AND FUTURE SCOPE

9.1. CONCLUSION
9
we conclude that our project will provide a useful and interactive tool for the benefit of the
students as well as the teacher. It will be very helpful for future reference as well as the
present because all the things are going in online mode so it will be easy to interact with the
whole world and exchange different study materials across the globe.

9.2 FUTURE SCOPE:-


We will implement the same idea for app development. Video content will be added to our
website so that the learning community will get benefit from our website

25
10. REFERENCES

• Nexus notes
• MERN stack (MongoDB, Express js, React js, Node js)
• Journals video by The app brewery London(the complete web development)
• Journal the complete Web development
• https://docs.mongodb.com/
• https://nodejs.org/en/docs/
• https://expressjs.com/

26

You might also like