Trading Application
Trading Application
Submitted for fulfillment of the requirement of the Main Project (4MCA1) for
Submitted by
Rakesh S (P18IW22S126017)
Name of Guide
Dr. Benita Jaison
CERTIFICATE
This is to certify that the report entitled “Bit Coin Trading Application” embodies the original
work by Rakesh S (P18IW22S126017) for the fulfilment of the requirements of Main Project
(4MCA1) for MCA, IVth Semester course during the academic semester from August 2024
to December 2024 as prescribed by Bengaluru City University.
Place:
Date:
CERTIFICATE
This is to certify that the report entitled “Bit Coin Trading Application” embodies the original
work by Rakesh S (P18IW22S126017) for the fulfilment of the requirements of Main Project
(4MCA1) for MCA, IVth Semester course during the academic semester from August 2024 to
December 2024 as prescribed by Bengaluru City University.
External Examiner
1.______________________________
2.______________________________
Place:
Date:
Acknowledgement
I thank all the staff members of the Department of Master of Computer Applications, for
extending their constant support to complete the project. I express my heartfelt thanks to my
parents and friends who were a constant source of support and inspiration throughout the
project.
Table of Contents
1. ABSTRACT ...................................................................................................................... 1
2. INTRODUCTION............................................................................................................ 2
6. CONCLUSION .............................................................................................................. 68
8. REFERENCES............................................................................................................... 70
1. Abstract
The project aims to develop a compressive crypto trading platform utilizing a java full-stack
approach. The platform will integrate various advanced features, including an AI chat boot for
handling crypto-related queries, a seamless buy and sell interface for multiple crypto
currencies, and robust portfolio management tools. Additionally, the project will enhance
wallet functionality with secure wallet-to-wallet transfer, withdrawals to bank accounts, and
balanced top-ups. The platform will also provide detailed transaction history and powerful
search capabilities for crypto currencies. Ensuring top-notch security, the platform will
incorporate robust authentication mechanisms, including two-factor authentication. The
platform will leverage modern technologies such as Spring Boot, React, MySQL, and various
APIs to deliver a high-performance, secure and scalable solution.
Security is paramount in the design of this platform. It will incorporate strong authentication
mechanisms, including two-factor authentication and secure login and registration processes,
to protect user accounts. The technology stack for this platform includes Spring Boot for the
backend, MySQL for the database, and React with Tailwind CSS for the frontend, ensuring a
high-performance, secure, and scalable solution.
The integration of payment gateways such as Razor pay and Stripe will facilitate smooth
financial transactions, making it easier for users to manage their funds. By combining these
features, the platform aims to provide a comprehensive solution that addresses the needs of
modern crypto traders and investors, enhancing their ability to trade efficiently and securely in
the evolving crypto-currency market.
2. Introduction
This project is a robust cryptocurrency platform designed to offer users an efficient and
seamless experience for managing and trading digital assets. The platform incorporates an AI
chatbot, utilizing the Gemini and CoinGecko APIs to provide real-time responses to
cryptocurrency-related queries such as market values and trends, helping users make informed
decisions. Additionally, it features an intuitive buy and sell interface that supports a wide range
of cryptocurrencies, enabling smooth transactions.
A major focus of the platform is portfolio management, allowing users to monitor their
investments, track performance, and make data-driven decisions about their holdings. The
wallet functionality is designed to be comprehensive, offering secure wallet-to-wallet transfers,
the ability to add funds, and options for withdrawing to bank accounts.
The platform also provides a detailed transaction history, allowing users to view and track both
withdrawal and wallet activities. A powerful search feature helps users find essential
information on any cryptocurrency, streamlining the trading process. Security is paramount,
with features such as secure login and registration, two-factor authentication (2FA), and an
easy-to-use password recovery process, ensuring that user accounts are well protected.
Built using cutting-edge technology, the backend is powered by Spring Boot, with MySQL DB
for data storage, Spring Security for robust protection, and Java Mail Sender for
communication services. On the frontend, React, Tailwind CSS, Redux, Axios, React-Router-
Dom, and Shadcn UI work together to create a responsive, dynamic, and user-friendly
interface. The integration of payment gateways like Razorpay and Stripe ensures that all
transactions are secure and reliable. Overall, this platform combines performance, security, and
functionality, offering a complete solution for cryptocurrency traders and investors.
2.1 Objectives
• Implement robust security measures like two-factor authentication and secure login
processes to protect user accounts.
• Ensure safe user data handling and secure transactions using Spring Security and
encrypted communications.
• Provide tools for users to monitor their crypto portfolios, track performance, and
make informed investment decisions.
• Allow users to view their portfolio's value over time and receive notifications about
significant changes in value.
• Use Spring Boot and MySQL DB to build a scalable backend capable of handling
a growing number of users and transactions.
• Develop a responsive and visually appealing frontend using React, Tailwind CSS,
and Redux for optimal user interaction.
These objectives aim to create a secure, user-friendly, and efficient platform that enhances user
experience while fostering continuous growth in the cryptocurrency space.
• Real-time Crypto Data: Using Gemini and CoinGecko APIs ensures users have
up-to-date market information for informed trading decisions.
• Enhanced User Engagement: Provides instant responses to queries, improving
user experience and reducing reliance on customer support.
3. Portfolio Management:
5. Transaction History:
• Detailed Logs: Users can access past transaction data, which is critical for personal
audits and tax reporting.
• Transparency: Improves trust by offering a clear record of all financial activity.
• Scalability: Spring Boot, MySQL, and React ensure the system can handle
increasing traffic and data loads efficiently.
• Security: Spring Security and Java Mail Sender provide enhanced user data
protection and secure communications.
• Modern Frontend: Technologies like Tailwind CSS and Redux ensure responsive,
efficient, and visually appealing interfaces, enhancing the overall user experience.
8. Payment Gateways:
Overall, the platform is designed for high performance, security, user engagement, and
scalability, offering a competitive edge in the cryptocurrency market.
The Java Full Stack with a front-end using React.js and a backend built with Spring Boot
and MySQL is a powerful web development stack. Each component in this stack has its own
system requirements. Here are the typical system requirements for each part of this stack:
MySQL Client-Server:
• Operating Systems: MySQL can run on Windows, macOS, Linux, and other Unix-
based systems.
Spring Boot:
• For optimal performance, ensure adequate CPU and memory for high-traffic
applications.
Spring Security:
• Spring Security provides security features for Java applications.As it’s part of the
Spring framework, the requirements are similar to Spring Boot.
• No additional system requirements beyond the web application server (Tomcat, Jetty,
etc.).
• System requirements are tied to the Java runtime environment and Spring Boot, as it is
an embedded feature.
• Network: Requires an email server (SMTP) for sending emails; you need a stable
internet connection to communicate with the mail server.
React:
• The system requirements depend on the browsers and devices you intend to support.
• Node.js Required: React apps are typically built using Node.js, which requires:
Tailwind CSS:
• It’s processed via Node.js in development mode, so system requirements are similar to
React/Node.js environments.
• Memory and Disk Space: Minimal; additional space may be required for Tailwind’s
build tools.
Shadcn UI:
• System requirements align with the React setup since it is tightly integrated.
3.1 DFD
A data flow diagram (DFD) maps out the flow of information for any process or system. It
uses defined symbols like rectangles, circles and arrows, plus short text labels, to show data
inputs, outputs, storage points and the routes between each destination. Data flowcharts can
range from simple, even hand-drawn process overviews, to in-depth, multi-level DFDs that dig
progressively deeper into how the data is handled. They can be used to analyze an existing
system or model a new one. Like all the best diagrams and charts, a DFD can often visually
say things that would be hard to explain in words, and they work for both technical and
nontechnical audiences, from developer to CEO. That’s why DFDs remain so popular after all
these years. While they work well for data flow software and systems, they are less applicable
nowadays to visualizing interactive, real-time or database-oriented software or systems.
One main difference in their symbols is that Yourdon-Coad and Yourdon-DeMarco use circles
for processes, while Gane and Sarson use rectangles with rounded corners, sometimes called
lozenges. There are other symbol variations in use as well, so the important thing to keep in
mind is to be clear and consistent in the shapes and notations you use to communicate and
collaborate with others.
Using any convention’s DFD rules or guidelines, the symbols depict the four components of
data flow diagrams.
1. External entity: an outside system that sends or receives data, communicating with
the system being diagrammed. They are the sources and destinations of information entering
or leaving the system. They might be an outside organization or person, a computer system
or a business system. They are also known as terminators, sources and sinks or actors. They
are typically drawn on the edges of the diagram.
2. Process: any process that changes the data, producing an output. It might perform
computations, or sort data based on logic, or direct the data flow based on business
rules. A short label is used to describe the process, such as “Submit payment.”
3. Data store: files or repositories that hold information for later use, such as a database
table or a membership form. Each data store receives a simple label, such as
“Orders.”
4. Data flow: the route that data takes between the external entities, processes and data
stores. It portrays the interface between the other components and is shown with
arrows, typically labelled with a short data name, like “Billing details.”
When a process is exploded into lower level details, they are numbered.
DFD Level 1
DFD Level 2
3.2 ER diagram
ER Diagram stands for Entity Relationship Diagram, also known as ERD is a diagram that
displays the relationship of entity sets stored in a database. In other words, ER diagrams help
to explain the logical structure of databases. ER diagrams are created based on three basic
concepts: entities, attributes and relationships.
ER Diagrams contain different symbols that use rectangles to represent entities, ovals to define
attributes and diamond shapes to represent relationships.
Hardware Requirements:
Software Requirements:
The design phase is the life cycle phase in which the detailed design of the selected system in
the study phase is accomplished. In the design phase, the technical specifications are prepared
for the performance of all allocated tasks. It also includes the construction of programs and
program testing. In the design phase, the first step is to determine the output is to be produced
and in what format. Second, input data and master files have to be designed to meet the
requirements of proposed output. The system analyst has to define the methods of capturing
and input programs and format of the output and its use by the users.
System design is the process of designing the elements of a system such as the architecture,
modules and components, the different interfaces of those components and the data that goes
through that system. The purpose of the System Design process is to provide sufficient detailed
data and information about the system and its system elements to enable the implementation
consistent with architectural entities as defined in models and views of the system architecture.
The design is a solution, the translation of requirements into centre ways of meeting. The design
is actually the process of organizing and developing a database model that accurately reflects
the organization functioning in the real world and implementing that model by creating a
database requires an appropriate methodology. System can be divided into two phases:
1. Logical Design.
2. Physical Design.
• Architecture:
This is the conceptual model that defines the structure, behaviour and more views of a system.
We can use flowcharts to represent and illustrate the architecture.
• Modules:
This are components that handle one specific tasks in a system. A combination of the modules
make up the system.
• Components :
This provides a particular function or group of related functions. They are made up of modules.
• Interfaces:
This is the shared boundary across which the components of the system exchange information
and relate.
• Data :
This the management of the information and data flow.
The class diagram centers around the User class, which manages user data and links to Wallet,
Portfolio, and TransactionHistory. The Wallet class tracks balances and enables functions
like addBalance(), withdrawToBank(), walletToWalletTransfer(). TransactionHistory
records all wallet transactions, connecting with BankAccount for tracking withdrawals.
Portfolio manages the user’s cryptocurrency assets, allowing for addAsset(), removeAsset(),
and calculateTotalValue() methods, with each asset represented by the CryptoAsset class.
MarketDataAPI fetches real-time prices from Gemini and CoinGecko. The Authentication
class secures the platform through login, registration, and two-factor authentication, while
Trade handles buy/sell operations and updates Portfolio holdings. Finally, Notification alerts
users to events like trades and logins, adding security and engagement features.
In the sequence diagram, the User initiates interactions by logging into the platform, where the
Authentication class verifies credentials and implements two-factor authentication if needed.
Upon successful login, the user can perform wallet operations via the Wallet class, such as
adding funds or transferring between wallets, which updates TransactionHistory. For crypto
trading, the User requests a buy or sell action, triggering the Trade class to execute the
transaction, update the Portfolio, and record the transaction in TransactionHistory. The
Portfolio class, in turn, fetches current asset prices from MarketDataAPI using external
sources like Gemini and CoinGecko to keep data up-to-date. After each transaction,
Notification sends an alert confirming the completed action. If the user withdraws funds to a
bank, the BankAccount class processes the transfer and updates TransactionHistory
accordingly.
In the use case for this cryptocurrency platform, a User starts by registering or logging in,
where Authentication verifies credentials and enables two-factor authentication for security.
Once logged in, the User can view and manage their Wallet to add funds, transfer between
wallets, or withdraw to a BankAccount. For trading, the User accesses the Trade interface to
buy or sell cryptocurrencies, which updates the Portfolio and logs the action in
TransactionHistory. Portfolio enables the user to monitor and track investments, with real-
time prices fetched from MarketDataAPI via Gemini and CoinGecko APIs. Users can search
for any cryptocurrency, obtaining essential trading information. After every trade, withdrawal,
or login event, the Notification system sends alerts, ensuring the user stays informed.
The database design for this cryptocurrency platform centers around key entities like User,
Wallet, TransactionHistory, Portfolio, CryptoAsset, and BankAccount, with relationships
mapped to support data flow and operations. The User table holds essential user information
and authentication data, linking to the Wallet table for storing balances and transaction
histories. TransactionHistory records every transaction, connecting to BankAccount for
withdrawal details. The Portfolio table organizes crypto assets, tracking each asset’s quantity
and current value through the CryptoAsset table, which is regularly updated with real-time
prices from MarketDataAPI. Each table and relationship are designed for efficiency, enabling
secure and responsive data management across the platform.
➢ Users Table
• id (Primary Key)
• fullName
• email
• mobile
• password
• status
• isVerified
• twoFactorAuth_enabled
• twoFactorAuth_sendTo
• picture
• role
➢ Coins Table
• id (Primary Key)
• symbol
• name
• image
• current_price
• market_cap
• market_cap_rank
• fully_diluted_valuation
• total_volume
• high_24h
• low_24h
• price_change_24h
• price_change_percentage_24h
• market_cap_change_24h
• market_cap_change_percentage_24h
• circulating_supply
• total_supply
• max_supply
• ath
• ath_change_percentage
• ath_date
• atl
• atl_change_percentage
• atl_date
• roi
• last_updated
➢ Assets Table
• id (Primary Key)
• quantity
• buy_price
• coin_id (Foreign Key referencing Coins)
• user_id (Foreign Key referencing Users)
➢ Withdrawals Table
• id (Primary Key)
• status
• amount
• user_id (Foreign Key referencing Users)
• date
➢ Watchlists Table
• id (Primary Key)
• user_id (Foreign Key referencing Users)
➢ WalletTransactions Table
• id (Primary Key)
• wallet_id (Foreign Key referencing Wallets)
• type
• date
• transfer_id
• purpose
• amount
➢ Wallets Table
• id (Primary Key)
• user_id (Foreign Key referencing Users)
• balance
➢ VerificationCodes Table
• id (Primary Key)
• otp
• user_id (Foreign Key referencing Users)
• email
• mobile
• verification_type
➢ TradingHistories Table
• id (Primary Key)
• selling_price
• buying_price
• coin_id (Foreign Key referencing Coins)
• user_id (Foreign Key referencing Users)
➢ PaymentOrders Table
• id (Primary Key)
• amount
• status
• payment_method
• user_id (Foreign Key referencing Users)
➢ PaymentDetails Table
• id (Primary Key)
• account_number
• account_holder_name
• ifsc
• bank_name
• user_id (Foreign Key referencing Users)
➢ Orders Table
• id (Primary Key)
• user_id (Foreign Key referencing Users)
• order_type
• price
• timestamp
• status
• order_item_id (Foreign Key referencing OrderItems)
➢ OrderItems Table
• id (Primary Key)
• quantity
• coin_id (Foreign Key referencing Coins)
• buy_price
• sell_price
• order_id (Foreign Key referencing Orders)
➢ Notifications Table
• id (Primary Key)
• from_user_id (Foreign Key referencing Users)
• to_user_id (Foreign Key referencing Users)
• amount
• message
➢ MarketChartData Table
• id (Primary Key)
• timestamp
• price
➢ ForgotPasswordTokens Table
• id (Primary Key)
• user_id (Foreign Key referencing Users)
• otp
• verification_type
• send_to
The login page allows users to securely access their accounts by entering their registered email
and password. It features a "Forgot Password" link for account recovery and incorporates two-
factor authentication (2FA) to add an extra layer of security, ensuring that only authorized users
can access sensitive information.
➢ Home Page
Serving as the platform's main dashboard, the home page provides a comprehensive overview
of the user's account, showcasing current cryptocurrency market trends, portfolio performance
metrics, and quick links to essential functionalities such as trading and wallet management. It
also highlights alerts or notifications related to user activity.
➢ Portfolio Details
This section presents an in-depth view of the user's cryptocurrency holdings, including detailed
information about each asset such as current market value, quantity owned, and overall profit
or loss. Users can track their investments' performance over time and view historical data for
informed decision-making.
➢ Watch List
The watch list feature allows users to curate a selection of cryptocurrencies they wish to
monitor closely. It displays real-time price changes, percentage fluctuations, and market trends
for each asset, enabling users to make timely investment decisions based on market
movements.
➢ Trading History
This feature provides a comprehensive record of all completed transactions, detailing each
trade's date, type (buy or sell), quantity, price at execution, and overall profit or loss. Users can
analyze their trading patterns and strategies by reviewing historical performance.
➢ Buy or Sell
The trading interface allows users to execute cryptocurrency trades with ease. Users can select
the asset they wish to buy or sell, specify the quantity, and view the current market price. The
platform provides real-time updates and trade confirmations to ensure a smooth transaction
process.
➢ Wallet Details
This section offers a complete overview of the user's digital wallet, including current balances
for various cryptocurrencies, transaction history, and options to add funds or withdraw to a
linked bank account. It ensures users can manage their assets efficiently and securely.
Payment Details
➢ Users can manage their payment methods within this feature, including linking bank
accounts, credit cards, and other payment options. The section displays transaction
records related to deposits, withdrawals, and trading activities, providing users with a
clear financial overview.
➢ Profile Details
This area allows users to manage their personal information, such as contact details and
account settings. Users can update their profiles, change passwords, and configure security
settings to enhance account safety and personalization.
To bolster security, this feature requires users to complete an additional verification step
during login or when performing sensitive actions, such as withdrawals or account changes.
Users can choose between various verification methods, such as SMS codes or
authentication apps.
➢ Ai Chat Bot
The AI chat bot serves as a virtual assistant, providing users with real-time support for
cryptocurrency-related inquiries, including current market prices, trading tips, and platform
navigation. It uses natural language processing to understand user questions and deliver
accurate, informative responses, enhancing the overall user experience.
5. Coding / Testing
Login Page:
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="password" // Added password field
render={({ field }) => (
<FormItem>
<FormControl>
<Input
{...field}
type="password" // Added type attribute for password input
className="border w-full border-gray-700 py-5 px-5"
placeholder="Enter your password"
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
{!auth.loading ? (
<Button type="submit" className="w-full py-5">
Login
</Button>
):(
<SpinnerBackdrop show={true} />
)}
</form>
</Form>
</div>
);
};
Register Page:
});
const SignupForm = () => {
const {auth}=useSelector(store=>store)
const navigate=useNavigate();
const dispatch=useDispatch()
const form = useForm({
resolver: zodResolver(formSchema),
defaultValues: {
email: "",
password: "",
fullName: "",
},
});
const onSubmit = (data) => {
data.navigate=navigate
dispatch(register(data))
console.log("signup form", data);
};
return (
<div className="space-y-5">
<h1 className="text-center text-xl">Create New Account</h1>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
<FormField
control={form.control}
name="fullName"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
{...field}
type="text"
className="border w-full border-gray-700 py-5 px-5"
placeholder="Enter your full name"
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="email"
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="password"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
{...field}
type="password"
className="border w-full border-gray-700 py-5 px-5"
placeholder="Enter your password"
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
{!auth.loading? <Button type="submit" className="w-full py-5">
Register
</Button>:<SpinnerBackdrop show={true}/>}
</form>
</Form>
</div>
);
};
import
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
import { invoices } from "../Home/AssetTable";
import { ScrollArea } from "@/components/ui/scroll-area";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Button } from "@/components/ui/button";
import { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { getUserAssets } from "@/Redux/Assets/Action";
import { Avatar, AvatarImage } from "@/components/ui/avatar";
import { getAllOrdersForUser } from "@/Redux/Order/Action";
import { calculateProfite } from "@/Util/calculateProfite";
import { readableDate } from "@/Util/readableDate";
import { Input } from "@/components/ui/input";
import { SearchIcon } from "lucide-react";
import { searchCoin } from "@/Redux/Coin/Action";
import { useNavigate } from "react-router-dom";
import SpinnerBackdrop from "@/components/custome/SpinnerBackdrop";
if(coin.loading){
return <SpinnerBackdrop/>
}
return (
<div className="p-10 lg:p=[50%]">
<div className="flex items-center justify-center pb-16">
<Input
className="p-5 w-[90%] lg:w-[50%] rounded-r-none"
placeholder="explore market..."
onChange={(e) => setKeyword(e.target.value)}
/>
<Button onClick={handleSearchCoin} className="p-5 rounded-l-none">
<SearchIcon />
</Button>
</div>
<Table className="px-5 relative">
<TableHeader className="py-9">
<TableRow className="sticky top-0 left-0 right-0 bg-background ">
<TableHead className="py-3">Market Cap Rank</TableHead>
<TableHead>Treading Pair</TableHead>
<TableHead className="text-right">SYMBOL</TableHead>
</TableRow>
</TableHeader>
<TableBody className="">
{coin.searchCoinList?.map((item) => (
<TableRow onClick={()=>navigate(`/market/${item.id}`)} key={item.id}>
<TableCell>
<p className="">
{item.market_cap_rank}
</p>
</TableCell>
<TableCell className="font-medium flex items-center gap-2">
<Avatar className="-z-50">
<AvatarImage
src={item.large}
alt={""}
/>
</Avatar>
<span> {item.name}</span>
</TableCell>
<TableCell className="text-right">${item.symbol}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
);
};
import {
getAllWithdrawalRequest,
getWithdrawalHistory,
proceedWithdrawal,
} from "@/Redux/Withdrawal/Action";
import { readableTimestamp } from "@/Util/readbaleTimestamp";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
import { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
useEffect(() => {
dispatch(getAllWithdrawalRequest(localStorage.getItem("jwt")));
}, []);
return (
<div className="px-20 ">
<h1 className="text-3xl font-bold py-10">All Withdrawal Requests</h1>
<div>
<Table>
<TableHeader>
<TableRow>
<TableHead className="py-5">Date</TableHead>
<TableHead className="py-5">User</TableHead>
<TableHead>Method</TableHead>
<TableHead>Amount</TableHead>
<TableHead className="text-right">Status</TableHead>
<TableHead className="text-right">Procced</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{withdrawal.requests.map((item) => (
<TableRow key={item.id}>
<TableCell className="font-medium py-5">
{readableTimestamp(item?.date)}
</TableCell>
<TableCell>
<p className="font-bold">{item.user.fullName}</p>
<p className="text-gray-300">{item.user.email}</p>
</TableCell>
<TableCell>{"Bank Account"}</TableCell>
<TableCell className="text-green-500">{item.amount} USD</TableCell>
<TableCell className="text-right">
<Badge
className={`text-white ${
item.status == "PENDING"
? "bg-red-500 "
: "bg-green-500"
}
`}
>
{item.status}
</Badge>
</TableCell>
<TableCell className="text-right">
<DropdownMenu>
<DropdownMenuTrigger className=" outline-none ">
<Button variant="outline">PROCCED</Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuItem className="">
<Button
onClick={() => handleProccedWithdrawal(item.id, true)}
className="w-full bg-green-500 text-white hover:text-black"
>
Acceppt
</Button>
</DropdownMenuItem>
<DropdownMenuItem>
<Button
onClick={() =>
handleProccedWithdrawal(item.id, false)
}
className="w-full bg-red-500 text-white hover:text-black"
>
Decline
</Button>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
</div>
);
};
verificationType,
jwt: localStorage.getItem("jwt"),
})
);
};
return (
<div className="flex justify-center">
<div className="space-y-5 mt-10 w-full">
<div className="flex justify-between items-center">
<p className="">Email :</p>
<p>{auth.user?.email}</p>
<Dialog>
<DialogTrigger>
<Button
onClick={() => handleSendOtp("EMAIL")}
>
Sent OTP
</Button>
</DialogTrigger>
<DialogContent className="">
<DialogHeader className="">
<DialogTitle className="px-10 pt-5 text-center">
Enter OTP
</DialogTitle>
</DialogHeader>
<div className="py-5 flex gap-10 justify-center items-center">
<InputOTP
value={value}
onChange={(value) => setValue(value)}
maxLength={6}
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
</div>
</DialogContent>
</Dialog>
</div>
{/* <div className="flex justify-between items-center">
<p className="">Mobile :</p>
<p>+918987667899</p>
Trading Page:
return volume.toFixed(decimalPlaces);
}
useEffect(()=>{
dispatch(getAssetDetails({coinId:coin.coinDetails.id,jwt:localStorage.getItem("jwt")}))
},[])
return (
<div className="space-y-10 p-5">
<div>
<div className=" flex gap-4 items-center justify-between">
<Input
className="py-7 focus:outline-none "
placeholder="enter amount..."
onChange={handleOnChange}
type="number"
/>
<div>
<p className="border text-2xl flex justify-center items-center w-36 h-14 rounded-
md">
{quantity}
</p>
</div>
</div>
{orderType == "SELL"?
(asset.assetDetails?.quantity * coin.coinDetails?.current_price <
amount) && (
<h1 className="text-red-800 text-center pt-4">
Insufficient quantity to sell
</h1>
):(quantity * coin.coinDetails?.market_data.current_price.usd >
wallet.userWallet?.balance) && (
<h1 className="text-red-800 text-center pt-4">
Insufficient Wallet Balance To Buy
</h1>
)}
</div>
<Button
onClick={handleBuyCrypto}
className={`w-full py-6 ${
orderType == "SELL" ? "bg-red-600 text-white" : ""
}`}
disabled={
quantity==0 ||
(orderType == "SELL" && !asset.assetDetails?.quantity) ||
(orderType == "SELL" ?
(asset.assetDetails?.quantity * coin.coinDetails?.market_data.current_price.usd <
amount):quantity * coin.coinDetails?.market_data.current_price.usd >
wallet.userWallet?.balance)
}
>
{orderType}
</Button>
</DialogClose>
<Button
onClick={() => setOrderType(orderType == "BUY" ? "SELL" : "BUY")}
className="w-full mt-5 text-xl"
variant="link"
>
{orderType == "BUY" ? "Or Sell" : "Or Buy"}
</Button>
</div>
</div>
);
};
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import PaymentDetailsForm from "./PaymentDetailsForm";
import { useDispatch, useSelector } from "react-redux";
import { useEffect } from "react";
import { getPaymentDetails } from "@/Redux/Withdrawal/Action";
import { maskAccountNumber } from "@/Util/maskAccountNumber";
useEffect(() => {
dispatch(getPaymentDetails({ jwt: localStorage.getItem("jwt") }));
}, []);
return (
<div className="px-20 ">
<h1 className="text-3xl font-bold py-10">Payment Details</h1>
{withdrawal.paymentDetails ? (
<Card className="mb-10">
<CardHeader>
<CardTitle>
{withdrawal.paymentDetails?.bankName.toUpperCase()}
</CardTitle>
<CardDescription>
A/C No:{" "}
{maskAccountNumber(withdrawal.paymentDetails?.accountNumber)}
</CardDescription>
</CardHeader>
<CardContent>
<div className="flex items-center">
<p className="w-32">A/C Holder</p>
<p className="text-gray-400">
: {withdrawal.paymentDetails.accountHolderName}
</p>
</div>
<div className="flex items-center">
<p className="w-32">IFSC</p>
<p className="text-gray-400">
: {withdrawal.paymentDetails.ifsc.toUpperCase()}
</p>
</div>
</CardContent>
</Card>
):(
<Dialog>
<DialogTrigger>
<Button className="py-6">Add Payment Details</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader className="pb-5">
<DialogTitle>Payment Details</DialogTitle>
</DialogHeader>
<PaymentDetailsForm />
</DialogContent>
</Dialog>
)}
</div>
);
};
<div>
<h1 className="pb-1">Purpose</h1>
<Input
name="purpose"
onChange={handleChange}
value={formData.purpose}
className="py-7"
placeholder="gift for your friend..."
/>
</div>
<DialogClose>
<Button
onClick={handleSubmit}
variant=""
className="w-full p-7 text-xl"
>
Send
</Button>
</DialogClose>
</div>
);
};
Withdrawl Page:
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
import { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
useEffect(() => {
dispatch(getWithdrawalHistory(localStorage.getItem("jwt")));
}, []);
return (
<div className="px-20 ">
<h1 className="text-3xl font-bold py-10">Withdrawal</h1>
<div>
<Table>
<TableHeader>
<TableRow>
<TableHead className="py-5">Date</TableHead>
<TableHead>Method</TableHead>
<TableHead>Amount</TableHead>
<TableHead className="text-right">Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{withdrawal.history.map((item) => (
<TableRow key={item.id}>
<TableCell className="font-medium py-5">
{readableTimestamp(item?.date)}
</TableCell>
<TableCell>{"Bank Account"}</TableCell>
<TableCell>₹{item.amount}</TableCell>
<TableCell className="text-right">
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
</div>
);
};
Watchlist Page:
useEffect(() => {
dispatch(getUserWatchlist());
}, [page]);
const handleAddToWatchlist=(id)=>{
dispatch(addItemToWatchlist(id))
}
return (
<div className="pt-8 lg:px-10">
<div className="flex items-center pt-5 pb-10 gap-5">
<BookmarkFilledIcon className="h-10 w-10"/>
<h1 className=" text-4xl font-semibold">Watchlist</h1>
</div>
<TableCell>{item.total_volume}</TableCell>
<TableCell>{item.market_cap}</TableCell>
<TableCell
className={`${
item.market_cap_change_percentage_24h < 0
? "text-red-600"
: "text-green-600"
}`}
>
{item.market_cap_change_percentage_24h}%
</TableCell>
<TableCell>{item.current_price}</TableCell>
<TableCell className="text-right">
<Button onClick={()=>handleAddToWatchlist(item.id)} className="h-10 w-10"
variant="outline" size="icon">
<BookmarkFilledIcon className="h-6 w-6" />
</Button>
</TableCell>
</TableRow>
))}
</TableBody>
</ScrollArea>
</Table>
</div>
);
};
Description: This module handles user registration, login, and security through two-factor
authentication (2FA). It ensures that only authorized users can access the platform and perform
transactions.
Algorithm:
1. Registration Algorithm:
o Input: User details (name, email, password)
o Validate input for completeness and format.
o Hash the password for security.
o Store user details in the database.
o Send a verification email to the user.
o Wait for email verification confirmation.
o Activate the user account.
2. Login Algorithm:
o Input: Email and password.
o Retrieve user data from the database using the email.
o Compare the hashed password with the stored hash.
o If valid, generate and send a 2FA code to the registered device.
o Input the received 2FA code and verify it.
o If successful, grant access; otherwise, show an error message.
Description: This module allows users to view and manage their cryptocurrency holdings,
providing insights into their investments' performance.
Algorithm:
Description: This module facilitates buying and selling cryptocurrencies, ensuring secure
and efficient transaction processing.
Algorithm:
Description: This module manages users' digital wallets, allowing them to view balances,
transfer funds, and withdraw to bank accounts.
Algorithm:
Description: This module manages user notifications related to account activities, trades, and
market alerts.
Algorithm:
Description: This module provides users with an AI-powered chat interface for real-time
assistance regarding platform features and cryptocurrency data.
Algorithm:
Preparation:
Execution:
Check:
Preparation:
Execution:
Check:
Preparation:
Execution:
Check:
Preparation:
Execution:
Check:
• Users must be able to add or remove cryptocurrencies from the watch list.
• Real-time price updates must be reflected in the watch list.
Preparation:
Execution:
Check:
Preparation:
Execution:
Check:
Preparation:
Execution:
Check:
• The wallet details page must show current balances and transaction history.
• Users should be able to add funds or withdraw easily.
Preparation:
Execution:
Check:
Preparation:
Execution:
Check:
• The AI chat bot must respond to user queries regarding market data and platform
navigation.
• Responses should be accurate and relevant.
Preparation:
Execution:
Check:
System Testing
System testing in the BitFlow Trading Application ensures that the entire application
functions as a complete, integrated system and meets the specified requirements. This phase
validates the application's functionality, security, performance, compatibility, and user
acceptance to ensure it performs as expected in a real-world environment.
Functionality Testing:
• Trading Process: Test the complete trading flow, including account setup,
deposit/withdrawal, portfolio management (buy/sell orders), and transaction history.
• Wallet Management: Validate wallet functionalities, including funds transfer, balance
inquiry, and transaction records.
• Order Placement: Test order placement, order status updates, and ensuring orders
reflect accurately in the user’s portfolio.
• Verification and Notifications: Verify OTP generation for secure user actions, and
test notifications for updates or alerts, ensuring timely and correct delivery.
• Admin Controls: Test the admin’s ability to access all wallet details, accept or decline
payment requests, and perform other management actions.
Security Testing:
• Data Security: Ensure that user data, especially wallet and transaction information, is
stored and transmitted securely to prevent unauthorized access.
• Authorization and Authentication: Test user roles and permissions, ensuring only
admins have access to certain data and actions.
• Vulnerability Testing: Check for common vulnerabilities, such as SQL injection and
cross-site scripting, to prevent potential security threats.
• OTP and Verification Codes: Validate the secure generation and storage of OTPs and
verification codes to prevent misuse or unauthorized access.
Performance Testing:
• Load Testing: Assess application performance under varying levels of user load,
especially during peak trading times, to ensure smooth operation.
• Response Times: Monitor the system's response time for critical actions like order
placements, wallet transactions, and market data refreshes to ensure acceptable latency.
• Resource Utilization: Analyze server and database performance to detect bottlenecks
and ensure efficient resource usage under heavy load conditions.
Compatibility Testing:
Documentation Review:
• User Manuals and Guides: Review documentation to ensure all user-facing functions,
such as trading, order placements, and wallet operations, are clearly explained.
• Admin Documentation: Verify that admin tasks, including fund approvals, payment
controls, and wallet oversight, are documented for ease of understanding.
6. Conclusion
The Bitcoin trading application project successfully delivers a secure, user-friendly, and
feature-rich platform that makes cryptocurrency trading accessible to a wide range of users. By
combining essential tools for real-time market analysis, portfolio management, and secure
wallet integration, the application empowers users to make informed trading decisions and
navigate the complexities of digital assets. Its scalability and adaptability provide a foundation
for future growth, allowing for easy integration of new features and enabling the application to
remain competitive in the evolving cryptocurrency landscape. With robust security features
like multi-factor authentication, encryption, and fraud detection, the platform builds user trust
and ensures a safe environment for digital asset management.
Furthermore, the application fosters financial inclusion by lowering the barriers to entry for
new traders, providing a gateway for users to participate in the digital economy. Its design
emphasizes user experience through intuitive interfaces, customizable notifications, and
adaptable settings, which together create a smooth and engaging trading experience. The
platform is also well-positioned for future enhancements, such as AI-driven insights, social
trading, and advanced analytics, all of which can enrich the user experience and make the
platform an invaluable tool for both novice and seasoned traders.
The application also prepares for long-term sustainability by maintaining flexibility for
regulatory compliance, ensuring that it can adapt to changing rules in the cryptocurrency
industry. Ultimately, this Bitcoin trading application is poised to serve as a reliable, scalable,
and user-centric platform that can grow alongside its user base and the dynamic cryptocurrency
market, fostering a secure and community-driven space for digital trading.
7. Future Enhancement
Future enhancements for the Bitcoin trading application include AI-driven trading insights and
automated portfolio rebalancing to optimize trading strategies, as well as advanced security
measures and social trading features to foster a safe and collaborative user environment. These
additions will enhance functionality, user engagement, and adaptability within the evolving
cryptocurrency market.
1. AI-Powered Trading Bot: Integrate an AI-based trading bot that can analyse market
trends and execute trades based on user-defined strategies or automated AI insights.
2. Real-Time News & Sentiment Analysis: Provide real-time news feeds and sentiment
analysis from social media to help users gauge market sentiment and make more
informed trading decisions.
3. Advanced Charting & Technical Analysis Tools: Add comprehensive charting tools
with customizable indicators, enabling users to perform detailed technical analysis
directly within the application.
4. Portfolio Rebalancing and Insights: Include automated portfolio rebalancing features
and predictive insights to help users maintain their preferred asset allocation and
capitalize on market trends.
5. Personalized Alerts & Notifications: Allow users to set alerts for price changes,
market events, and portfolio updates, keeping them informed through SMS, email, or
in-app notifications.
6. Enhanced Security: Implement multi-factor authentication, biometric security, and
fraud detection to ensure a secure trading environment for users.
7. Fractional Trading & Staking Options: Introduce fractional trading to allow users to
buy small portions of high-value assets, along with staking options for earning passive
income.
8. References
Front-End Technologies
1. HTML
o W3C. (2024). HTML5 Specification. World Wide Web Consortium. Available
from: https://www.w3.org/TR/html52/
2. CSS
o W3C. (2024). Cascading Style Sheets (CSS) - A Beginner's Guide. World Wide
Web Consortium. Available from: https://www.w3.org/Style/CSS/
3. React.js
o React Team. (2024). React Documentation. Available from:
https://react.dev/learn
4. Tailwind CSS
o Tailwind Labs. (2024). Tailwind CSS Documentation. Available from:
https://tailwindcss.com/docs
5. Shadcn UI
o Shadcn. (2024). Shadcn UI Documentation. Available from: https://shadcn.dev/
Back-End Technologies
6. Java
o Oracle. (2024). Java SE Documentation. Available from:
https://docs.oracle.com/javase/
7. Spring Boot
o Pivotal Software, Inc. (2024). Spring Boot Documentation. Available from:
https://docs.spring.io/spring-boot/docs/current/reference/html/
8. Spring Security
o Pivotal Software, Inc. (2024). Spring Security Documentation. Available from:
https://docs.spring.io/spring-security/reference/
9. Java Mail Sender
o Oracle. (2024). JavaMail API Documentation. Available from:
https://javaee.github.io/javamail/docs/api/
Database Technologies
10. MySQL
o Oracle Corporation. (2024). MySQL Documentation. Available from:
https://dev.mysql.com/doc/
These references provide comprehensive documentation and insights into the technologies
used in Bit Coin Trading Application project., ensuring that I have reliable sources for each
aspect of the integration.