You are on page 1of 39

Blood Bank Management

RedRay

A report submitted in partial fulfillment of the requirements for the award of the degree of

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE AND ENGINEERING

By
SHREYA AGARWAL (IIITU18120)

SCHOOL OF COMPUTING

INDIAN INSTITUTE OF INFORMATION TECHNOLOGY UNA


HIMACHAL PRADESH

DECEMBER 2021
BONAFIDE CERTIFICATE

This is to certify that the project titled REDRAY is a bonafide record of the work done by

SHREYA AGARWAL (IIITU18120)

in partial fulfillment of the requirements for the award of the degree of Bachelor of
Technology in COMPUTER SCIENCE AND ENGINEERING of the INDIAN
INSTITUTE OF INFORMATION TECHNOLOGY UNA, HIMACHAL PRADESH,
during the year 2021 - 2022.

under the guidance of


DR. AVANTIKA SINGH

Project viva-voce held on: 1st December 2021

Avantika Singh
Examiner (Guide Name)

1
School of Computing, IIITU[CSL702]: 18120
ORIGINALITY / NO PLAGIARISM DECLARATION

We certify that this project report is our original report and no part of it is copied from any
published reports, papers, books, articles, etc. We certify that all the contents in this report
are based on our personal findings and research and we have cited all the relevant sources
which have been required in the preparation of this project report, whether they be books,
articles, reports, lecture notes, and any other kind of document. We also certify that this
report has not previously been submitted partially or as a whole for the award of degree in
any other university in India and/or abroad.

We hereby declare that we are fully aware of what constitutes plagiarism and understand
that if it is found at a later stage to contain any instance of plagiarism, our degrees may be
canceled.

SHREYA AGARWAL(IIITU18120)

2
School of Computing, IIITU[CSL702]: 18120
ABSTRACT

Creating a platform where people can donate and seek blood as per requirement. No
platform exists in India where a person can also raise a ticket so as to request all the
registered users to donate blood of required type. It's a platform for social causes that will
help people during difficult times.

3
School of Computing, IIITU[CSL702]: 18120
ACKNOWLEDGEMENT

I would like to thank the following people for their support and guidance without whom the
completion of this project in fruition would not be possible.

I would like to express my sincere gratitude and heartfelt thanks for their unflinching
support and guidance, valuable suggestions, and expert advice. Their words of wisdom and
expertise in subject matter were of immense help throughout the duration of this project.

I also take the opportunity to thank our Director and all the faculty of the School of
Computing, IIIT Una for helping us by providing the necessary knowledge base and
resources.

I would also like to thank my parents and friends for their constant support.

SHREYA AGARWAL (IIITU18120)

4
School of Computing, IIITU[CSL702]: 18120
TABLE OF CONTENTS

Title Page No.

ABSTRACT iii
ACKNOWLEDGEMENT iv
TABLE OF CONTENTS v
LIST OF ACRONYMS vi
LIST OF FIGURES vii

1 Introduction 1
1.1 Problem Definition 1
1.1.1 Objectives 2
1.1.1.1 Features of the application 2

2 Preliminary Study 3
2.1 Online Available Blood Bank 2
2.1.1 Images 3
2.2 Platforms that asks location 4
2.2.1 Images 5

3 Methodology 7
3.1 System Design 7
3.1.1 Hospital panel 7
3.1.1.1 Registration 7
3.1.1.2 Update Information 7
3.1.1.3 Manage Requests 7
3.2.1 User Panel 8
3.2.1.1 Registration 8
3.2.1.2 List of Hospitals 8
3.2.1.3 Raise a ticket 8

5
School of Computing, IIITU[CSL702]: 18120
4 Experimental Results 10
4.1 Hospital Login and Signup 10
4.1.1 Images 10
4.2 User Login and Signup 11
4.2.1 Images 11
4.3 Home Page 12
4.3.1 Images 12
4.3 List of Hospital 13
4.3.1 Images 13

5 Conclusion 14

References 15

Appendices 16

LIST OF ACRONYMS

API Application Programming Interface


JS Java Script

6
School of Computing, IIITU[CSL702]: 18120
LIST OF FIGURES

2.1 A platform for blood bank management 3


2.2 Another platform for blood bank 4
2.3 Zomato Online Website 5
2.4 Dunzo Online Website 6
3.1 Diagram 9
4.1 Hospital Signup 10
4.2 Hospital Login 10
4.3 User Signup 11
4.4 User Login 11
4.5 Home Page 12
4.6 Home Page 12
4.6 Hospital List page 13

7
School of Computing, IIITU[CSL702]: 18120
Chapter 1
Introduction

1.1 Problem Definition

The main aim of developing this system is to provide blood to the people who are in need of
blood. The number of persons who are in need of blood are increasing in large numbers day
by day. Using this system, the user can search for the blood group available in the city and he
can also get the contact number of the donor who has the same blood group he needs. In
order to help people who are in need of blood, this Online Blood Bank management system
can be used effectively for getting the details of available blood groups and users can also get
the contact number of the blood donors having the same blood group and within the same
city. So if the blood group is not available in the blood bank, the user can request the donor to
donate the blood to him and save someone's life. Using this bank management system people
can register who want to donate blood. To register in the system they have to enter their
contact information like address mobile number etc.

This blood bank management system is an online website so it is easily available to everyone.
When a person wants to donate blood he has to register to the system. Donor registration is
very easy, to get registered to the system he has to fill up a registration form. After submitting
the registration form he can create a username and password. Donors have to give
information like blood group, contact details etc. the donor can also change his account
information when he wants using his username and password.

Today, most medical care depends on a steady supply of blood from donors. One in seven

1
School of Computing, IIITU[CSL702]: 18120
people entering the hospital need blood.
An adequate amount of blood is needed in all health care facilities to meet the urgent need for
patients facing trauma and other lifesaving procedures, such as blood transfusions – which
saves millions of lives each year.
Donating blood is a simple procedure that can be done within an hour.

1.1.1 Objectives

To design and develop a platform that brings effective blood bank management available
online for every person.

1.1.1.1 Features of the application

● Hospital registration: Hospitals can register themselves by submitting the details


such as an address, location, and current availability of blood groups.
● Blood Camps registration: A volunteer from a blood camp can register the blood
camp on the portal along with details such as duration, location, time slots, etc.
● User: A person who has blood requirements can register on the portal. He can search
among the registered hospitals and blood camps for the required blood. And if
unsuccessful, a person can raise the request.
● Donor: A person willing to donate blood can search among the hospitals and current
blood camps. He can select the desired time slot and hospital or blood camp
depending upon the location.
● Raise a request: If the person does not find the required blood, he can raise a request
by entering details about his needs. On submitting the details, the request will send to
all the registered donors depending on the location and blood group

Chapter 2

2
School of Computing, IIITU[CSL702]: 18120
Preliminary Study

2.1 ONLINE AVAILABLE BLOOD BANK

There exist multiple platforms where users can find suitable donors and hospitals for blood
donation. The user first signs up on the portal. They search among the various registered
hospitals and blood camps present in the database. Users can contact them and make an
appointment as per their requirements.

2.1.1 Images

Saves life

Image 2.1: A platform for blood bank management

3
School of Computing, IIITU[CSL702]: 18120
Image 2.2: Another platform for blood bank

2.2 Platforms that asks Location

There exist multiple platforms which ask real time location from the user in the most
effective way and with best accuracy. The person can first sign up on the portal and enter its
location for best use of the website.

2.2.1 Images

One such platform that asks location in most effective way is Zomato

4
School of Computing, IIITU[CSL702]: 18120
Image 2.3: Zomato Online Website

5
School of Computing, IIITU[CSL702]: 18120
Image 2.3: Dunzo Online Website

6
School of Computing, IIITU[CSL702]: 18120
Chapter 3
Methodology
3.1 SYSTEM DESIGN

The project will mainly have 2 subparts i.e Hospital Panel and User Panel.

3.1.1 Hospital Panel

Hospital will manage the request for blood donation as well as from the blood seeker .
They will have the right to appoint suitable slots and date for the same.

3.1.1.1 Registration

Hospitals have to register themselves using their name, address, contact information, their
location, and suitable ID for keeping track of frauds or misleading information.

3.1.1.2 Update its Information

Hospitals can update their information any time they want. They can update their location,
availability of blood.

3.1.1.3 Manage Requests

Hospitals can manage the requests from blood donors. They can allot them a suitable slot or
reject the request if staff availability is difficult. They can allot them a slot on a different day
based upon the queue.
They can manage the requests from blood seekers. They can reject a request if the required
blood is not available or can raise a ticket for the same.

7
School of Computing, IIITU[CSL702]: 18120
3.2.1 User Panel

Users can be of two types - a) Blood seekers b) Blood Donors.


Users can search among the various hospitals for the required actions.

3.2.1.1 Registration

Hospitals have to register themselves using their name, address, contact information, their
location, and suitable ID for keeping track of frauds or misleading information.

3.2.1.2 List of Hospitals

Users can search among the registered hospitals from the database arranged according to the
location and distance. Once selected the hospital, they can request the hospital by providing
details of blood type and other necessary information.

3.2.1.3 Raise a ticket

If a Blood seeker does not find the required blood type available near his location. He can
request all the registered hospitals and users to step forward and help.

8
School of Computing, IIITU[CSL702]: 18120
Image 3.1 Diagram

Chapter 4
9
School of Computing, IIITU[CSL702]: 18120
Experimental Results

4.1 Hospital Login and Signup

Image: 4.1 Hospital Signup

Image 4.2 Hospital Login

4.2 User Login and Signup

10
School of Computing, IIITU[CSL702]: 18120
Image 4.3 User Signup

Image 4.4 User Login

4.3 Home Page:

11
School of Computing, IIITU[CSL702]: 18120
Image 4.4 Home Page

12
School of Computing, IIITU[CSL702]: 18120
Image 4.5 Home Page

4.4 Hospital List

13
School of Computing, IIITU[CSL702]: 18120
Image 4.5 Hospital List Page

Chapter 5
Conclusion

14
School of Computing, IIITU[CSL702]: 18120
This blood bank management system is an online website so it is easily available to everyone.
When a person wants to donate blood he has to register to the system. Donor registration is
very easy, to get registered to the system he has to fill up a registration form. After submitting
the registration form he can create a username and password. Donors have to give
information like blood group, contact details etc. the donor can also change his account
information when he wants using his username and password.

The platform is developed for a social cause, a non profit platform to help people during
crucial times.

References

[1] https://nodejs.org/dist/latest-v16.x/docs/api/https.html

[2] https://stackoverflow.com/

15
School of Computing, IIITU[CSL702]: 18120
[3] https://reactjs.org/

[4] https://v4.mui.com/getting-started/example-projects/

16
School of Computing, IIITU[CSL702]: 18120
Appendices

17
School of Computing, IIITU[CSL702]: 18120
Appendix A
Code Attachments
The following is the partial / subset of the code. Code of some module(s) has been wilfully
suppressed.

A.1 Sample Code for backend of User Apis

const asyncHandler = require('express-async-handler')


const User = require('../models/user');
const generateToken = require('../utils/generateToken');
const registerUser = asyncHandler( async (req, res) => {
const {name, email, password, pic, bloodGroup,latitude, longitude} =
req.body;

const userExists = await User.findOne({email});


console.log(userExists);

if(userExists){
res.status(400)
throw new Error("User Already Exists");
}
const user = await User.create({
name,
email,
password,
pic,
bloodGroup,
latitude,
longitude
});

if(user){
res.status(201).json({
_id: user._id,
name: user.name,

18
School of Computing, IIITU[CSL702]: 18120
email: user.email,
isAdmin:user.isAdmin,
pic: user.pic,
password: user.password,
bloodGroup: user.bloodGroup,
token: generateToken(user._id),
latitude: user.latitude,
longitude: user.longitude
});
}else{
res.status(400)
throw new Error('Error Occurred')
}
res.json({
name,
email
});
});

const authUser = asyncHandler(async (req, res) => {


const {email, password} = req.body;

const user = await User.findOne({ email });


console.log(user);

if(user && (await user.matchPassword(password))){


res.json({
_id: user._id,
name: user.name,
email: user.email,
isAdmin:user.isAdmin,
pic: user.pic,
bloodGroup: user.bloodGroup,
token: generateToken(user._id),
longitude: user.longitude,
latitude: user.latitude
});
}
else{
res.status(400)

19
School of Computing, IIITU[CSL702]: 18120
throw new Error('Invalid Email or Password')
}
});

module.exports = {registerUser, authUser};

A.1 Sample Code for Frontend of Hospital SignUp

import React,{useState} from "react";

import axios from "axios";

import {

Grid,

Paper,

Avatar,

TextField,

Button,

Typography,

Link,

} from "@material-ui/core";

import LockOutlinedIcon from "@material-ui/icons/LockOutlined";

import FormControlLabel from "@material-ui/core/FormControlLabel";

import Checkbox from "@material-ui/core/Checkbox";

import { makeStyles } from "@material-ui/core/styles";

import { useHistory } from "react-router-dom";

20
School of Computing, IIITU[CSL702]: 18120
import {

fade,

ThemeProvider,

withStyles,

createMuiTheme,

} from "@material-ui/core/styles";

const useStyles = makeStyles((theme) => ({

BackgroundHead: {

backgroundSize: "cover",

backgroundPosition: "center",

width: "70%",

[theme.breakpoints.up("md")]: {

// height: 700,

width: "40%",

marginRight: 80

// padding: theme.spacing(0, 8, 0, 0),

},

},

extra: {

21
School of Computing, IIITU[CSL702]: 18120
display: "flex",

alignItems: "center",

justifyContent: "center",

textAlign: "center",

flexGrow: 1,

margin: theme.spacing(0, 0),

flexWrap: "wrap",

[theme.breakpoints.up("md")]: {

},

},

footer: {

backgroundColor: "#001a66",

color: "white",

textAlign: "center",

height: "50px",

},

paperStyle: {

// padding: 20,

[theme.breakpoints.up("md")]: {

fontSize: "30px",

width: 500,

},

},

22
School of Computing, IIITU[CSL702]: 18120
heading: {

fontSize: "50px",

[theme.breakpoints.down("md")]: {

fontSize: "25px",

},

fontFamily: "Quicksand, sans-serif",

fontWeight: "900",

// lineHeight: "11px",

fontSize: "40px",

// textTransform: "uppercase",

color: "#4d4d33",

// color: "#009933",

letterSpacing: ".02em",

},

field: {

// backgroundColor: "#eeb7ba",

color: "#eeb7ba",

margin: theme.spacing(1, 2),

width: "300px",

[theme.breakpoints.up("md")]: {

23
School of Computing, IIITU[CSL702]: 18120
width: "350px",

},

},

btnstyle: {

fontFamily: "Quicksand, sans-serif",

fontWeight: "700",

backgroundColor: "rgb(0, 179, 122)",

color: "#fff",

margin: theme.spacing(1, 2),

width: "300px",

height: 50,

[theme.breakpoints.up("md")]: {

width: "350px",

},

borderRadius: "50px",

textTransform: "none"

},

borderr:{

border: "1px solid #000",

margin: "1% 20%",

borderRadius: "30px",

24
School of Computing, IIITU[CSL702]: 18120
}

}));

const DoctorSignup = () => {

const classes = useStyles();

const history = useHistory();

// register state

const [username,setUsername] = useState("");

const [email,setEmail] = useState("");

const [address,setAddress] = useState("");

const [req,setReqNo] = useState("");

const [hos,setHos] = useState("");

const [speci,setSpeci] = useState("");

const [contact,setContact] = useState("");

const [password,setPassword] = useState("");

const [confirmPassword,setConfirmPassword] = useState("");

const [achievement,setAchievement] = useState("");

const paperStyle = {

padding: 20,

height: "70vh",

width: 280,

margin: "20px auto",

25
School of Computing, IIITU[CSL702]: 18120
};

const submitHandler = (e) => {

console.log("sucess");

e.preventDefault();

axios

.post("http://localhost:3000/doctor/register", {

"name":username,

"email":email,

"password":password,

"password2":confirmPassword,

"phone":contact,

"reg_num":req,

"address":address,

"specialization":speci,

"hospital_name":hos,

"achievements":achievement

})

.then((res) => {

console.log(res);

if (res.data.success) {

console.log(res.data);

26
School of Computing, IIITU[CSL702]: 18120
localStorage.setItem("token", res.data.token);

// dispatch({ type: "SET_ROLE", payload: "DOCTOR" });

// dispatch({ type: "SET_USERID", payload: res.data.id });

// dispatch({ type: "LOG_IN" });

// props.history.push("/doctorlogin");

else if(res.data.email) {

alert("User already exist, please sign in to continue");

history.push("/doctorlogin");

}else {

console.log(res.data);

});

const btnstyle = { margin: "8px 0" };

return (

<div style={{paddingTop: 80}}>

<div>

<div className={classes.extra}>

<img src="./hospital4.jpg" alt="lady"


className={classes.BackgroundHead} />

<div >

27
School of Computing, IIITU[CSL702]: 18120
<Grid>

<div>

<div className={classes.paperStyle}>

<Grid align="center">

<h4 className={classes.heading}>Sign Up</h4>

</Grid>

<div className={classes.extra1}>

<TextField

id="outlined-basic"

label="Hospital Name"

variant="outlined"

onChange = {(e) => {setUsername(e.target.value)}}

className={classes.field}

/>

<TextField

id="outlined-basic"

label="Email"

variant="outlined"

className={classes.field}

onChange = {(e) => {setEmail(e.target.value)}}

/>

<TextField

id="outlined-basic"

28
School of Computing, IIITU[CSL702]: 18120
label="Address"

variant="outlined"

className={classes.field}

onChange = {(e) => {setAddress(e.target.value)}}

/>

<TextField

id="outlined-basic"

label="Contact Number"

variant="outlined"

className={classes.field}

onChange = {(e) => {setReqNo(e.target.value)}}

/>

<TextField

id="outlined-basic"

label="Location"

variant="outlined"

className={classes.field}

onChange = {(e) => {setHos(e.target.value)}}

/>

<TextField

id="outlined-basic"

label="Password"

variant="outlined"

29
School of Computing, IIITU[CSL702]: 18120
type="password"

className={classes.field}

onChange = {(e) => {setPassword(e.target.value)}}

/>

<TextField

id="outlined-basic"

label="Confirm Password"

variant="outlined"

type="password"

className={classes.field}

onChange = {(e) => {setConfirmPassword(e.target.value)}}

/>

<Button

type="submit"

variant="contained"

className={classes.btnstyle}

fullWidth

onClick= {submitHandler}

href="/"

>

Sign Up As a Hospital

</Button>

</div>

30
School of Computing, IIITU[CSL702]: 18120
<Typography>

Already a member ?<Link href="/doctorlogin">Sign In</Link>

</Typography>

</div>

</div>

</Grid>

</div>

</div>

</div>

</div>

);

};

export default DoctorSignup;

31
School of Computing, IIITU[CSL702]: 18120

You might also like