0% found this document useful (0 votes)
15 views54 pages

App Final Report

PawAdopt is a comprehensive web-based pet adoption portal designed to streamline the adoption process and promote animal welfare through technology. It features a user-friendly interface for browsing pets, submitting adoption requests, and purchasing pet supplies, all while ensuring secure transactions and data management. The project aligns with various United Nations Sustainable Development Goals, emphasizing responsible pet ownership and the ethical treatment of animals.

Uploaded by

Puneet Narang
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views54 pages

App Final Report

PawAdopt is a comprehensive web-based pet adoption portal designed to streamline the adoption process and promote animal welfare through technology. It features a user-friendly interface for browsing pets, submitting adoption requests, and purchasing pet supplies, all while ensuring secure transactions and data management. The project aligns with various United Nations Sustainable Development Goals, emphasizing responsible pet ownership and the ethical treatment of animals.

Uploaded by

Puneet Narang
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TABLE OF CONTENTS

ABSTRACT
TABLE OF CONTENTS

CHAPTER TITLE PAGE


NO.

NO.

1] INTRODUCTION

1.1 General (Introduction to Project) 1

1.2 Motivation 2
1.3 Objectives 3
1.4 Scope 5

1.5 Sustainable Development Goal of the Project 6

2] SYSTEM REQUIREMENTS

2.1 Hardware requirement 8

2.2 Software requirement 10

3] SYSTEM DESIGN

3.1 System architecture diagram 14


3.2 Use case diagram 18
3.3 Class diagram 22

4] MODULE DESCRIPTION

4.1 Module 1 Description 26

4.2 Module 2 Description 29

4.3 Module 3 Description 32

4.4 Module 4 Description 33

4.5 Result 35
5] CONCLUSION 40
REFERENCES 42

APPENDIX A 44

CODING

iii
CHAPTER 1

INTRODUCTION

1.1 General (Introduction to Project)

In the modern digital era, technology has become an inseparable part of our everyday lives,
transforming the way individuals communicate, work, and interact with their environment [1].
Among the many social domains impacted by this transformation, the field of animal welfare
and pet adoption has seen remarkable progress due to technological intervention. Traditionally,
pet adoption involved manual procedures—visiting shelters physically, filling out paper-based
forms, and relying on local word-of-mouth to find suitable pets. These processes were time-
consuming, limited in scope, and often inaccessible to individuals from remote regions.

With the advancement of web technologies, there has been a gradual shift toward digitalizing
these operations to make pet adoption more convenient, transparent, and efficient. PawAdopt
– A Pet Adoption Portal is designed as a full-stack web-based system that facilitates
communication between animal shelters and potential adopters through a centralized platform.
It allows users to browse available pets, learn about their breed, type, age, and characteristics,
and submit adoption requests directly through the website. The system also provides an
integrated online store where users can purchase pet essentials and accessories, combining
adoption and e-commerce functionalities in one [Link] project employs a robust and
scalable architecture that ensures smooth performance, responsiveness, and reliability [2] . The
frontend has been developed using [Link] and Tailwind CSS, providing an attractive,
interactive, and mobile-friendly interface for users [6]. The backend, built with Spring Boot
(Java), handles the application logic, API endpoints, and secure communication between the
client and the database [5]. The database layer uses PostgreSQL, which efficiently stores and
manages data related to users, pets, adoption requests, and product orders.

Furthermore, the integration of Razorpay ensures a safe and seamless payment experience for
users purchasing pet supplies through the portal. The application is hosted using modern cloud
deployment platforms — Vercel for the frontend and Render for the backend — to ensure
continuous availability, scalability, and version-controlled updates.

1
PawAdopt not only simplifies the pet adoption process but also promotes social responsibility
by encouraging users to adopt rather than buy pets. The system serves as a digital bridge
between compassion and technology, embodying a sustainable solution that benefits both
animal shelters and the community at large.

1.2 Motivation

The motivation for developing PawAdopt arises from the growing need to promote animal
welfare and create awareness about adoption as an ethical alternative to purchasing pets. In
many regions, thousands of abandoned or stray animals end up in shelters due to neglect, abuse,
or overpopulation. Unfortunately, many of these animals remain unadopted because of a lack
of visibility and limited outreach of traditional adoption methods.

In today’s digital-first world, users prefer online platforms that offer convenience and
accessibility. Recognizing this behavioral shift, PawAdopt was conceptualized as a platform
that brings the adoption process into the digital sphere, making it easier for individuals to find
pets that match their preferences and lifestyles. This approach not only saves time but also
helps shelters reach a broader audience, increasing the chances of animals finding loving
homes.

Another motivating factor behind this project is the need for transparency and authenticity in
the adoption process. Many online listings today focus on commercial pet sales rather than
ethical adoptions. PawAdopt counters this by prioritizing verified shelter listings, ensuring
users interact with legitimate sources. This authenticity builds trust between adopters and the
system, promoting responsible pet ownership.

On a personal and humanitarian level, the motivation for PawAdopt lies in the compassion for
animals and the belief that technology can be leveraged to solve real-world social problems.
The project is not only an exercise in technical skill but also an effort to make a tangible social
contribution. Through features like real-time listings, an integrated e-commerce store, and a
responsive user interface, PawAdopt transforms compassion into action by making adoption
simpler, faster, and more impactful.

2
1.3 Objectives

The primary objective of PawAdopt – A Pet Adoption Portal is to design and implement a
comprehensive web-based platform that connects potential adopters with animal shelters and
provides an integrated online space for pet adoption, product purchase, and welfare awareness.
The project strives to create a system that not only automates and streamlines the pet adoption
process but also enhances the accessibility, transparency, and user experience associated with
it.

A major technical objective of this project is to develop a responsive and interactive frontend
using modern web technologies such as [Link] and Tailwind CSS. These tools enable the
creation of a dynamic user interface that is intuitive, visually appealing, and adaptable to
multiple devices and screen sizes. Through this, users can browse available pets, view detailed
profiles including breed, age, health condition, and location, and seamlessly initiate adoption
requests. The user interface is designed with accessibility in mind, ensuring that individuals
from diverse backgrounds, including those with minimal technical experience, can navigate the
platform effortlessly.

On the backend side, the project aims to establish a robust and secure API layer using Spring
Boot, a widely recognized Java-based framework known for its reliability, modularity, and ease
of deployment. This backend handles the business logic, manages authentication and
authorization processes, and ensures smooth data exchange between the user interface and the
database. By adhering to RESTful principles, the backend architecture guarantees scalability
and interoperability, allowing new modules or services to be integrated in the future without
disrupting the existing system [3,4].

Another major objective is the development of a structured and reliable data management
system using PostgreSQL. The database schema is designed to handle multiple interconnected
entities such as pets, users, adoption requests, and product orders [7]. Ensuring data integrity,
normalization, and security are key goals, as the system stores sensitive information related to
user details and transaction histories. The database also supports efficient querying, allowing
administrators to generate insights and reports about adoption trends, product sales, and user
activity.

The project also emphasizes the integration of a secure payment mechanism. The use of
Razorpay for payment processing allows users to complete transactions safely when

3
purchasing pet-related products or making donations. This integration represents a real-world
application of payment gateway APIs and demonstrates the team’s ability to combine e-
commerce functionality with social service objectives.

An equally important objective is the development of a role-based authentication system to


differentiate between regular users and administrators. This ensures proper access control—
while general users can view pets, make purchases, and submit adoption requests, only
authorized administrators can add, update, or remove pet and product data. This separation of
roles enhances system security, prevents unauthorized modifications, and supports smooth
administrative workflows.

From an educational and developmental perspective, PawAdopt aims to serve as a


demonstration of complete full-stack development skills. It integrates various technical
components—frontend design, backend logic, database management, API development, cloud
deployment, and payment integration—into a cohesive and production-ready solution. This
comprehensive implementation helps in understanding how independent modules collaborate
in real-world enterprise systems.

Finally, beyond its technical goals, PawAdopt has a strong social objective: to promote
responsible pet ownership and to reduce animal homelessness. By digitizing adoption
processes, the project aspires to increase the visibility of adoptable animals and make adoption
an easier choice for the general public. It also raises awareness about the importance of
adoption over purchase, thus aligning technological advancement with ethical and
humanitarian values.

In conclusion, the objectives of PawAdopt are multifaceted, covering usability, performance,


scalability, security, and social responsibility. The project stands as a testimony to how modern
technologies, when implemented thoughtfully, can deliver practical solutions that serve both
community welfare and academic learning outcomes.

4
1.4 Scope

The scope of PawAdopt extends well beyond a simple pet adoption listing website. It
encompasses the complete lifecycle of interaction between users, administrators, and the
system, ensuring a seamless, efficient, and user-friendly experience for all stakeholders. The
system has been designed to handle both functional and non-functional requirements that
contribute to its usability, maintainability, and scalability.

From a functional perspective, the system allows users to register, log in, and browse pets
available for adoption. Each pet entry includes detailed attributes such as name, breed, gender,
age, and health information. Users can apply filters based on their preferences—for example,
filtering by pet type (dog, cat, etc.), age, or breed—making the search more personalized. Once
a user identifies a pet they wish to adopt, they can fill out an adoption form providing necessary
details such as contact information and reasons for adoption. These requests are securely stored
in the database and are accessible to administrators for approval or review.

The administrative scope of the project includes a dedicated Admin Dashboard that allows
shelter administrators or authorized personnel to manage pet data, user accounts, adoption
requests, and product listings. Administrators can add new pets, update existing profiles, or
remove adopted ones from the system. They can also track adoption progress, view pending
requests, and communicate with adopters if needed. This structured control system ensures that
data remains organized and up-to-date without duplication or inconsistency.

PawAdopt also includes an integrated e-commerce module, which significantly broadens its
application scope. Users can purchase pet-related products such as food, toys, accessories, and
health supplements directly from the platform. The integration of Razorpay payment gateway
enables secure, real-time online transactions. This functionality transforms PawAdopt from a
simple informational portal into a multi-purpose platform catering to all pet care needs.

In terms of technological scope, PawAdopt demonstrates a fully integrated React–Spring Boot–


PostgreSQL stack deployment pipeline. The frontend and backend communicate through
REST APIs, ensuring modularity and allowing future mobile app or IoT integrations. The
frontend is hosted on Vercel, enabling continuous deployment and scalability, while the
backend is hosted on Render, ensuring reliable API availability. This combination of

5
technologies showcases real-world DevOps practices, including code versioning, environment
variable management, and CI/CD (Continuous Integration/Continuous Deployment).

From a performance standpoint, the scope also includes ensuring responsiveness, accessibility,
and security. The application is optimized for multiple screen sizes and browsers, ensuring that
users can access the system from desktops, tablets, or mobile devices without performance
degradation. CORS configuration in the backend ensures safe cross-origin communication,
while environment variables secure sensitive credentials such as database URLs and API keys.

The project’s social and educational scope is equally important. On a social level, PawAdopt
encourages compassion and awareness about animal welfare. It facilitates the rescue and
rehoming of abandoned animals while reducing reliance on unethical breeding practices. On
an educational level, it provides valuable exposure to full-stack application development,
deployment strategies, and real-world API integration, thereby enhancing both theoretical and
practical learning outcomes for developers.

Looking ahead, the scalability of PawAdopt allows for numerous future enhancements.
Artificial intelligence and machine learning can be integrated to recommend pets based on user
preferences and lifestyle. Chatbot support can be introduced to answer common adoption-
related queries. Veterinary services, vaccination tracking, and adoption certificate generation
could also be incorporated. This scalability ensures that PawAdopt remains a living project,
adaptable to evolving user needs and technological trends.

In summary, the scope of PawAdopt extends from being a simple adoption portal to a
comprehensive digital ecosystem for pet lovers. It encapsulates adoption management, product
sales, secure payment integration, data analytics, and user engagement — all within a robust,
scalable, and user-centric framework. By aligning technical innovation with compassion and
social responsibility, PawAdopt serves as a sustainable model for how technology can
contribute meaningfully to animal welfare and community development.

1.5 Sustainable Development Goal of the Project

PawAdopt aligns closely with several of the United Nations Sustainable Development Goals
(SDGs), particularly Goal 15: Life on Land, which emphasizes the protection, restoration, and
sustainable use of terrestrial ecosystems and biodiversity. By promoting adoption instead of

6
purchasing from unethical breeding centers, PawAdopt supports biodiversity conservation and
reduces animal exploitation.

The project also contributes to Goal 11: Sustainable Cities and Communities by addressing
issues of stray animal management and urban safety. Encouraging adoption and responsible
ownership leads to cleaner, safer cities and reduces the burden on local animal control systems.

In addition, PawAdopt embodies Goal 9: Industry, Innovation, and Infrastructure, as it


employs innovative technology — including web-based architecture, database systems, and
secure payment integrations — to solve a pressing social problem. It demonstrates how digital
innovation can be harnessed for humane and environmental causes, not just for commercial
gain.

The project also aligns with Goal 12: Responsible Consumption and Production, as it
educates users about sustainable pet care practices and offers ethically sourced products
through its integrated store. By combining adoption, education, and e-commerce, PawAdopt
promotes awareness of responsible consumption among pet owners.

In essence, PawAdopt is not merely a software project — it is a vision that unites technology
with empathy. Its alignment with global sustainability goals emphasizes the role of young
developers in contributing to environmental and social betterment through innovation. The
project proves that compassion, when combined with digital intelligence, can pave the way for
a more sustainable, inclusive, and compassionate society.

7
CHAPTER 2

SYSTEM REQUIREMENTS

System requirements define the hardware and software resources essential for developing,
testing, and deploying the PawAdopt Pet Adoption and Management System. The proper
configuration of these resources ensures smooth execution, prevents compatibility issues, and
maintains the performance and scalability of the application across development, staging, and
production environments.

PawAdopt is a full-stack web application that integrates [Link] for the frontend, Spring Boot
for backend services, PostgreSQL for data storage, and Razorpay for secure payment
processing. Its deployment uses Render for backend hosting and Vercel for frontend hosting.
This chapter discusses both hardware and software requirements necessary to support these
technologies.

2.1 Hardware Requirements

Developing PawAdopt requires a computing system capable of running multiple concurrent


tools including integrated development environments (IDEs), web servers, databases, and
browsers. The system must handle simultaneous processes such as frontend builds, backend
execution, and database management without latency or crashes. A stable internet connection
is also mandatory, as dependencies are fetched from remote repositories (npm, Maven Central,
etc.) and for testing API integrations like Razorpay payment gateways.

Minimum Hardware Specifications

8
Processor: Intel Core i3 or AMD Ryzen 3 dual-core processor with a clock speed of at least
2.0 GHz. This ensures the backend Spring Boot server and frontend [Link] development
server can run concurrently without system lag.

RAM: 8 GB of memory. Running an IDE (such as IntelliJ IDEA or VS Code), PostgreSQL,


Render CLI, and local development servers simultaneously requires sufficient memory
allocation.

Storage: 20 GB free disk space to store project files, build artifacts, Maven and npm
dependencies, temporary caches, and log data.

Network Interface: Ethernet or Wi-Fi adapter supporting TCP/IP stack for HTTP requests,
API testing, and deployment.

Display: 1366×768 resolution (HD) or higher for viewing development tools comfortably.

Recommended Hardware Specifications

Processor: Intel Core i5/i7 or AMD Ryzen 5/7 quad-core CPU running at 3.0 GHz or higher
for faster compilation, rendering, and multitasking.

RAM: 16 GB or higher, enabling simultaneous execution of backend and frontend servers,


PostgreSQL, Postman, and browser debugging tools.

Storage: 50 GB or more on a Solid State Drive (SSD) for faster file I/O, build speeds, and
database access.

Display: 1920×1080 (Full HD) or higher resolution monitor for multitasking across IDEs,
browsers, and database interfaces.

Network Bandwidth: Minimum 20 Mbps internet speed for efficient dependency downloads,
API testing, and hosting synchronization.

Production Deployment Hardware : For production deployment (e.g., on Render Cloud),


resource requirements depend on the number of concurrent users. For a small to medium
deployment with up to 200 active users:

Server CPU: Minimum 2 vCPUs for handling concurrent API calls and user sessions.

9
Server RAM: 4 GB minimum; 8 GB recommended to handle simultaneous connections,
caching, and database pooling.

Server Storage: Minimum 50 GB storage for PostgreSQL databases, uploaded images, and
logs.

Network Bandwidth: Minimum 100 Mbps connection for serving frontend assets, REST
APIs, and Razorpay payment callbacks efficiently.

For scalability, Render automatically scales CPU and RAM resources as concurrent usage
increases, ensuring minimal downtime and latency.

2.2 Software Requirements

Operating System Requirements : The PawAdopt application is cross-platform, allowing


development on Windows, macOS, or Linux. The backend (Spring Boot) runs on the Java
Virtual Machine (JVM), while the frontend uses [Link]-based development tools.

Windows: Windows 10/11 (64-bit) with PowerShell and Windows Subsystem for Linux
(optional) for compatibility with npm and Maven build scripts.

macOS: macOS Catalina (10.15) or newer with Xcode Command Line Tools for compiling
native Node modules.

Linux: Ubuntu 20.04 LTS, Debian 11, Fedora 35, or equivalent distributions. Linux provides
better performance for Dockerized or Render CLI-based deployments.

Backend Development Requirements

Java Development Kit (JDK): OpenJDK 17 or Oracle JDK 17. Spring Boot 3.x requires Java
17 or later for running the backend server and building the project [5,8].

Apache Maven: Version 3.8 or newer for managing dependencies and automating builds.
Maven handles integration of libraries like Spring Web, Spring Data JPA, and Lombok.

10
Spring Boot Framework: Version 3.2.0 used for creating RESTful APIs, managing database
operations, and providing embedded Tomcat server for deployment.

PostgreSQL Database Server: Version 14 or newer. PostgreSQL provides robust relational


data management, foreign key constraints, and indexing for query optimization.

Additional Libraries:

Lombok for code simplification (auto-generating getters/setters).

Hibernate ORM for entity mapping and database communication.

HikariCP for database connection pooling.

Spring Security (optional) for authentication and JWT-based token management.

Razorpay SDK for secure payment order generation and verification.

Backend development also requires environment variable configuration for secure access to
the database and Razorpay credentials.

Frontend Development Requirements

[Link]: Version 18.0 or newer. Provides the runtime environment for executing the React
development server.

npm (Node Package Manager): Comes bundled with [Link]. Used to install frontend
dependencies.

React Framework: Version 18 or newer for building modular, component-based user


interfaces [6].

Vite Build Tool: Used for optimized bundling and faster hot-reload during development.

TypeScript : For enhanced static typing and maintainability in large-scale components.

Additional Packages:

Axios for REST API communication.

React Router for navigation and routing.

11
Tailwind CSS for responsive UI styling.

Razorpay Checkout for client-side payment integration.

React Toastify for user notifications.

Development Tools

IDE : IntelliJ IDEA Community Edition 2024 or Eclipse IDE 2024-03 for Java development
and Maven integration.

Database Management Tools: pgAdmin 4 or DBeaver for database schema visualization,


SQL query execution, and data inspection.

API Testing Tool: Postman 10.0 or newer for testing REST API endpoints such as pet
retrieval, adoption requests, and payment creation.

Version Control: Git 2.40 or newer with GitHub for collaborative version tracking, branching,
and pull request management.

Web Browser Requirements

Supported Browsers: Google Chrome (v120+), Mozilla Firefox (v121+), Microsoft Edge
(v120+), or Safari (v17+).

Browser Tools: Developer tools must support JavaScript debugging, network inspection, and
API request tracing to monitor frontend–backend communication and payment response flows.

Production Deployment Requirements: For deploying PawAdopt to production, additional


software and services ensure scalability, security, and uptime.

Backend Hosting: Render platform configured for Java 17 runtime and PostgreSQL
integration [12].

Frontend Hosting: Vercel used for React application deployment, providing automatic build
previews and CDN caching.

SSL/TLS Certificates: Managed by Let’s Encrypt on Render for secure HTTPS


communication.

12
Backup and Monitoring: Automated PostgreSQL backups and Render logs for error tracking
and analytics.

Continuous Integration/Deployment (CI/CD): GitHub Actions or Vercel’s auto-deploy


pipeline ensures that every code push triggers rebuilds and redeployments to maintain version
consistency.

Summary

The system requirements outlined above ensure that PawAdopt operates efficiently across all
environments—from development to production. The integration of lightweight frontend
frameworks, a robust backend, and a secure payment system demands a balanced combination
of hardware power and reliable software tools. Meeting or exceeding these requirements
guarantees that PawAdopt remains scalable, user-friendly, and capable of handling real-world
adoption and e-commerce operations seamlessly.

13
CHAPTER 3

SYSTEM DESIGN

3.1 System Architecture Diagram

The PawAdopt platform follows a multi-tier architecture to ensure scalability, modularity,


andsecurity[1,2].
The system is structured into four main layers, each responsible for a distinct role in handling
user interactions, processing data, and ensuring reliable service delivery.

Clients Layer

Browser / Mobile Web ([Link]): This is the user-facing interface of PawAdopt, designed
with [Link] and Tailwind CSS. It allows users to:

• Browse pets and products.


• View detailed information.
• Submit adoption requests or make purchases. The frontend communicates securely with
the backend using HTTPS-based REST APIs hosted on Render and Vercel.

Edge Layer

The edge layer ensures security, availability, and performance before traffic reaches the
backend servers.

14
• CDN (Content Delivery Network): Distributes static assets like images, CSS, and JS
files to users from the nearest server, improving speed and reducing latency.
• Load Balancer: Evenly distributes incoming user requests among multiple backend
instances, ensuring high availability and preventing overload.
• WAF/DDoS Protection: Filters malicious requests and blocks suspicious traffic,
protecting the application from common web vulnerabilities and denial-of-service
attacks.

Flow:
Client → CDN → Load Balancer → WAF → Frontend

Presentation Layer

Frontend ([Link] + Tailwind CSS):

This layer is responsible for rendering the web application’s UI and handling client-side logic.
It communicates with the backend API Gateway via REST endpoints to fetch pets, manage
adoption requests, handle orders, and process user authentication.

It also interacts with Razorpay Payment Gateway for secure online transactions, ensuring
smooth checkout flow for users purchasing pet products or donating to shelters.

Application Services Layer

The core backend is developed in Spring Boot, following a modular service-oriented structure
that isolates business logic into individual services [4,5,9]:

• API Gateway: Central hub that receives all incoming API calls from the frontend and
routes them to the appropriate service modules [3].
• Auth Service: Manages user registration, login, JWT-based authentication, and session
security.
• Pet & Adoption Service: Handles pet listings, filtering, adoption requests, and approval
workflows.

15
• Product & Order Service: Manages the e-commerce module—products, orders, and
cart functions.
• Payment Service: Integrates with Razorpay API for secure payment creation,
validation, and transaction handling.
• Admin Dashboard Service: Provides administrative access for managing users, pets,
products, and adoption requests.

Each service interacts with the database through JPA repositories and communicates using
REST APIs for clean modular integration.

Data Storage Layer

This layer ensures data persistence and reliability.

• PostgreSQLDatabase:
Stores structured data—users, pets, adoption requests, orders, and products.
PostgreSQL was selected for its scalability, security, and robust relational data support.

Data Flow Summary

1. A user accesses the platform through the browser or mobile interface.


2. Requests pass through CDN → Load Balancer → WAF for optimized delivery and
protection.
3. The frontend communicates with the backend API Gateway via REST APIs.
4. The API Gateway routes requests to appropriate services like adoption, products, or
payments.
5. Backend services interact with the PostgreSQL database to read/write data.
6. The response is returned to the frontend, updating the UI dynamically.

Architectural Qualities

• Scalable: Load balancing and modular microservices allow horizontal scaling.

16
• Secure: HTTPS encryption, WAF filtering, and JWT-based authentication safeguard
data.
• Reliable: PostgreSQL ensures data integrity; optional Redis caching enhances
performance.
• Maintainable: Each service is independent, making debugging and upgrades easier
[10,11].
• Extensible: New modules (like veterinary services or donation tracking) can be added
easily.

Summary

The PawAdopt architecture is a secure, modern, and scalable full-stack web solution built
using [Link] (frontend) and Spring Boot (backend) with a PostgreSQL database.
It follows clear separation of concerns—presentation, logic, and data—ensuring high
maintainability and robust performance across all modules of the pet adoption ecosystem.

17
Fig 3.1: System Architecture Diagram

3.2 Use Case Diagram

Purpose

The diagram illustrates how different types of users interact with the PawAdopt system and
its primary functionalities.
It shows Users, Guest Viewers, and Administrators, and their relationships with key features
such as browsing pets, submitting adoption requests, managing pet data, and processing
payments.
The goal of this diagram is to represent the functional boundaries of the system and highlight
the specific roles and permissions assigned to each actor.

18
Actors

• User:
The primary actor who interacts with the system for adoption and purchase activities.
A registered user can browse pets, view detailed profiles, request adoptions, purchase
pet products, add favorites, and make online payments through the integrated payment
gateway.
• GuestViewer:
A non-registered visitor who can only view basic pet listings and details without
performing authenticated actions such as adoption requests or online purchases.
• Administrator:
The system manager responsible for maintaining and updating pet listings, approving
adoption requests, managing product inventories, and monitoring user activity within
the portal.
The admin ensures that data remains accurate, secure, and consistent across all modules.

Core Use Cases

Authentication & User Management

• Register/Login:
Users register by providing necessary details or log in to access their personalized
dashboards.
This ensures secure access and enables personalized operations like adoption tracking
and purchase history.
• ManageProfile:
Users can edit their personal details, contact information, and preferences within their
account settings.

Pet Adoption

19
• BrowsePets:
Allows both users and guests to view available pets along with essential information
like breed, type, age, gender, and location.
• ViewPetDetails:
Displays comprehensive information, images, and adoption status for a specific pet.
• SubmitAdoptionRequest:
Registered users can apply to adopt a pet by submitting an online request form
containing contact details and reasons for adoption.
• AddtoFavorites:
Enables users to save specific pets they’re interested in for easy access later.

E-Commerce & Payments

• BrowseProducts:
Displays a catalog of pet-related items such as food, toys, and accessories available for
purchase.
• AddtoCart:
Lets users select desired products for checkout.
• MakePayment:
Integrates Razorpay payment gateway for secure online transactions.
The system records payment details and updates order status automatically upon
successful completion.

Administrative Functions

• ManagePets:
Admins can add new pets, update details of existing ones, or remove adopted pets from
listings.
• ManageProducts:
Admins handle product listings — adding new items, editing prices or details, and
deleting outdated products.

20
• Review Adoption Requests:
Enables admins to view, approve, or reject incoming adoption applications based on
verification and availability.
• ViewOrders:
Provides a list of completed and pending transactions for monitoring and
recordkeeping.

Relationships

• User interacts with core features such as browsing pets and products, submitting
adoption requests, and making payments.
• Guest Viewer interacts only with non-authenticated features like viewing pet listings
and details.
• Admin manages operational functions, ensuring smooth system maintenance and data
integrity.
• Certain use cases are interdependent — for example:
o “Register/Login” must occur before “Submit Adoption Request” or “Make
Payment.”
o “Add to Cart” extends to “Make Payment.”
o “Manage Pets” and “Review Adoption Requests” are exclusive to Admins.

Summary

This use case diagram provides a clear depiction of the role-based interactions within the
PawAdoptsystem.
It defines how:

• Users handle core adoption and shopping functionalities.


• Guests are limited to browsing capabilities without data modification privileges.
• Administrators ensure the platform operates efficiently through management and
verification controls.

By illustrating these relationships, the diagram effectively captures the functional boundaries,
user permissions, and overall system workflow for the PawAdopt pet adoption platform.

21
Fig 3.2: Use Case Diagram

3.3 Class Diagram

Overview

This class diagram represents the core object relationships and entities in the PawAdopt
System, a platform designed to manage pet adoptions and product purchases.
It outlines how users interact with pets, make adoption requests, and place product orders,
emphasizing the relationships between these entities.

User : The User class represents every registered person using the platform, including adopters
andadministrators.
Attributes:

22
• id: Unique identifier for each user.
• name: Full name of the user.
• email: Used for login and notifications.
• password: Encrypted password for authentication.
• role: Determines whether the user is an adopter or admin.

Relationships:

• A user can add or list multiple pets (if an admin).


• A user can make multiple adoption requests.
• A user can place multiple product orders.

Pet : Represents animals available for adoption.


Attributes:

• id: Unique identifier for each pet.


• name, type, breed, age, gender, description: Pet profile details.
• adopted: Boolean flag indicating if the pet is already adopted.

Relationships:

• A pet can receive multiple adoption requests.


• Each pet belongs to a single user who listed it (admin).

AdoptionRequest : Represents a user’s request to adopt a particular pet.


Attributes:

• id: Unique identifier for each adoption request.


• userId: References the user making the request.
• petId: References the pet being adopted.
• status: Tracks request progress (e.g., Pending, Approved, Rejected).
• reason: Optional message stating why the user wants to adopt.

Relationships:

• Each adoption request connects one user and one pet.


• A user can submit many requests for different pets.

23
Product : Represents items listed in the shop section for purchase (like pet food, accessories,
etc.).
Attributes:

• id: Unique identifier.


• name, description: Basic product information.
• price: Product cost.
• imageUrl: Product image reference.

Relationships:

• A product can be included in multiple order items.

Order : Represents a user’s purchase transaction.


Attributes:

• id: Unique order ID.


• userId: References the user who placed the order.
• totalAmount: Total price of the order.
• paymentStatus: Payment result (Pending, Completed, Failed).

Relationships:

• A user can place multiple orders.


• Each order can contain multiple items.

OrderItem : Represents each individual product entry within an order.


Attributes:

• id: Unique identifier for the order item.


• productId: References the product purchased.
• quantity: Number of units ordered.
• price: Price per unit at purchase time.

Relationships:

• Each order item belongs to one order and one product.

24
Summary

This class model forms the foundation of PawAdopt’s backend data structure:

• Users interact with both adoption and e-commerce features.


• Pets are central to the adoption system.
• AdoptionRequests link users to pets.
• Products, Orders, and OrderItems form the e-commerce subsystem.

Together, this modular structure enables efficient data management, entity relationships, and
system scalability for a modern full-stack pet adoption and shopping platform.

Fig 3.3: Class Diagram

25
CHAPTER 4

MODULE DESCRIPTION

This chapter provides a comprehensive description of all the functional modules of the system.
The PawAdopt project has been divided into four major modules that work in coordination to
deliver a seamless experience to users, administrators, and potential pet adopters. Each module
has been designed and implemented to achieve specific objectives while maintaining the
overall integrity and performance of the system.

The four main modules are:

1. User Module

2. Admin Module

3. Product and Payment Module

4. Information and Support Module

The following sections describe each module in detail, outlining their objectives,
functionalities, inputs, outputs, and advantages.

4.1 USER MODULE

4.1.1 Objective

The main objective of the User Module is to allow individuals (users) to register, browse
available pets for adoption, view product listings, and interact with the platform efficiently. It
focuses on providing a user-friendly, responsive, and secure interface where users can initiate
adoption requests, save favorite pets, and purchase necessary pet-related products.

This module also aims to simplify the adoption process by enabling real-time communication
between potential adopters and the system administrators who oversee adoptions.

26
4.1.2 Description

The User Module serves as the primary interface for potential adopters and customers. It is
built with a focus on accessibility and responsiveness, ensuring that users can interact with the
system from various devices. The module allows users to register securely, log in, browse
adoptable pets, and view relevant information such as breed, age, gender, and location.

All data displayed to users is retrieved dynamically from the backend via API calls [3,13]. The
module also manages user sessions, allowing for personalized experiences, such as displaying
saved wishlists and previous adoption requests. The adoption process is fully digital, with
forms and approvals handled online.

Data security is maintained through password encryption using the BCrypt algorithm, and
CORS configuration ensures safe communication between the React frontend (on Vercel) and
the Spring Boot backend (on Render) [1,10].

4.1.3 Features

User Registration and Authentication:

This feature allows new users to create personal accounts by providing their details, such as
name, email, and password. To ensure security, all passwords are encrypted before being stored
in the database. Returning users can log in with their credentials to access their personalized
dashboard. This authentication process guarantees authorized access and keeps user data safe
from misuse.

Profile Management:

Users can view and edit their profile information after logging in. The profile management
feature enables them to update their contact details, change their password, and review their
previous adoption requests. It ensures that all user data remains current and provides an
individualized experience every time a user interacts with the portal.

27
Pet Browsing and Search

The browsing and search functionality provides users with a comprehensive and efficient way
to explore available pets. Users can search for pets using filters such as category (dog, cat, bird,
etc.), breed, age, and gender. Results are fetched in real-time from the database using optimized
backend queries, providing instant access to accurate information.

Adoption Request Submission:

Once a user identifies a pet they wish to adopt, they can fill out an online adoption request
form. This form captures basic personal details and a message describing the user’s motivation
for adoption. Each request is stored with a "Pending" status and later reviewed by the admin.
Users receive notifications once their request is approved or rejected.

Wishlist Management:

The wishlist feature allows users to bookmark specific pets or products for future reference.
These items remain saved under the user’s account and can be revisited at any time. It enhances
user convenience and ensures a personalized experience by enabling users to track their
preferred pets easily.

Responsive Design:

The frontend interface is built using [Link] and Tailwind CSS, ensuring full responsiveness
[6,13]. The layout automatically adjusts to different screen sizes, offering a consistent
experience across mobile devices, tablets, and desktops. This accessibility ensures all users can
interact comfortably with the system. 4.1.4 Inputs and Outputs

Inputs:

User credentials, search queries, and adoption form details.

Outputs:

Pet listings, adoption confirmation notifications, and updated user profiles.

28
4.1.5 Advantages

• Simplifies the adoption process for end users.

• Offers an intuitive and responsive interface.

• Provides personalized user experiences.

• Ensures secure authentication and data management.

4.2 ADMIN MODULE

4.2.1 Objective

The Admin Module is designed to manage all system data, user accounts, adoption requests,
and product listings. Its main objective is to give administrators full control over the platform’s
operations while maintaining data accuracy and security.

4.2.2 Description

The Admin Module serves as the control panel for all backend operations. Only authorized
administrators can access this module, ensuring the integrity and confidentiality of data. The
admin panel provides a dashboard view displaying summarized statistics, such as the number
of registered users, available pets, and pending adoption requests.

The admin can perform CRUD (Create, Read, Update, Delete) operations on all major entities
[7]. When a new pet is rescued or made available, the admin can add its details to the system.
Once a pet is adopted, the admin can change its status to “Adopted,” ensuring the pet is no
longer listed for adoption. The admin also monitors product listings, ensuring accurate
inventory updates.

This module ensures that the overall system remains organized and updated at all times,
forming the backbone of PawAdopt’s operational management.

29
4.2.3 Features

Admin Login and Authentication:

To access administrative functions, the admin must log in using valid credentials. On system
initialization, a default admin account is automatically created to ensure constant access. This
secure authentication mechanism uses encrypted credentials to prevent unauthorized system
control [10].

Pet Management:

This feature allows the admin to manage all pet-related records. The admin can add new pets
by entering their name, age, breed, gender, and other details, along with uploading images. The
admin can also update pet records or remove outdated ones. When an adoption request is
approved, the corresponding pet’s status is updated to “Adopted” in real-time.

User Management:

The user management feature gives administrators oversight of all registered users. The admin
can view profiles, track adoption activities, and delete inactive or fraudulent accounts. This
ensures that the platform remains secure and free of misuse while maintaining an updated
database of legitimate users.

Adoption Request Management:

Admins can view all incoming adoption requests submitted by users. Each request is reviewed,
verified, and then approved or rejected based on authenticity. Approved requests automatically
mark the corresponding pet as adopted. This feature automates adoption tracking and helps
maintain transparency between users and administrators.

Product Management:

30
Admins can manage the catalog of pet-related products. They can add, update, or delete product
entries and adjust stock or pricing information. This feature keeps the e-commerce component
of PawAdopt relevant and accurate.

Analytics Dashboard:

The dashboard presents key performance indicators such as adoption rates, product sales, and
active user counts. This analytical overview helps the admin make informed decisions and
monitor the health of the system.

4.2.4 Inputs and Outputs

Inputs:

Admin credentials, pet data, product information, and adoption request details.

Outputs:

Updated dashboards, confirmation messages, and real-time data updates.

4.2.5 Advantages

• Provides centralized system control.

• Ensures up-to-date pet and user information.

• Reduces data redundancy and manual errors.

31
4.3 PRODUCT AND PAYMENT MODULE

4.3.1 Objective

The objective of the Product and Payment Module is to integrate an e-commerce functionality within
the PawAdopt platform, allowing users to buy pet-related accessories and essentials while simulating
secure online payments through Razorpay.

4.3.2 Description

This module introduces an online store into the PawAdopt portal. Users can browse a collection of
products categorized under pet food, accessories, grooming items, and toys. Each product is displayed
with detailed information, including name, image, description, and price. Users can add items to their
cart, view the total cost, and proceed to checkout.
The checkout process is integrated with Razorpay’s sandbox API, which simulates secure online
payments [14]. Once the payment is successful, a receipt is generated, and an order entry is created in
the database. Both users and admins can track order history, ensuring transparency and accountability.
The payment flow is secure and does not store any sensitive financial information on the PawAdopt
servers. This feature makes the portal more interactive and practical, reflecting real-world e-commerce
experiences.

4.3.3 Features

Product Listing and Catalog:


The system displays an organized catalog of products that users can browse easily.
Each product entry contains vital details such as price, description, and availability.
The catalog is fetched dynamically from the backend and supports filtering options for smooth
navigation.

Shopping Cart System:


Users can add multiple items to their cart and view the total cost in real time. The cart can be updated
by changing quantities or removing items before proceeding to payment. This feature enhances
convenience and mimics real e-commerce platforms.

Checkout and Payment Processing:

32
At checkout, the Razorpay API is called to simulate payment through a secure sandbox environment.
The backend handles all API interactions, generating a unique order ID for each transaction [3,14].
Once completed, the user receives confirmation of the payment and an electronic receipt.

Order Management and Tracking:


Every successful payment generates a record in the orders table. Users can view their order history in
their dashboard, while the admin can monitor all transactions. This feature ensures accountability and
provides reference points for both parties.

Admin Oversight and Control:


Admins can access detailed reports of user purchases and track product sales performance. This
oversight assists in maintaining inventory and identifying popular products.

4.3.4 Inputs and Outputs


Inputs:
Productselections, payment details, and user identification data.
Outputs:
Payment confirmations, order receipts, and updated product stock.

4.3.5 Advantages

• Expands platform functionality with shopping integration.

• Simulates real payment systems securely.

• Provides transparency for both users and administrators.

• Offers scalability for future financial integrations.

4.4 INFORMATION AND SUPPORT MODULE


4.4.1 Objective

The Information and Support Module is aimed at educating users, supporting first-time pet owners,
and providing communication channels for queries or feedback. It strengthens user engagement and
encourages responsible pet adoption.

4.4.2 Description
33
This module functions as an informational and support resource within the PawAdopt system [1]. It
includes sections such as First-Time Pet Owner Guide, Pet Care Articles, About Us, and Contact
Us. Users can read informative content on pet care practices, feeding habits, and breed information.

The module also includes a feedback form where users can share their suggestions, report issues, or
ask questions. The admin can view and respond to these submissions, ensuring active engagement.
This module enhances the platform’s trustworthiness by emphasizing transparency and
communication.

4.4.3 Features

First-Time Pet Buyer Guide:

This feature provides detailed information for new adopters, including tips on selecting suitable breeds
and understanding the responsibilities of pet ownership. It helps users make informed decisions before
adoption and promotes ethical practices.

Pet Care Articles and Resources:

This section offers articles and tutorials about grooming, feeding, training, and pet health. It
encourages continuous learning for pet owners, improving animal welfare and long-term care.

About Us and Contact Information:

These pages inform users about the mission and vision of PawAdopt, highlighting its dedication to
animal welfare. The contact section allows users to send inquiries or reach the team directly through
forms or email.

Feedback and Support System:

Users can submit feedback or queries, which are stored in the backend for admin review. This system
helps improve services and maintain a responsive relationship between users and administrators.

34
4.4.4 Inputs and Outputs

Inputs:

User feedback, queries, and article access requests.

Outputs:

Educational articles, acknowledgment messages, and responses to user queries.

4.4.5 Advantages

• Promotes user education and responsible ownership.

• Builds trust and strengthens community relations.

• Enables continuous system improvement through feedback.

• Enhances user satisfaction and transparency.

4.5 RESULTS AND DISCUSSION

After integrating all four modules, the PawAdopt system performs efficiently across all intended
functionalities. Users can register, log in, explore pets, and submit adoption requests without errors.
Admins can effectively manage users, pets, and product inventories. The product and payment
modules integrate seamlessly with Razorpay’s sandbox, enabling safe and realistic transaction
simulations.

During testing, API responses were consistent and accurate, maintaining low latency across multiple
user sessions. Security features such as password encryption and CORS configuration successfully
prevented unauthorized access.

The system demonstrated excellent compatibility across browsers and devices, ensuring accessibility
for all users. Moreover, data consistency between the backend and database was validated using
Postman API tests, confirming reliability.

In conclusion, PawAdopt successfully meets its project objectives by combining social welfare goals
with technical innovation. It stands as a practical, user-friendly, and scalable solution for digital pet
adoption and management.

35
FIG 4.1 Home Page of Pawadopt

FIG 4.2 Featured Pets

36
FIG 4.3 Pets Available for Adoption

FIG 4.4 Shop Portal

37
FIG 4.5 LOGIN PAGE

FIG 4.6 Admin Dasboard


38
FIG 4.7 Payment Gateway By Razorpay

39
CHAPTER 5

CONCLUSION

The PawAdopt system has been successfully designed, developed, and implemented as a full-stack
web application that enables users to adopt pets and purchase pet-related products through a unified
digital platform. The project demonstrates how modern web technologies can be leveraged to create
an efficient, scalable, and user-friendly solution that addresses both animal welfare and convenience
for pet lovers [15].

Through the combination of a React-based frontend and a Spring Boot backend, the system delivers a
responsive user interface, secure API communication, and robust database interactions [5,6,15]. The
integration of PostgreSQL ensures reliable data storage for user details, pets, adoption requests,
products, and orders, while Razorpay API integration enables seamless payment processing for
purchases. The entire architecture follows a clean separation of concerns—frontend handles user
interaction, backend manages business logic, and the database layer ensures persistence—making the
application modular and maintainable.

During the course of this project, we aimed to bridge the gap between potential pet adopters and animal
shelters by providing a centralized, accessible digital adoption portal. Traditional adoption methods
often lack visibility and efficiency, leading to longer adoption cycles and reduced outreach. PawAdopt
eliminates these limitations by enabling real-time browsing of available pets, submission of adoption
requests, and status tracking through an automated workflow. The system also includes an integrated
e-commerce module for pet supplies, which not only enhances user engagement but also provides a
potential source of support for shelter operations.

From the backend perspective, the project emphasizes scalability, data consistency, and security. Using
Spring Boot’s RESTful architecture, each API endpoint is dedicated to specific operations such as user
authentication, pet management, order processing, and adoption handling [3,5]. Proper CORS
configuration ensures safe cross-origin communication between frontend and backend servers. Role-
based access control restricts administrative functions, ensuring that only authorized personnel can
manage pets, products, and adoption approvals.

On the frontend, the application’s design focuses on clarity, ease of navigation, and accessibility. React
components have been carefully structured to provide consistent user experiences across different
40
devices, supported by Tailwind CSS for responsive styling [6,13]. Users can explore pets, view
detailed profiles, and submit adoption requests with intuitive forms. The administrative dashboard
serves as the core management hub—offering a consolidated view of all pets, products, orders, and
adoption requests. It allows administrators to add or update records dynamically, review applications,
and modify adoption statuses with minimal effort.

The project also reflects adherence to software engineering principles such as modularity, reusability,
and maintainability. By dividing the system into distinct layers and using standardized frameworks,
PawAdopt achieves flexibility for future enhancements—such as adding shelter-specific dashboards,
AI-based pet recommendations, or real-time chat support between adopters and shelters [2,4,9].

In terms of social impact, PawAdopt extends beyond a technical exercise. It encourages compassion
and responsible pet ownership by simplifying the adoption process and raising awareness about animal
welfare. The inclusion of a dedicated product marketplace indirectly supports pet care initiatives and
fosters community participation. The platform’s transparent communication model—where users can
directly interact with shelters or administrators—builds trust and ensures that every adoption request
is handled with authenticity and accountability.

Testing and validation have been carried out across all modules to ensure proper functionality. Unit
tests and manual test cases confirm that API endpoints respond accurately, form inputs are validated,
and data transactions remain consistent. The deployment on Render (for backend) and Vercel (for
frontend) showcases real-world deployment strategies, emphasizing cloud integration and
environment variable management for secure configurations [12]. Performance optimization
techniques such as caching and efficient query design further enhance system responsiveness.

In conclusion, PawAdopt stands as a comprehensive example of a modern full-stack web application


that aligns technology with social responsibility. It successfully meets the project’s objectives—
providing a digital ecosystem for adopting pets, managing inventory, handling payments, and ensuring
administrative control. The modular architecture, intuitive user interface, and secure database
operations together form a reliable and scalable platform suitable for expansion and real-world use.
The project demonstrates not only the technical competence required to build a full-scale application
but also the ability to apply these skills to solve meaningful, real-life problems [1,15].

Future enhancements could include integrating machine learning for pet matching, implementing
chatbots for adoption assistance, and expanding to a mobile application for broader accessibility. With
these extensions, PawAdopt can evolve into a fully featured animal welfare ecosystem—connecting
adopters, shelters, and service providers in a seamless and impactful way [11].

41
REFERENCES

[1] Sommerville, I., "Software Engineering," 10th Edition, Pearson Education, Boston, MA, 2015.

[2] Gamma, E., Helm, R., Johnson, R., and Vlissides, J., "Design Patterns: Elements of Reusable
Object-Oriented Software," Addison-Wesley Professional, Reading, MA, 1994.

[3] Fielding, R. T., "Architectural Styles and the Design of Network-based Software
Architectures," Ph.D. dissertation, University of California, Irvine, CA, 2000.

[4] Richardson, C., "Microservices Patterns: With Examples in Java," Manning Publications,
Shelter Island, NY, 2018.

[5] Walls, C., "Spring Boot in Action," Manning Publications, Shelter Island, NY, 2016.

[6] Banks, A., and Porcello, E., "Learning React: Modern Patterns for Developing React Apps,"
2nd Edition, O'Reilly Media, Sebastopol, CA, 2020.

[7] Silberschatz, A., Korth, H. F., and Sudarshan, S., "Database System Concepts," 7th Edition,
McGraw-Hill Education, New York, NY, 2019.

[8] Liang, Y. D., "Introduction to Java Programming and Data Structures," 12th Edition, Pearson,
Boston, MA, 2020.

[9] Newman, S., "Building Microservices: Designing Fine-Grained Systems," 2nd Edition,
O'Reilly Media, Sebastopol, CA, 2021.

[10] Martin, R. C., "Clean Code: A Handbook of Agile Software Craftsmanship," Prentice Hall,
Upper Saddle River, NJ, 2008.

[11] Fowler, M., "Refactoring: Improving the Design of Existing Code," 2nd Edition, Addison-
Wesley Professional, Boston, MA, 2018.

[12] Prasad, K. V., and Aithal, P. S., "A Study on Cloud Computing Deployment Models and its
Performance," International Journal of Applied Engineering and Management Letters, Vol. 4, No. 2,
pp. 98-110, 2020.

42
[13] Chen, J., and Liu, X., "Web Application Development Using Modern JavaScript Frameworks,"
IEEE International Conference on Computer Science and Information Technology, Beijing, China, pp.
145-152, 2019.

[14] Kumar, S., and Singh, A., "E-commerce Payment Gateway Integration: A Comprehensive
Study," Journal of Information Systems and Technology Management, Vol. 15, No. 3, pp. 421-436,
2021.

[15] Johnson, M., Williams, R., and Davis, L., "Full-Stack Web Development: Best Practices and
Implementation Strategies," ACM Computing Surveys, Vol. 53, No. 4, Article 78, pp. 1-35, 2021.

43
APPENDIX A

CODING

[Link] (Backend);

package [Link];

import [Link];

import [Link].*;

import [Link];

import [Link];

import [Link];

@RestController

@RequestMapping("/api/adoption")

@CrossOrigin

public class AdoptionController {

@Autowired private AdoptionRequestRepository repo;

@PostMapping("/request")

public AdoptionRequest request(@RequestBody AdoptionRequest r) { return [Link](r); }

44
@GetMapping

public List<AdoptionRequest> all() { return [Link](); }

@PutMapping("/{id}/status")

public AdoptionRequest updateStatus(@PathVariable Long id, @RequestBody String status) {

AdoptionRequest ar = [Link](id).orElseThrow();

[Link](status);

return [Link](ar);

[Link]:

# Database - set via Render / environment variables

[Link]=${SPRING_DATASOURCE_URL}

[Link]=${SPRING_DATASOURCE_USERNAME}

[Link]=${SPRING_DATASOURCE_PASSWORD}

[Link]-auto=update

[Link]-sql=true

[Link].format_sql=true

# Server port

[Link]=${PORT:8080}

45
# Razorpay keys (set as env vars)

razorpay.key_id=${RAZORPAY_KEY_ID}

razorpay.key_secret=${RAZORPAY_KEY_SECRET}

# CORS allowed origins (comma-separated)

[Link]=${APP_CORS_ORIGINS:[Link]

[Link]

// src/lib/[Link]

// API configuration and utility functions for PawAdopt frontend

const API_BASE_URL = [Link].VITE_API_BASE_URL || '[Link]


[Link]';

// Generic API call function

export const apiCall = async (

endpoint: string,

options: RequestInit = {}

): Promise<any> => {

const url = `${API_BASE_URL}${endpoint}`;

const defaultHeaders: Record<string, string> = {

'Content-Type': 'application/json',

};

46
// Add auth token if exists

const token = [Link]('authToken');

if (token) {

defaultHeaders['Authorization'] = `Bearer ${token}`;

const config: RequestInit = {

...options,

headers: {

...defaultHeaders,

...[Link],

},

};

try {

const response = await fetch(url, config);

// Handle empty responses

if ([Link] === 204 || [Link]('content-length') === '0') {

return null;

47
}

const data = await [Link]();

if (![Link]) {

throw new Error([Link] || `API request failed: ${[Link]}`);

return data;

} catch (error) {

[Link]('API Error:', error);

throw error;

};

// ============================

// PETS API

// ============================

export const petsAPI = {

getAll: async () => {

return apiCall('/api/pets', { method: 'GET' });

48
},

getById: async (id: string) => {

return apiCall(`/api/pets/${id}`, { method: 'GET' });

},

create: async (petData: any) => {

return apiCall('/api/pets', {

method: 'POST',

body: [Link](petData),

});

},

update: async (id: string, petData: any) => {

return apiCall(`/api/pets/${id}`, {

method: 'PUT',

body: [Link](petData),

});

},

delete: async (id: string) => {

49
return apiCall(`/api/pets/${id}`, { method: 'DELETE' });

},

};

// ============================

// ADOPTION API

// ============================

export const adoptionAPI = {

create: async (adoptionData: {

petId: string;

userName: string;

userEmail: string;

message: string;

status?: string;

}) => {

return apiCall('/api/adoption/request', {

method: 'POST',

body: [Link]({

...adoptionData,

status: [Link] || 'Pending',

}),

50
});

},

getAll: async () => {

return apiCall('/api/adoption', { method: 'GET' });

},

updateStatus: async (id: string, status: 'Approved' | 'Rejected' | 'Pending') => {

return apiCall(`/api/adoption/${id}/status`, {

method: 'PUT',

body: [Link]({ status }),

});

},

};

// ============================

// ORDERS API

// ============================

export const ordersAPI = {

create: async (orderData: any) => {

return apiCall('/api/orders', {

51
method: 'POST',

body: [Link](orderData),

});

},

getAll: async () => {

return apiCall('/api/orders', { method: 'GET' });

},

};

// ============================

// PRODUCTS API

// ============================

export const productsAPI = {

getAll: async () => apiCall('/api/products', { method: 'GET' }),

getById: async (id: string) => apiCall(`/api/products/${id}`, { method: 'GET' }),

create: async (data: any) => apiCall('/api/products', {

method: 'POST',

body: [Link](data)

})

update: async (id: string, data: any) => apiCall(`/api/products/${id}`, {

52
method: 'PUT',

body: [Link](data)

})

delete: async (id: string) => apiCall(`/api/products/${id}`, {

method: 'DELETE'

}),

};

};

53

Common questions

Powered by AI

PawAdopt aims to create social impact by promoting responsible pet ownership and reducing animal homelessness through raising awareness about adoption. Educationally, it serves as a demonstration project for full-stack development, showcasing how separate technical components can create a cohesive solution. The platform's functionalities, such as the digital adoption process, real-time browsing, and e-commerce module, reflect these objectives by enabling efficient adoption cycles and offering practical development experiences for technology students. The project aligns technological advances with ethical values, thus promoting both community welfare and academic learning .

PawAdopt's system architecture embodies modularity through the separation of frontend, backend, and database layers, each handling specific tasks: the frontend manages user interactions, the backend handles business logic and data transactions, and the database ensures persistence. This division allows for easy updates and maintenance of individual components without affecting others. Using standardized frameworks like React and Spring Boot ensures adherence to software engineering principles, facilitating reusability and maintainability, thus enhancing flexibility for future system enhancements .

The backend architecture of PawAdopt adheres to RESTful principles, which ensure scalability and interoperability by enabling the system to handle increasing loads and interact seamlessly with other software systems. This RESTful design allows the backend to manage business logic, authenticate and authorize users, and handle data exchanges efficiently, even as new modules or services are integrated in the future. These aspects are significant as they ensure the system can evolve without disrupting existing functionalities, facilitating the development of additional features like mobile apps or IoT integrations .

PawAdopt's use of PostgreSQL supports optimized data management by ensuring data integrity, normalization, and security, which are crucial for handling sensitive information (e.g., user details, transaction histories). Additionally, PostgreSQL's ability to efficiently query multiple interconnected entities such as pets, users, and adoption requests enables administrators to generate insights and reports easily, such as adoption trends. This structured data management approach also supports the platform's scalability and integration with new services or modules .

Potential future enhancements for PawAdopt include integrating machine learning for pet matching, implementing chatbots for real-time adoption assistance, and expanding to mobile applications. These enhancements are expected to significantly impact the platform's functionality by providing personalized user experiences and increasing user engagement. Machine learning could offer tailored pet recommendations based on user preferences, while chatbots could improve user interaction efficiency. A mobile app expansion would broaden accessibility, allowing more potential adopters to engage with the platform, thus strengthening the platform's impact on animal welfare and community involvement .

The frontend design of PawAdopt, built using React and styled with Tailwind CSS, enhances user experience by ensuring the application's responsiveness and accessibility across various devices and browsers. The use of responsive styling allows consistent user interactions on desktops, tablets, and mobile devices without performance degradation. Additionally, the clarity and ease of navigation in design components help users interact intuitively with the platform's features, such as exploring pets and submitting adoption requests, thereby creating a seamless user experience .

PawAdopt implements real-world DevOps practices, such as continuous integration (CI) and continuous deployment (CD), which contribute to its reliability and scalability. By hosting its frontend on Vercel for continuous deployment and its backend on Render for reliable API availability, the platform ensures that updates and new features can be rolled out smoothly without disruptions. Additionally, using environment variable management enhances secure configurations, and code versioning allows precise control over application changes, thereby maintaining system reliability and facilitating scalable deployments .

Testing and validation processes play a crucial role in ensuring the functionality and reliability of PawAdopt's modules. By conducting unit tests and manual test cases, the developers confirm that API endpoints respond accurately, and data transactions maintain consistency. These processes validate form inputs and ensure seamless integration across different modules, such as payments and usability on multiple devices. Therefore, systematic testing underpins the platform's reliability by preemptively identifying and solving potential issues, thus enhancing its deployment readiness and user satisfaction .

The integration of Razorpay enhances PawAdopt's security by enabling safe and reliable conversion of user's money into tangible goods or donations through a secure payment gateway. This API allows seamless payment processing for e-commerce transactions, thereby improving the overall user experience by offering a straightforward and secure method for financial transactions, thus aligning the platform with e-commerce functionalities while maintaining high security standards .

The role-based authentication system in PawAdopt separates users into regular users and administrators, which enhances security by ensuring that only authorized personnel can perform critical administrative functions, such as adding or modifying pet and product data. This separation prevents unauthorized modifications and maintains data integrity. Functionally, it supports smooth workflows, as regular users have access to standard features like viewing pets and submitting adoption requests, while administrators have increased capabilities for managing the platform effectively .

You might also like