Final Project File
Final Project File
ExNo:1a
Date: IDENTIFY A SOFTWARE SYSTEM THAT NEEDS TO BE DEVELOPED
AIM :
To identify a software system that needs to be developed.
Book Bank:
A Book Bank is an initiative by colleges aimed at assisting financially underprivileged and
academically strong students by providing textbooks at a subsidized rate. Instead of borrowing and
returning books, this updated system allows students to purchase textbooks at 75% of their actual cost,
making ownership affordable and accessible.
Students must register on the platform, either as new users or by logging in as returning members.
After registration, students can select their academic year to view a customized list of textbooks
relevant to their course curriculum. They can then choose the books they require and submit a
purchase request to the administrator for verification.
The primary aim is to empower students from economically weaker backgrounds by helping them
own important academic resources without facing high financial pressure. This model of book
purchase ensures long-term use of textbooks and eliminates the complexities of returning them at the
end of the session.
To access this service, students are required to pay 75% of the total book cost at the college office.
After payment, they must present the receipt to the Book Bank clerk to receive their books. The books
are then considered the property of the student and need not be returned.
Students are responsible for checking the condition of the books before issuance. Any pre-existing
damage must be reported immediately. Once issued, the books belong to the student and are not
eligible for return or refund. The Book Bank strictly deals with textbooks only, and does not provide
supplementary materials such as guides, notes, or solved papers.
Process Flow
Student Registration
o New Students: Register by providing personal details.
o Existing Students: Log in using the “old member” option.
o The administrator checks the availability of the requested books and confirms whether the
student is eligible.
o The approval or denial of the request is based on the book’s availability and the eligibility criteria.
Book Issuance
o If approved, the student must deposit 75% of the book’s price at the college office and present
the receipt to the book bank clerk.
o Once these steps are completed, the books are considered purchased and issued to the student.
AIM :
To document the Software Requirements Specification (SRS) for the Book Bank Management
System. The objective of this SRS is to define and outline a software solution that automates the
operations of a college Book Bank. The system aims to assist financially disadvantaged and
academically deserving students by issuing textbooks at a subsidized deposit. This digital solution
will simplify and streamline student registration, book allocation, inventory tracking, return handling,
and administrative control with improved efficiency and transparency.
1. Establish the basis for agreement between the stakeholders and developers on the system’s
expected behavior.
2. Provide clear documentation for software design and development.
3. Reduce misunderstandings and streamline development time.
4. Enable better cost and schedule estimations.
5. Serve as a foundation for future validation and verification.
6. Ensure easy system transfer and knowledge sharing.
7. Facilitate enhancements and maintenance of the system.
Problem Statement:
The Book Bank aims to support underprivileged but deserving students by lending them required
academic textbooks at a minimal refundable deposit. Currently, the process is manual and inefficient,
prone to delays, errors, and lack of proper record-keeping. Students must submit 75% of the book's price
at the college office and present a receipt to borrow books. The books must be returned in good
condition after exams, or else penalties apply. The manual nature of issuing and tracking books leads to
inconsistencies and loss of accountability. A web-based, automated system is needed to manage student
requests, eligibility verification, deposit tracking, and book returns in an efficient, transparent, and
accountable manner.
Requirement Analysis :
The goal of the requirement analysis is to understand and translate organizational needs into a formal set
of functional and technical software requirements. This helps build the foundation for system design,
testing, and maintenance.
Performance
System should respond to user interactions in under 1 second.
Optimized API calls and database queries for fast processing.
Scalability
Designed to handle growing user and data volumes.
Efficient use of cloud services and modular code for
scaling.
Security
All sensitive data encrypted and access-controlled.
Implements role-based authentication and secure API endpoints.
Usability
Clean, mobile-friendly interface with intuitive
navigation. User guidance provided via tooltips and
form validation.
Reliability
Ensures stable behavior under all expected loads.
Includes error recovery, transaction logs, and retry mechanisms.
Maintainability
Code organized using MVC pattern and reusable components.
Easy to debug and extend for future updates.
Portability
The Book Bank Management System is a purpose-driven platform that aims to reduce the academic burden on
underprivileged students by ensuring access to essential textbooks. By leveraging a modern web-based architecture, it
streamlines the entire workflow from registration to returns. It also promotes transparency, reduces manual errors, and
provides a reliable infrastructure for administrators. In essence, this system helps achieve equitable access to education
by combining thoughtful policy with efficient technology.
UNIFIED MODELING LANGUAGE
DESIGN
Design has a great impact on the overall success of software development projects. A
large payoff is associated with creating a good design up from before writing a single code, while
this is due to all programming classes and objects understanding approach better design usually
simplifies the implementation and maintenance. During the design phase we must evaluate the
model to actual objects that can be perform the required tasks. There is a shift in emphasis from
the application domain to implementation. The class during analysis provides as a framework for
design phases.
MODELING
Building a model for a software system prior to its construction is as essential as having
a blueprint for building a large building. Good models are essential for communication among
project teams. A modeling language must include
• Model elements-fundamental modeling concepts and semantics. Notation- visual
rendering of model elements.
• Guidelines-expression of usage within the trade
The use of visual notation to represent or model a problem can provide us with several benefits
relating to clarity, familiarity, maintenance, and simplification.
UNIFIED MODELING LANGUAGE
The Unified Modeling Language (UML) is a language for specifying, visualizing,
constructing, and documenting the artifacts of software systems and their components. UML is a
graphical language with sets of rules and semantics. The rules and semantics of a model are
expressed in English, in a form known as object constraint language (OCL). OCL is a
specification language that uses simple logic for specifying the properties of a system. The UML
is not intended to be a visual programming language in the sense of having all the necessary
visual and semantic support to replace programming languages.
UML DIAGRAMS
UML defines nine graphical diagrams
Use-case diagram
Class diagram
Behavior Diagram
Interaction Diagram
Sequence Diagram
Collaboration diagram
State chart diagram
Activity diagram
Implementation diagram
Component diagram
ExNo:3
Date: USE CASE DIAGRAM
AIM :
To identify Use Cases and develop the Use Case model for the identified requirements.
2. The external actors are placed to the left of the use case and the internal actors to the right.
3. Select Model | Add Diagram | Use Case Diagram in Menu Bar or select Add Diagram | Use
Case Diagram in Context Menu in Star UML.
4. Name the diagram and draw the diagram using the symbols present in the Star UML toolbox
according to the identified actors and use cases.
5. Draw the relationship between the use cases and actors as extend, include and generalization
types using the symbols.
AIM :
To identify conceptual classes and develop a domain model with UML Class diagram
CLASS DIAGRAM :
In the Unified Modeling Language (UML), a class diagram is a collection of static modeling
elements, such as classes and their relationships, connected as a graph to each other and to their
contents; their internal structures, and their relationships to other classes.
A class is drawn as a rectangle with three components separated by horizontal lines. The top
compartment holds the class name, other general properties of the class, such as attributes, are in
the middle compartment, and the bottom compartment holds a list of operations. Either or both
the attribute and operation compartments may be suppressed.
A separator line is not drawn for a missing compartment if a compartment is suppressed; no
inference can be drawn about the presence or absence of elements in it. The class name and other
properties should be displayed in up to three sections. A stylistic convention of UML is to use an
italic font for abstract classes and a normal (roman) font for concrete classes.
PROCEDURE
1. Identify the classes that are taking part in the diagram.
2. Select Model | Add Diagram | Class Diagram in the Menu Bar or select Add Diagram |
Class Diagram in Context Menu.
3. Select class diagram, specify the attributes, operations or methods, parameters, datatype by
selecting following.
• Select Model | Add | Class in Menu Bar or Add | Class in Context Menu.
• Select Model | Add | Attribute in Menu Bar or Add | Attribute in Context Menu.
• Select Model | Add | Operation in Menu Bar or Add | Operation in Context Menu.
• Select Model | Add | Parameter in Menu Bar or Add | Parameter in Context Menu.
Select Model | Add | DataTypein Menu Bar or Add | Datatype in Context Menu.
4. Create the class diagram for the project.
AIM :
To draw sequence and collaboration diagrams for the identified scenarios and the
interaction between objects.
INTERACTION DIAGRAM :
Sequence diagram describes the behavior of the system by viewing the interaction
between the system and its environment. It represents the class at the top and their lifetime, their
interactions as relations.
A collaboration diagram, also called a communication diagram or interaction diagram, is
an illustration of the relationships and interactions among software objects in the Unified
Modeling Language (UML).
SEQUENCE DIAGRAM
PROCEDURE
1. Identify the initiator of the process.
2. Associate each actor with a class whether it uses or provides services. 3. Each actor is
represented as a rectangle.
4. The sequence of flow is denoted by the name of the operations to be done.
5. The actors are separated by vertical dashed lines and sequence flow is indicated through arrows.
6. Select Model | Add Diagram | Sequence Diagram in Menu Bar or select Add Diagram |
Sequence Diagram in Context Menu in Star UML.
7. Create sequence diagrams, showing the interaction between the objects
8. Save the file.
COLLABORATION DIAGRAM
1. This diagram is a numbered transition of sequence diagram in affixed order.
Thus the Sequence and Collaboration diagram was drawn successfully for the Bookbank.
ExNo:6.a
Date: UML-STATE CHART DIAGRAM
AIM :
To draw the state chart diagram for the identified requirements
PROCEDURE
1. Identify important objects to be analyzed.
4. Select Model | Add Diagram | Statechart Diagram in Menu Bar or select Add Diagram |
Statechart Diagram in Context Menu.
5. Create state transition diagram for the project.
Thus the State chart diagram was drawn successfully for the Bookbank.
ExNo:6.b
Date: UML-ACTIVITY DIAGRAM
AIM :
To draw activity the diagram for the identified requirements .
ACTIVITY DIAGRAM :
An activity diagram is a variation or special case of a state machine, in which the states
are activities representing the performance of operations and the transitions are triggered by the
completion of the operations. Unlike state diagrams that focus on the events occurring to a single
object as it responds to messages, an activity diagram can be used to model an entire business
process. The purpose of an activity diagram is to provide a view of flows and what is going on
inside a use case or among several classes.
An activity is shown as a round box, containing the name of the operation. When an
operation symbol appears within an activity diagram or other state diagram, it indicates the
execution of the operation. Executing a particular step within the diagram represents a state
within the execution of the overall method. It may be applied to any purpose such as visualizing
the steps of a computer algorithm, but is considered especially useful for visualizing business
workflows and processes, or use cases. Some of the outstanding notation includes parallel
activities, swimlanes, and action-object flow relationship. An activity diagram allows the reader
to see the system execution and how it changes direction based upon different conditions and
stimuli.
PROCEDURE
1. Identify the activities, association, conditions and constraints.
4. Select Model | Add Diagram | Activity Diagram in Menu Bar or select Add Diagram |
Activity Diagram in Context Menu in Star UML.
5. Select activity diagram and create activity diagram for requirements of project using the tools.
6. Save the file.
RESULT
Thus the activity diagram was drawn successfully for the Bookbank.
ExNo:7
Date: Implement the system as per the detailed design
Aim :
To implement the Bookbank with database connectivity.
Project Structure:
Source code :
backend/app.js:
const app=express();
app.use(cors({
}));
app.use(cookieParser());
connectdb()
app.use(express.json());
app.use('/api/v1',bookrouter);
app.use('/api/v1',authrouter);
app.use('/api/v1',Borrowrouter);
app.use('/api/v1',Buyrouter)
app.listen(3000,()=>{
console.log("hi im a karthi!");
})
backend/authcontroller:
const
{name,email,password,regno,income}=req.body;
const user=await User.create({
name,email,password,regno,income
})
sendtoken(user,200,res)
}
const
{email,password,income}=req.body; if(!
email||!password||income){
})
}
sendtoken(user,200,res)
}
export const logout=async(req,res)=>{
const options={expires:new Date(
Date.now()
)
, httpOnly: true}
res.cookie("token",null,options).json({
message:"logut sucessfuly"
})
}
}
console.log("user", user);
res.status(200).json({ user })
;
}
res.status(200).json({
user
})
}
res.status(200).json({
user
})
}
export const
updateuser=async(req,res,next)=>{ const
updateuser={
name:req.body.name,
email:req.body.email
, role:req.body.role,
}
})
}
}
const user=await User.findByIdAndUpdate(req?.user?._id,resname,{new:true})
res.status(200).json({
user
})
backend/bookcontroller
import Book from '../model/Book.js'; // ✅ Import the model, NOT the seeder
import User from '../model/Auth.js'
import ApiFilter from '../utils/filterapi.js';
export const getbook = async (req, res) => {
try {
const apifilter=new ApiFilter(Book,req.query);
apifilter.search().filters();
;
const books=await apifilter.query;
res.status(200).json({ books});
} catch (err) {
};
export const newbook = async (req, res) =>
{ console.log("Received data:", req.body);
console.log("Authenticated user:", req.user); // <-- add this
try {
});
} catch (err) {
console.error("Book creation error:", err); // <-- log the actual error
res.status(500).json({ error: err.message });
}
};
res.status(200).json({
book,
user
})
}
catch(err)
{ res.status(500).json({"error":"message"
})
}
}
return
res.json({ "message":"book not
available"
})
}
book=await Book.findByIdAndUpdate(req.params.id,req.body)
res.status(200).json({
book
})
}
catch(error)
{ res.json({ "mess
sage":"error"
})
}
}
export const deletebook=async(req,res)=>{
})
}
book=await
Book.findByIdAndDelete(req.params.id)
res.status(200).json({
book
})
}
backend/buycontroller.js:
if (!bookId) {
return res.status(400).json({ message: 'Book ID is required' });
if (!book) {
return res.status(404).json({ message: 'Book not found' });
author: book.author,
category:
book.category, price:
book.price,
},
userDetails: {
name: req.user.name,
email: req.user.email,
role: req.user.role,
income:
req.user.income,
},
});
} catch (error) {
console.error('Error creating buy record:',
error.message); res.status(500).json({ message: 'Server
Error' });
}
};
} catch (error) {
res.status(500).json({
success: false,
message: error.message,
});
}
};
.populate('book', 'title author category price'); // Get book details (title, author, etc.)
if (buyRequests.length === 0)
{ console.log("No buy requests
found");
} catch (error) {
console.error("Error fetching all buy requests:", error);
};
message: error.message
});
}
};
try {
: 'http://localhost:5173/payment-success?session_id={CHECKOUT_SESSION_ID}';
name: book.title,
},
quantity: 1,
}],
mode: 'payment',
success_url: successUrl,
cancel_url: 'http://localhost:5173/cancel',
});
} catch (error) {
console.error('Error initiating payment:', error.message);
res.status(500).json({ message: 'Error creating payment session' });
}
};
// controllers/paymentController.js
// Example: Express.js route to confirm payment
export const confirmPayment = async (req, res) =>
{ const { sessionId } = req.body;
if (!sessionId) {
try {
);
if (!updatedBuy) {
return res.status(404).json({ success: false, message: 'No pending buy record found to update' });
return res.status(200).json({ success: true, message: 'Payment confirmed and record updated' });
} else {
};
backend/authrouter.js:
const router=express.Router();
router.route('/books/register').post(register);
router.route('/books/login').post(login)
router.route('/books/logout').post(logout)
router.route("/getprofile/me").get(isauthentication,getprofile)
router.route("/updateprofile").put(isauthentication,updateprofile)
router.route("/admin/allusers").get(isauthentication,authenticatedrole("admin"),allusers)
router.route("/admin/user/:id").get(isauthentication,authenticatedrole("admin"),getoneuser)
router.route("/admin/updateuser/:id").put(isauthentication,authenticatedrole("admin"),updateuser)
backend/bookrouter.js
const router=express.Router();
router.route("/books").get(isauthentication,getbook)
router.route("/books").post(isauthentication,newbook)
router.route("/book/:id").get(getonebook)
router.route("/book/:id").put(updatebook)
router.route("/book/:id").delete(deletebook)
backend/buyrouter.js
router.route("/books/mybuy").get(isauthentication,mybuydetails)
router.route("/admin/books/requeststatus").get(isauthentication,
authenticatedrole("admin"), allBuyRequests
router.route("/admin/books/requeststatus/:id").put(isauthentication,
requestapproved) router.route('/books/payment').post(isauthentication,
initiatePayment); router.route('/books/confirm-payment').post(isauthentication,
confirmPayment);
export default router;
frontend/app.jsx:
function App() {
return (
<main className='flex-grow'>
<Routes>
</Routes>
</main>
</Router>
);
}
const { data, isLoading, isError, error } = useGetBookQuery({ keyword, max, min });
// Loading State UI
if (isLoading)
{ return (
);
}
</div>
);
<div className="row">
<img
src={book.image ||
'https://placehold.co/300x200'} className="card-
img-top"
alt={book.title}
</div>
</div>
</div>
))
):(
<div className="col-12 text-center">
)}
</div>
</div>
);
};
frontend/productdetails.jsx:
};
} catch (err) {
console.error('Buy Error:', err);
}
};
return (
<div className="col-lg-10">
<div className="card shadow-lg border-0 rounded-4 overflow-hidden">
<div className="row g-0">
<div className="col-md-5 bg-light d-flex align-items-center justify-content-center p-4">
<img
src={data?.book?.image}
alt="Book"
</div>
<p><strong>ISBN:</strong> {data?.book?.isbn}</p>
<p><strong>Category:</strong> {data?.book?.category}</p>
</p>
<div className="d-flex gap-3 mt-4">
<button
className="btn btn-outline-secondary btn-lg px-4 shadow-sm"
onClick={getborrow}
>
<button
</div>
</div>
</div>
</div>
</div>
);
};
OUTPUT:
ADMIN LOGIN:
REQUEST APPROVAL:
PAYMENT PROCESS:
COLLECTED PAYMENTS:
Result:
Thus the implementation for the Bookbank with database connectivity was
completed.
ExNo: 8
Date: Test the software system for all the scenarios identified as per the usecase diagram
Aim :
To test the software system for all the scenarios identified as per the use case diagram.
Testing :
Test Runner: Jest runs tests concurrently to speed up execution and provides detailed output and
reporting.
Assertions Library: Jest comes with built-in assertions like toBe, toEqual, and more, allowing you to
check the expected values.
Mocking: Jest has powerful mocking capabilities, which help simulate and replace dependencies during
testing.
Snapshot Testing: It allows you to capture the output of React components and compare it over time,
helping you catch unexpected changes.
Code Coverage: Jest can automatically generate code coverage reports, helping you ensure that your tests
are covering the necessary parts of your code.
Zero Configuration: Works out of the box with minimal setup.
Fast and Efficient: Runs tests in parallel for improved
performance. Snapshot Testing: Helps track UI changes over time.
Aim :
To Improve the reusability and maintainability of the software system by applying appropriate
design patterns and test it for various scenarios.
The MVC framework separates an application into three main components: models,
views, and controllers. Models are used to store data and business logic; views display data from
a model on the screen; and controllers manage user interactions with these two components.
Model
The Model component corresponds to all the data-related logic that the user works with. This can
represent either the data that is being transferred between the View and Controller components or any
other business logic-related data. For example, a Customer object will retrieve the customer
information from the database, manipulate it and update it data back to the database or use it to render
data.
View
The View component is used for all the UI logic of the application. For example, the Customer view
will include all the UI components such as text boxes, dropdowns, etc. that the final user interacts with.
Controller
Controllers act as an interface between Model and View components to process all the business logic
and incoming requests, manipulate data using the Model component and interact with the Views to
render the final output. For example, the Customer controller will handle all the interactions and
inputs from the Customer View and update the database using the Customer Model. The same
controller will be used to view the Customer data.
Result:
Thus, the reusability and maintainability of the software system was improved by applying
appropriate design pattern and tested for various scenarios successfully.
ExNo:11
Date: DATA FLOW DIAGRAM
To identify Data flow diagram and develop a DFD modelwith Star UML.
A graphical tool, useful for communicating with users, managers, and other personnel .
Used to perform structured analysis to determine logical requirements .
Useful for analyzing existing as well as proposed systems.
Focus on the movement of data between external entities and processes, and
between processes and data stores .
A relatively simple technique to learn and use.
Procedure:
Step : 1
Open StarUML 5.0: Launch the StarUML application on your computer.
Step : 2
Create a New Project: Start a new project by clicking on "File" > "New" > "Project" or by using the
shortcut Ctrl + N.
Step : 3
Add a Data Flow Diagram: Once the project is created, go to "Model" > "Add Diagram" > "Data
Flow Diagram".
Step : 4
Name the Diagram: Give your diagram a name, like " Recruitment System DFD".
Step : 5
Identify External Entities: Identify the external entities involved in the recruitment process.
These could include job applicants, recruiters, and the HR department.
Step : 6
Add Processes: Identify the main processes involved in the recruitment process, such as "Receive
Application", "Screen Candidates", "Schedule Interviews", "Conduct Interviews", and "Offer Job".
Step : 7
Add Data Stores: Identify where data is stored during the process. This could include databases for
storing applicant information, resumes, and interview feedback.
Step : 8
Draw Data Flows: Connect the processes, external entities, and data stores using data
flows. Data flows represent the flow of information between different elements of the
system.
Step : 9
Define Data Flow Names: Label the data flows with meaningful names to describe the
information being passed between elements.
Step : 10
Save Your Work: Once you're satisfied with the diagram, save your work by clicking on
"File" > "Save" or using the shortcut Ctrl + S.
DFD FOR BOOKBANK:
BOOKBANK
BOOK BANK
Level 1
RESULT :
Thus the Data flow diagram was drawn successfully for the Bookbank.