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

COSMOCONNECT: BRIDGING SALES, ACCOUNTS, AND DATA

MINI PROJECT REPORT


Submitted by

VIGNESHWAR B 20DX22
VISRUTHSARWIN D.K 21DX23
ABISHEKH MAHALINGAM 22XH01
SRIRAM M 22XH09

Under the guidance of


Ms. P. Thilakaveni

In partial fulfillment of the requirement for the award of

DIPLOMA IN COMPUTER ENGINEERING


STATE BOARD OF TECHNICAL EDUCATION
GOVERNMENT OF TAMILNADU

OCTOBER 2023

DEPARTMENT OF COMPUTER ENGINEERING


PSG POLYTECHNIC COLLEGE
(Autonomous and an ISO 9001 certified Institution)
COIMBATORE – 641 004

PSG POLYTECHNIC COLLEGE


PSG POLYTECHNIC COLLEGE
(Autonomous and an ISO 9001 certified Institution)
DEPARTMENT OF COMPUTER ENGINEERING
COIMBATORE – 641 004
CERTIFICATE

VIGNESHWAR B 20DX22
VISRUTHSARWIN D.K 21DX23
ABISHEKH MAHALINGAM 22XH01
SRIRAM M 22XH09

This is to certify that the mini project report entitled


COSMOCONNECT: BRIDGING SALES, ACCOUNTS, AND DATA
has been submitted by
Mr. B VIGNESHWAR
Mr.D.K VISRUTHSARWIN
Mr. ABISHEKH MAHALINGAM
Mr. M SRIRAM

In partial fulfillment for the award of

DIPLOMA IN COMPUTER ENGINEERING


Of the State Board of Technical Education,
Government of Tamil Nadu
During the academic year 2023-2024

Ms. P.Thilakaveni Ms. P. Rajeswari


Faculty guide Head In charge

Certified that the candidate was examined by us in mini project and entrepreneurship
examination held on ………………….

(Internal Examiner)
ACKNOWLEDGEMENT

ACKNOWLEDGEMENT

We express our deep sense of gratitude and sincere thanks to beloved Principal
Dr. B. Giriraj, for keeping interest in this mini project work, which has been an
Inspiration to us.
We are grateful to express our thanks to our Head in-charge Mrs. P. Rajeswari,
Department of Computer Engineering who has been a source of encouragement to do
our mini project successfully.
We wish to express our sincere gratitude and heartfelt thanks to our project guide
Mrs. P. Thilakaveni, lecturer, Department of Computer Engineering who has been a
source of encouragement and moral strength from the beginning to the end for the
success of the project.
We express our heartfelt thanks to our tutor Mrs. R. Uma, for her
encouragement throughout the project. We take this opportunity to thank her support.

i
ABSTRACT

ABSTRACT

In response to the evolving demands of the contemporary business environment,


this project introduces CosmoConnect, a cutting-edge application poised to
revolutionize organizational operations. The primary objective is to seamlessly integrate
core functions such as sales, accounts management, employee oversight, attendance
tracking, data visualization, and decentralized data storage. CosmoConnect leverages
innovative technologies, including the InterPlanetary File System (IPFS), to establish a
robust bridge among these critical business components. Unlike traditional centralized
systems, IPFS distributes files into smaller chunks across a decentralized network,
ensuring enhanced data security and accessibility. The project aims to provide a
comprehensive solution for businesses seeking efficient, interconnected, and secure
management of their essential operations.

ii
TABLE OF CONTENTS

TABLE OF CONTENTS
CHAPTER PAGE NO

ACKNOWLEDGEMENT ................................................................................................ i
ABSTRACT ................................................................................................................... ii
TABLE OF CONTENTS ............................................................................................... iii
LIST OF FIGURES ...................................................................................................... iv
LIST OF TABLES.......................................................................................................... v
INTRODUCTION .......................................................................................................... 1
1.1 OVERVIEW ......................................................................................................... 1
1.2 OBJECTIVES ...................................................................................................... 1
1.3 EXISTING SYSTEM ............................................................................................ 1
1.4 PROPOSED SYSTEM ........................................................................................ 2
1.5 WORKING PRINCIPLE ....................................................................................... 3
LITERATURE SURVEY ................................................................................................ 4
2.1 RELATED WORKS ............................................................................................. 4
2.2 PROPOSED METHODOLOGY ........................................................................... 8
SYSTEM REQUIREMENTS ......................................................................................... 9
3.1 HARDWARE REQUIREMENTS.......................................................................... 9
3.2 SOFTWARE REQUIREMENTS .......................................................................... 9
SYSTEM ANALYSIS AND DESIGN ........................................................................... 14
4.1 FEASIBILITY ANALYSIS .................................................................................. 14
4.2 ACTIVITY DIAGRAM ........................................................................................ 15
4.3 USE CASE DIAGRAM ....................................................................................... 15
PROJECT MODULES ................................................................................................ 17
5.1 ATTENDANCE MODULE .................................................................................. 17
5.2 HOME PAGE..................................................................................................... 19
TESTING AND IMPLEMENTATION ........................................................................... 23
6.1 INTRODUCTION ............................................................................................... 23
6.2 LEVELS OF TESTING ...................................................................................... 23
6.3 SYSTEM VERIFICATION.................................................................................. 26
CONCLUSION ............................................................................................................. vi
BIBLIOGRAPHY ......................................................................................................... vii
APPENDICES .............................................................................................................viii

iii
TABLE OF CONTENTS

LIST OF FIGURES

Fig. No Figure Description Page No


2.1 Biometric traits 5
2.2 Off-chain storage of Ping ER data files 7
2.3 PingER data Merkle tree 8
3.1 React.js 9
3.2 Boostrap 10
3.3 IPFS 10
3.4 Visual studio code 11
3.5 Spring boot 11
3.6 Chart.js 12
3.7 Python 12
3.8 MySQL 13
4.1 Activity Diagram 15
4.2 Use case diagram for cosmoconnect 16
5.1 Face Embedding 17
5.2 Login Interface 18
5.3 New User Registration 18
5.4 Home page 19
5.5 Login page 20
5.6 Dashboard 21
5.7 Contact us page 22
5.8 Data stored in php-mysql database 22
6.1 Levels of testing 24

iv
LIST OF TABLES

LIST OF TABLES

Table. No Table Name Page No


6.1 System validation 26
6.2 System verification 26

v
INTRODUCTION CHAPTER 1

CHAPTER 1

INTRODUCTION
1.1 OVERVIEW
Accounting software is a pivotal tool in modern business, serving to streamline financial
processes, enhance accuracy, and facilitate informed decision-making across various
industries. Its primary function is to automate and manage financial transactions, including
bookkeeping, invoicing, and payroll processing. Industries ranging from small enterprises to
large corporations widely utilize accounting software to maintain organized and accurate
financial records. This software is crucial for generating comprehensive financial reports, such
as income statements and balance sheets, providing valuable insights into a company's
financial health. Additionally, accounting software aids in tax compliance by automating
calculations and generating necessary reports. Its versatility extends to inventory management
for businesses dealing with physical goods. With features like user access control, these tools
ensure the security of sensitive financial information. Popular accounting software options like
QuickBooks, Xero, and Sage Intacct cater to diverse business needs, reflecting the adaptability
and significance of these tools across industries in optimizing financial management processes.
Widely embraced by businesses ranging from small enterprises to large corporations,
accounting software is instrumental in maintaining systematic and accurate financial records.
1.2 OBJECTIVES
 To develop a Web app for streamlined management and storage for a company.
 This includes sales, accounts, employee data, and attendance using face recognition
for CALVERITE ENTERPRISE.
1.3 EXISTING SYSTEM
The current softwares provides a range of features to help users manage their financial
transactions, track expenses, generate invoices, and maintain accurate records. But most of
them are paid accounting software designed for small businesses, freelancers, and consultants.
It offers features like invoicing, expense tracking, accounting, and even payroll for small teams.
1.3.1 DRAWBACKS
Existing accounting software often faces challenges related to the limited diversity of its
recommendations, primarily based on user preferences. This lack of variety in suggested items
can lead to user dissatisfaction or boredom with the system. Additionally, these accounting
systems commonly rely on the popularity of items, contributing to a "rich get richer" phenomenon

1
INTRODUCTION CHAPTER 1

where popular items receive disproportionate attention, overshadowing less popular ones.
Furthermore, a notable drawback is the absence of crucial features such as an employee
management system, attendance module, IPFS storage system, dashboard, and data
visualization tools within this accounting software. The deficiency of these components restricts
the software's capacity to offer a comprehensive solution for managing both financial processes
and broader organizational functionalities.
1.4 PROPOSED SYSTEM
The proposed system presents a approach to the management of sales, accounts, and
data, seeking to overcome the challenges inherent in existing fragmented systems. At its core,
it is designed to foster integration and collaboration between departments that have traditionally
operated in isolation. By creating a unified ecosystem that seamlessly integrates data from
diverse sources, such as customer information, financial records, and market insights, this
system facilitates real-time data exchange among sales, accounts, and data management
teams. Efficiency is a central theme, as it significantly reduces the reliance on manual data entry
and transfer, automating routine tasks and eliminating data redundancies. This, in turn,
enhances operational efficiency, minimizes the risk of errors, and reduces operational costs.
Moreover, the system places a strong emphasis on data-driven decision-making by providing a
holistic view of customer interactions, financial history, and market trends. This empowers
organizations to create tailored sales strategies, allocate resources judiciously, and stay agile
in responding to market changes.
1.4.1 ADVANTAGES
 Efficient Financial Oversight and Holistic View: The accounting website facilitates efficient
financial oversight by providing a centralized platform to monitor and manage all financial
transactions and data. Users can access a holistic view of their financial status, including
income, expenses, assets, and liabilities in real-time. This comprehensive overview
enhances decision-making processes by enabling users to analyze financial trends, identify
areas for improvement, and make informed strategic choices.
 Secure Access: Security is paramount in financial management. Accounting website
ensures secure access by implementing robust authentication and authorization
mechanisms. This helps protect sensitive financial information from unauthorized access,
ensuring that only designated users with proper credentials can view and modify financial
data. Encryption protocols and secure communication channels further contribute to the
overall security of the system.

2
INTRODUCTION CHAPTER 1

 User-Friendly Interface: A user-friendly interface is crucial for an accounting website, as it


enhances the overall user experience. A well-designed interface simplifies navigation,
making it easy for users to input data, generate reports, and perform various financial tasks.
Intuitive design elements and clear information architecture contribute to user satisfaction,
reducing the learning curve and improving the efficiency of financial operations.
 Decentralized Data Storage: Decentralized data storage is a key advantage, offering
improved reliability and accessibility. By distributing data across multiple servers or
locations, the accounting website ensures that even if one server experiences issues, the
system can continue to function with minimal disruption. This approach enhances data
resilience and contributes to the overall reliability and availability of the accounting platform.
1.5 WORKING PRINCIPLE
It handles core functions like sales, accounts, employee data, and attendance.
Streamlining attendance via image processing minimizes errors. IPFS ensures secure file
storage, with metadata on the blockchain for heightened security.
Smart contracts store and secure metadata, anchoring hashes on the blockchain, creating an
immutable file record. Upon file upload, unique metadata hashes are generated and anchored
on the blockchain via smart contracts, guaranteeing tamper-proof data. The UI features
dashboards for sales and attendance insights. It also allows the admin to control who has
access to what data.

3
LITERATURE SURVEY CHAPTER 2

CHAPTER 2
LITERATURE SURVEY
2.1 RELATED WORKS
Research in the field of accounting software has witnessed significant advancements
aimed at improving efficiency, accuracy, and security in financial management systems. Studies
often delve into the integration of emerging technologies, such as blockchain, machine learning,
and artificial intelligence, to enhance various aspects of accounting processes. Noteworthy
works explore the development of automated systems for invoice processing, expense
management, and tax compliance, leveraging technologies like optical character recognition
(OCR) and predictive analytics. Additionally, research projects focus on addressing the
challenges of data privacy and security in accounting software, especially with the growing
importance of complying with global regulations like GDPR. The intersection of accounting
software with Internet of Things (IoT) devices and mobile applications is another area of
exploration, aiming to provide real-time data insights and user-friendly interfaces. With a
continuous emphasis on innovation and adaptability, these works collectively contribute to the
evolution of accounting software, offering solutions that align with the dynamic needs of modern
businesses and financial systems.
2.1.1 BIOMETRIC AUTHENTICATION SYSTEMS
[1] Vadana and Navdeep Kaur are the authors of this paper. A typical structure of a
biometric authentication system [1], [3], [10]. The biometric authentication system generally
includes three modules: User Agent (UA)
that requests for an eligible identity and gets access to then Internet services or other devices;
Identity Provider (IdP) that can verify user identity (i.e., authenticate a user) according to
received data from UA and its stored database; Relying Partyn(RP) that can enforce access
control according to the IdP’s decision When a user raises a request of authentication via a UI,
an authentication manager will send an authentication request to IdP through a secure channel.
After the IdP receives the authentication request, it will send a challenge to UA. Then the UA
can collect biometric signals through a biometric sensor, and preprocess (such as noise
reduction and coding) the collected data. After that, the UA responses the authentication
challenge. The UA should send the response to IdP through a secure channel in the network.
When receiving the challenge response, IdP extracts features of the biometric signals and
matches the features with the records in the database. Based on the match result, IdP can
decide whether the person participating in the authentication is a legitimate user or not. Yet

4
LITERATURE SURVEY CHAPTER 2

when receiving the user’s access request, RP can determine the access control policy of the
current user according to the authentication decision provided by IdP.

Fig 2. 1 Biometric traits

Methodology: This methodology outlines the sequential steps involved in the biometric
authentication system, encompassing user request, identity verification, biometric data
collection, secure communication, feature extraction, matching, access control, and final
decision feedback. The security and integrity of the entire process are upheld through secure
channels and cryptographic measures.
2.1.2 OBJECT OF DATABASE MANAGEMENT SYSTEM
[2] Hongxia Zhong is the author of this paper. Different database management systems
have different functions and performances because of their different hardware and software.
So, some database management systems' scale is small, such as FoxPro Access; some
database management systems' scale are large, such as Oracle, SQL and Server. Whatever
their scales are large or small, database management systems must meet the following
requirements. The key functions in different database management system are different. Large-
scale database management system always has perfect functions, and small-scale database
management system's functions are seldom besides the basic functions. Database

5
LITERATURE SURVEY CHAPTER 2

management system's functions mainly consists of definition of database, access of database


data, operation management of database, data organization and management of storage,
database's creation and maintenance
Methodology: This methodology provides a structured approach for evaluating and selecting
a database management system based on scale, functionalities, and performance
considerations. It ensures that the chosen system aligns with the specific requirements and
offers an optimal balance between features and costs.
2.1.3 BLOCKCHAIN-BASED DECENTRALIZED DATA STORAGE AND ACCESS
FRAMEWORK FOR PINGER
[3] Saqib Ali, Guojun WangIn, Bebo White, Roger Leslie Cottrell are the authors of this
paper. Every PingER Monitoring Agent (MA), each sample measurement set is sent every 30
minutes. The MA goes through its list of remote sites by sending up to thirty 100-byte pings at
one-second intervals until ten echo replies are received or it times out in 30 seconds. This is
then repeated for 1000-byte pings. The data collected for each set of pings consists of an MA
name, remote sites, IP addresses, payload in ping request, timestamp, number of ping packets
sent & received, response sequence number, minimum, average and maximum Round Trip
Time (RTT). All these raw measurements are stored in flat text files at each MA. The centralized
data repository at SLAC fetches all the text archives from each MA on daily basis. The data is
analyzed and stored with a specific naming pattern containing the name of performance metric,
packet size, MA name and the date of the measurement at SLAC data repository. The analyzed
data is referred as hourly data from all MAs and is used to generate sixteen Internet
performance metrics on a daily, monthly and yearly basis. The data is public and can be
downloaded from the ping table web interface6 (running at the SLAC web server) or by
anonymous FTP7. Thus, in the current PingER framework, data storing, and processing is
centralized and entirely dependent on SLAC resources for analyzing, archiving and reporting.
The above mentioned centralized data storage and access framework of PingER can be
replaced with a fully decentralized system using the key features of permissioned blockchain.
Therefore, in this work, a layered approach to translate the current PingER framework into a
blockchain-based decentralized data storage and access framework. The proposed design is
composed of three layers i.e., Communication layer, Data storage layer and Access layer. Each
layer is explained as follows. Communication Layer In the current PingER deployment, there
are nearly 50 MAs located at different geographical locations of the world. Each MA has a client
status with no contribution towards data storage, processing, analyzing and reporting.
Therefore, in the proposed framework, the status of an MA is raised from a client to a peer by

6
LITERATURE SURVEY CHAPTER 2

establishing a P2P network of MAs. As a result, each MA will not only help in data collection but
also be the place of data storage, processing and facilitating the web services. Moreover, it will
provide the communication and storage facilities to the distributed hash-tables and blockchain
deployment (discussed in the next layer) as it run on a P2P network via the Internet without any
central server.

Fig 2. 2 Off-chain storage of Ping ER data files

Data storage Layer blockchain are not general-purpose databases. It is not possible to
store daily PingER data on the blockchain as it will quickly scale to an unmanageable size and
cause the problem of Blockchain Bloat. Therefore, blockchain is used to manage the identity
and access control on the network by storing only a small amount of metadata information of
the PingER data files. Meanwhile, the actual data files are stored off-chain at K-storage locations
on the network by using erasure coding (K-of-M). The erasure coding will help to add
redundancy to the system against failures. Thus, if a specific MA is off-line, the erasure coding
will guarantee the availability of the data for analysis from other storage locations on the
network.
Distributed Hash Table (DHT): In the proposed framework, each MA analyzes the
collected raw data locally based on the performance metrics (e.g., minimum RTT, average RTT,
maximum RTT, and packet loss) and stores it with a filename of specific format after every 24
hours. Note that, each MA creates a separate file for each performance metric every day and
stored it locally. Before directly transmitting and storing the files of a specific day at K-storage
locations on the network, each file is hashed with a cryptographic function. The hashes of all
the files are combined to create a Merkle tree. In this layer, existing PingER scripts which
generate hourly, monthly, and yearly reports can work seamlessly. This is because, in this
framework, contents are addressed through hashes which is a widely used means of connecting

7
LITERATURE SURVEY CHAPTER 2

data in a distributed network. For example, PingER scripts can run over the Inter Planetary File
System (IPFS) which is a peer-to-peer hypermedia protocol using distributed hash tables and
a self-certifying namespace.

Fig 2. 3 PingER data Merkle tree

Paths work as it does in a traditional UNIX filesystems and the Web. Thus, all data files
are always accessible via their hash. This approach still works even if a few MAs are offline as
the files are located in multiple locations for redundancy. Thus, IPFS provides smarter, faster
and permanent web services to the PingER data access stack.
2.2 PROPOSED METHODOLOGY
The proposed methodology involves a systematic approach to developing a
comprehensive web app. It begins with a thorough analysis of functional and technological
requirements, followed by the design phase, encompassing system architecture, database
structure, and user interface. The development phase includes frontend and backend
implementation, integration of face recognition and blockchain for attendance and secure file
storage, and rigorous testing. Deployment on a reliable cloud platform, implementation of
security measures, and user training/documentation follow. Continuous maintenance, updates,
and user support ensure the longevity and effectiveness of the system, providing with a powerful
tool for streamlined sales, accounts, and employee management with enhanced security and
efficiency.

8
SYSTEM REQUIREMENTS CHAPTER 3

CHAPTER 3
SYSTEM REQUIREMENTS
3.1 HARDWARE REQUIREMENTS
 AWS web server
 Laptop/PC – 8GB RAM
 Web camera
3.1.1 AWS WEB SERVER
AWS stands for Amazon Web Services, which is a cloud computing platform that offers
on-demand computing services such as virtual servers, storage, databases, and more. AWS
allows users to create, manage, and deliver their websites and web applications using cloud
resources that are secure, reliable, and flexible. Each data center has many servers that are
connected by a network. Users can access these servers through the internet and use them to
run their applications and store their data.
3.2 SOFTWARE REQUIREMENTS
Software requirements are one of the important aspects for developing a project or a
system. Software requirements include necessary integrated development environments. An
integrated development environment is software for building applications that combines
common developer tools into a single graphical user interface.
3.2.1 REACT.JS
React.js is an open-source JavaScript framework and library. It is used for
building interactive user interfaces and web applications quickly and efficiently with
significantly less code than with vanilla JavaScript. In React, application is developed by
creating reusable components as blocks. These components are individual pieces of a
final interface, which form the application’s entire user interface.

Fig 3. 1 React.js

9
SYSTEM REQUIREMENTS CHAPTER 3

3.2.2 BOOTSTRAP
Bootstrap is a free and open-source front-end framework for developing responsive,
mobile-first websites and web applications. It is one of the most popular CSS frameworks in the
world, with over 580 million websites using it as of November 2023.Bootstrap provides a
collection of reusable code components, such as buttons, forms, navigation bars, and modals,
that can be customized to create a wide variety of website designs. It also includes a grid system
that makes it easy to create responsive layouts that look good on all devices.

Fig 3. 2 Boostrap

3.2.3 INTERPLANETARY FILE SYSTEM (IPFS)


IPFS, or InterPlanetary File System, is a decentralized and distributed protocol designed
to revolutionize the way to store, share, and access content on the internet. Created to address
challenges associated with traditional, centralized file systems, IPFS uses a peer-to-peer
network where each file and all its versions are uniquely identified by a content-addressed
identifier (hash). This content-centric approach enhances data integrity, facilitates efficient
content distribution, and creates a resilient and censorship-resistant network. IPFS enables
users to share data without relying on a specific server, promoting a more decentralized and
redundant storage model. It has gained popularity for its potential to revolutionize various
industries, from data sharing and storage to decentralized applications (DApps), fostering a
more open and collaborative internet infrastructure.

Fig 3. 3 IPFS
3.2.4 VISUAL STUDIO CODE
Visual Studio Code, developed by Microsoft, is a highly popular, cross-platform code
editor known for its speed, versatility, and extensibility. Offering a lightweight and fast
environment, it supports a broad range of programming languages and provides essential

10
SYSTEM REQUIREMENTS CHAPTER 3

features like syntax highlighting, IntelliSense, and debugging. With an extensive library of
extensions, developers can tailor the editor to their specific needs, integrating tools for different
languages and frameworks. Its integrated Git support, built-in terminal, and powerful debugger
contribute to a seamless coding experience. Visual Studio Code's active community ensures
regular updates, making it a go-to choice for developers seeking a feature-rich yet agile code
editor.

Fig 3. 4 Visual studio code

3.2.5 SPRING BOOT


Spring Boot is an open-source Java-based framework designed to simplify and
accelerate the development of production-ready, stand-alone Spring-based applications. It is
built on top of the Spring framework and follows the convention-over-configuration paradigm,
reducing the need for developers to specify certain configurations. Spring Boot offers a
streamlined approach to developing microservices and web applications, providing an
embedded web server (like Tomcat or Jetty) and minimizing the boilerplate code typically
associated with Spring applications.

Fig 3. 5 Spring boot

3.2.6 CHART.JS
Chart.js is a user-friendly JavaScript library for data visualization, known for its simplicity
and ease of use. It supports various chart types, including line, bar, radar, and doughnut charts.
The library provides built-in interactivity features, such as tooltips and click functionality, and
ensures responsive design for different screen sizes. While not as customizable as some other
libraries, it offers sufficient flexibility for creating visually appealing and informative charts.

11
SYSTEM REQUIREMENTS CHAPTER 3

Chart.js is well-suited for web developers seeking a quick and straightforward solution for
incorporating dynamic charts into their websites.

.
Fig 3. 6 Chart.js

3.2.7 PYTHON
Leveraging Python for facial recognition involves utilizing powerful libraries and
frameworks tailored for computer vision tasks. The OpenCV library provides essential tools for
image and video processing, including pre-trained models for face detection. For more
advanced capabilities like facial landmark detection and shape prediction, the dlib library, with
its Python bindings, proves invaluable. The face_recognition library simplifies complex tasks by
serving as a high-level wrapper on top of dlib, offering an accessible interface for face detection,
feature extraction, and comparison. TensorFlow and Keras provide options for those interested
in deep learning-based facial recognition, enabling the creation and training of custom neural
network models. The typical workflow involves image capture, pre-processing, face detection,
feature extraction, comparison, and integration into the desired application or system. However,
ethical considerations, privacy concerns, and adherence to relevant regulations are critical
aspects when implementing facial recognition systems.

Fig 3. 7 Python

12
SYSTEM REQUIREMENTS CHAPTER 3

3.2.8 MYSQL
MySQL is a free and open-source relational database management system (RDBMS).
It is one of the most popular database systems in the world, and is used by many popular
websites and applications, such as Wikipedia, Facebook, and Twitter.
MySQL is a free and open-source relational database management system (RDBMS). It is a
versatile and reliable choice for the backend of accounting software, providing the necessary
features for data storage, integrity, security, and performance.

Fig 3. 8 MySQL

13
SYSTEM ANALYSIS AND DESIGN CHAPTER 4

CHAPTER 4
SYSTEM ANALYSIS AND DESIGN
4.1 FEASIBILITY ANALYSIS
Feasibility study is an assessment of the practicality of a proposed plan or method. A
feasibility study aims to uncover the strengths and weaknesses of an existing business or
proposed venture, opportunities and threats present in the environment, the resources
required to carry through, and ultimately the prospects for success. A well-designed feasibility
study should provide:
1. To understand thoroughly all aspects of a project, concept, or plan.
2. To be aware of potential problems that could occur during implementation.
3. To determine whether it is worth doing economically.
Each project needs to have a feasibility study for complete understandability of the project.
The different types of feasibility are listed below.

1. Technical feasibility
2. Economic feasibility
3. Operational feasibility
4.1.1 TECHNICAL FEASIBILITY
Technical feasibility refers to checking whether the proposed system can be
implemented with the existing hardware, software, and technical expertise. This project is
technically feasible as all the technologies for this project readily available and there is no need
for any new technologies to complete this project. The programming languages and hardware
used in this project are open source easy, fast, and cost-efficient with existing technologies, a
system with security, reliability and high- performance. So, this project is technically feasible.
4.1.2 ECONOMIC FEASIBILITY
Economic feasibility is a cost-benefit analysis. It is a crucial aspect of project evaluation
that assesses whether a proposed project or investment is financially viable and justifiable.
This project is completely open source because the software and libraries like fast api,
react.js, python that are used for building this project are completely free. So, this project is
economically feasible.
4.1.3 OPERATIONAL FEASIBILITY
Operational feasibility is the measure of how well a proposed system solves the
problems, and takes advantage of the opportunities identified during scope definition and how

14
SYSTEM ANALYSIS AND DESIGN CHAPTER 4

it satisfies the requirements in the requirements analysis phase. The project validates the
entries that are made by user and verifies so there is no problem with authentication and entry
issues and safe. So, both the requirements and problem solving are satisfied. Thus, this project
is operationally feasible.
4.2 ACTIVITY DIAGRAM
An activity diagram is basically a flowchart to represent the flow from one activity to
another activity. It visually presents a series of actions or flow of control in a system like a
flowchart or a data flow diagram. It is used by developers to understand the flow of programs
on a high level.
4.2.1 ACTIVITY DIAGRAM FOR COSMOCONNECT

Fig 4. 1 Activity Diagram

Figure 4.1 shows the activity diagram where the process starts with the user trying to
login into the application using username and password. Once the user successfully logs into
the web, the app determines the user’s access level aka authorization process. Then the user
can perform the tasks allow for him and logout.
4.3 USE CASE DIAGRAM
Use-case diagram describe the high-level functions and scope of a system. These
diagrams also identify the interactions between the system and its actors. A use case diagram

15
SYSTEM ANALYSIS AND DESIGN CHAPTER 4

is used to represent dynamic behavior of a system. It encapsulates the systems functionality by


use cases, actors, and their relationships.
4.3.1 USE-CASE DIAGRAM FOR COSMOCONNECT

Figure 4.2 shows the use-case diagram where there are three actors namely system
user, admin, customer, accountant. The user is a general audience who do not know anything
about the working of the system, the user will just use the system for their needs. The admin is
controller of the system and validate transactions and overview packages and cost. Customers
can check their payments regarding product and delivery etc.

Fig 4. 2 Use case diagram for cosmoconnect

16
PROJECT MODULES CHAPTER 5

CHAPTER 5

PROJECT MODULES
5.1 ATTENDANCE MODULE
The Attendance System is designed to streamline the process of tracking and
managing attendance. Developed using the Tkinter library in Python, the system provides a
user-friendly interface for both logging in existing users and registering new users.
5.1.1 TECHNOLOGY STACK
 Python : The core programming language used for development.
 Tkinter : A Python library for creating graphical user interfaces, facilitating the design
of an intuitive and interactive attendance system
 Face_recognition : It works by identifying and measuring facial features in an image.
Facial recognition can identify human faces in images or videos, determine if the
face in two images belongs to the same person. A deep neural network model is
used for disguised face recognition. There are two CNN models in use. One is for
predicting the image's facial keypoints.

Fig 5. 1 Face Embedding

5.1.2 USER INTERFACE


5.1.2.1 LOGIN INTERFACE

17
PROJECT MODULES CHAPTER 5

The login interface allows existing users to access the system. Users are prompted
to enter their credentials, typically a unique username and password. Authentication is
performed, granting access upon successful verification.

Fig 5. 2 Login Interface

5.1.2.2 REGISTER NEW USER INTERFACE


New users register by providing their user name or ID .The system securely stores
user data for subsequent logins. Registration ensures a streamlined process for attendance
tracking.

Fig 5. 3 New User Registration

18
PROJECT MODULES CHAPTER 5

5.2 HOME PAGE


Welcome to [Company/Organization Name] - a [brief descriptor, e.g., dynamic,
innovative, leading] [industry or niche] dedicated to [core purpose or mission]. Established in
[Year of Establishment], the forefront of [industry trends, innovation, etc.].

Fig 5. 4 Home page

19
PROJECT MODULES CHAPTER 5

5.2.1 LOGIN PAGE


The figure 5.1 shows login form utilizes the credentials of a user, in order to authenticate
their access. It generally consists of the typical username or email and password. But more
fields can be added to improve the site's security. These can be in the form of a passcode, PIN
number, or a secret phrase.

Fig 5. 5 Login page

5.2.2 DASHBOARD PAGE


The figure 5.2 dashboard is a way of displaying various types of visual data in one place.
Usually, a dashboard is intended to convey different, but related information in an easy-to-digest
form. Dashboard includes a variety of charts with graphical views of key performance indicators
in Customer Service.

20
PROJECT MODULES CHAPTER 5

Fig 5. 6 Dashboard

5.2.3 CONTACT PAGE


The figure 5.3 Contact Us page serves as a pivotal point of interaction between the
organization and the valued audience. Designed with user engagement and accessibility in
mind, this page is a vital component of the web platform, offering multiple avenues for individuals
to connect with us seamlessly.

21
PROJECT MODULES CHAPTER 5

Fig 5. 7 Contact us page

5.2.5 DATA STORED IN PHP MYSQL DATABASE


The figure 5.4 backbone of the project lies in the efficient and secure storage of data,
achieved through the utilization of a PHP MySQL database. This integral component ensures
the seamless management and retrieval of information critical to the functioning and success of
the application.

Fig 5. 8 Data stored in php-mysql database

22
TESTING AND IMPLEMENTATION CHAPTER 6

CHAPTER 6
TESTING AND IMPLEMENTATION
6.1 INTRODUCTION
This chapter consists of a testing report of the project. It is done for evaluating the
functionality of this project to find any bugs and errors. It checks whether the developed system
met the specified requirements and identifies any defects in the system in order to produce a
quality product. It is basically executing a system to identify any gaps, errors, or missing
requirements in contrast to the actual requirements. In this testing, the system was tested by
applying correct/incorrect data and seeing how the system reacted to it. It also checks the
functionality of each module.
Things that are tested in this system,
 Verifying Access control mechanism
 Verifying Login authentication
 Verify there is no dead page and all redirects to the correct page in a web app.
 Verifying storage reliability.
 Verify the request and response process.
 Integration between the web app and blockchain network.
 Verifying the correlation between actual data and data virtualization
 Verify the workflow of the system
6.2 LEVELS OF TESTING
Testing levels are the procedure for finding the missing areas and avoiding overlapping
and repetition between the development life cycle stages. The various phases such as
Requirement collection, designing, coding testing, deployment, and maintenance of SDLC. In
order to test any application, like SDLC, multiple levels of testing are implemented, which help
us maintain the quality of the software. The levels of software testing involve the different
methodologies, which can be used while performing the software testing.
 Unit Testing
 Integration Testing
 System Testing
 Acceptance Testing

23
TESTING AND IMPLEMENTATION CHAPTER 6

Fig 6. 1 Levels of testing

6.2.1 UNIT TESTING


Unit testing is a critical part of the software development process that involves testing
individual units or components of code to ensure it functions as intended. Here, the modules will
be tested, it would involve testing individual functions such as attendance feature, data
visualization and storage of data to ensure it works as expected. This would involve creating
test cases for each function and running them repeatedly to identify any bugs or errors that need
to be fixed. Overall, unit testing is essential for ensuring the quality and reliability of software
products, especially those dealing with sensitive financial information.
6.2.2 INTEGRATION TESTING
Integration testing is a software testing technique that tests how different modules or
components of a system work together. Here, the modules will be tested, it would involve testing
how the different features of the app, such as attendance feature, data visualization and storage
of data, work together seamlessly. This would involve creating test cases that simulate real-
world scenarios and testing how the apps responds to different inputs and outputs. Overall,
integration testing is critical for identifying and resolving any issues that may arise when different
components of the system are combined, ensuring that the product works as intended for the
end user.
6.2.3 SYSTEM TESTING
System testing is a software testing technique that tests the entire system as a whole, rather
than individual components or modules. Here, the modules will be tested, it would involve testing
the entire wallet, including all of its features, to ensure that it meets the requirements and

24
TESTING AND IMPLEMENTATION CHAPTER 6

specifications laid out by the developers. This would involve creating test cases that cover all
aspects such as testing the product in a simulated real-world environment. Overall, system
testing is crucial for ensuring that the product is functional, reliable, and meets the needs of its
intended users.
6.2.4 ACCEPTANCE TESTING
Acceptance testing is a software testing technique that tests whether a product meets
the acceptance criteria, and requirements laid out by the stakeholders, including end users and
customers. The modules will be tested, it would involve testing the product in a real-world
environment by actual end-users to ensure that it is user-friendly, secure, and meets their
expectations. This would involve creating test cases that simulate common use cases and
scenarios, such as entering and retrieving data, interacting with the app, and Storage. Overall,
acceptance testing is critical for ensuring that the product is ready for release, and meets the
needs and expectations of its intended users.
6.2.5 SYSTEM VALIDATION
The below table 7.1 is used to determine whether or not a system satisfies the
acceptance criteria and to determine whether or not to accept the system.
Table 7.1 SYSTEM VALIDATION

Test Case Input Description Expected Actual Output Status


Output

Creation of User registration The web app The web app were Pass
new users details. must be able able to create new
System accepts to create new users along with
valid input and users without unique user id and
auto-generates any mistakes. the user was able
unique user IDs to sign in
successfully

Retrieve Queries to The web app The web app was Pass
data from retrieve specific should be able able to retrieve data
database data from the to retrieve from database
database data from
database

25
TESTING AND IMPLEMENTATION CHAPTER 6

Register new User input for The web app The web app was Pass
users for attendance must allow able to allow new
attendance registration, new users to users to register for
including register for attendance
identification attendance monitoring.
information monitoring.

Table 6. 1 System validation

6.3 SYSTEM VERIFICATION


The below table is used to check the correctness of any element that fulfills the
requirements or specifications established for it.
Table 7.2 SYSTEM VERIFICATION

Test Case Input Description Expected Output Status

Verify user The web app must The web app was able to Pass
authorization only allow user to allow user to modify data they
modify data they have have given permission.
given permission.

Verify user login Enter valid user The user should be able to log Pass
functionality details and click on in successfully and their home
the submit button. page must be shown

Verify user Recognize valid user The user should be able to Pass
attendance faces and click on submit his attendance
Verify successfully through facial
recognition

Verify data Enter valid Users must be able to cross Pass


tampering cryptographic hash reference for data tampering
key to retrieve specific
data

Table 6. 2 System verification

26
CONCLUSION

CONCLUSION
This project represents a comprehensive and innovative solution that seamlessly
integrates core business functions, employing image processing for streamlined attendance
management and ensuring data integrity through blockchain technology. The utilization of
IPFS for secure file storage, coupled with smart contracts anchoring metadata on the
blockchain, establishes an immutable and tamper-proof record of files. The intuitive user
interface, featuring insightful dashboards for sales and attendance, empowers administrators
to efficiently manage and analyze data.
Future Scope
 Further enhancements to the user interface for an even more intuitive experience, as
well as exploring additional functionalities such as predictive analytics for sales trends
and advanced reporting features
 Also, Expanding the project to include a vehicle delivery tracking system will provide
real-time insights into the location and status of delivery vehicles, enhancing logistics
management and improving customer satisfaction with accurate and up-to-date delivery
progress information.

vi
BIBILIOGRAPHY

BIBLIOGRAPHY

REFERENCE PAPERS
1. Jayesh Baibhav, Jyotishman Ghatak, J. Albert Mayan, "Web based Payment Tracking
and Accounting Application", 2023 7th International Conference on Intelligent
Computing and Control Systems (ICICCS), pp.1018-1022, 2023.
2. Patiyuth Pramkeaw, Narumol Chumuang, Mahasak Ketcham, Worawut Yimyam,
Thittaporn Ganokratanaa, "Development of a Process to Enhance the Reimbursement
Efficiency with OCR and Ontology for Financial Documents", 2022 International
Conference on Cybernetics and Innovations (ICCI), pp.1-6, 2022.
3. Jiewu Leng, Weinan Sha, Baicun Wang, Pai Zheng, Cunbo Zhuang, Qiang Liu, Thorsten
Wuest, Dimitris Mourtzis, Lihui Wang, "Industry 5.0: Prospect and retrospect", Journal
of Accounts management, vol.65, pp.279, 2022.
4. Zibin Zheng, Shaoan Xie, Hongning Dai, Xiangping Chen, and Huaimin Wang, “An
Overview of Blockchain Technology: Architecture, Consensus, and Future Trends”,
IEEE International Conference on Big Data (Bigdata Congress), 2017.
5. G. Wood, “Ethereum: A secure decentralised generalised transaction ledger,” Ethereum
Project Yellow Paper, vol. 151, pp. 1–32, 2014.
REFERENCED BOOKS
1. Imran Bashir, “Mastering Blockchain Second Edition”, Packt Publishing Limited, 2019.
2. Enis Karaarslan*, Enis Konacakli, “Data Storage In The Decentralized World: Blockchain
And Derivatives”, Cornell University, 2018.
REFERENCE LINKS
 https://www.geeksforgeeks.org/recommendation-system-in-python/
 https://stackoverflow.com/
 https://www.w3schools.com/

vii
APPENDICES

APPENDICES
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title>Dashboard - CosmoConnect</title>
<meta content="" name="description">
<meta content="" name="keywords">

<!-- Favicons -->


<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.gstatic.com" rel="preconnect">
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,70
0i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,7
00,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/quill/quill.snow.css" rel="stylesheet">
<link href="assets/vendor/quill/quill.bubble.css" rel="stylesheet">
<link href="assets/vendor/remixicon/remixicon.css" rel="stylesheet">
<link href="assets/vendor/simple-datatables/style.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
</head>
<body>
<!-- ======= Header ======= -->

viii
APPENDICES

<header id="header" class="header fixed-top d-flex align-items-center">

<div class="d-flex align-items-center justify-content-between">


<a href="index.html" class="logo d-flex align-items-center">
<img src="assets/img/logo.png" alt="">
<span class="d-none d-lg-block">CosmoConnect</span>
</a>
<i class="bi bi-list toggle-sidebar-btn"></i>
</div><!-- End Logo -->
<div class="search-bar">
<form class="search-form d-flex align-items-center" method="POST" action="#">
<input type="text" name="query" placeholder="Search" title="Enter search keyword">
<button type="submit" title="Search"><i class="bi bi-search"></i></button>
</form>
</div><!-- End Search Bar -->
<nav class="header-nav ms-auto">
<ul class="d-flex align-items-center">
<li class="nav-item d-block d-lg-none">
<a class="nav-link nav-icon search-bar-toggle " href="#">
<i class="bi bi-search"></i>
</a>
</li><!-- End Search Icon-->
<li class="nav-item dropdown">
<a class="nav-link nav-icon" href="#" data-bs-toggle="dropdown">
<i class="bi bi-bell"></i>
</a><!-- End Notification Icon -->
</li><!-- End Notification Nav -->
<li class="nav-item dropdown">

<a class="nav-link nav-icon" href="#" data-bs-toggle="dropdown">


<i class="bi bi-chat-left-text"></i>
</a><!-- End Messages Icon -->
</li><!-- End Messages Nav -->
<li class="nav-item dropdown pe-3">

ix
APPENDICES

<a class="nav-link nav-profile d-flex align-items-center pe-0" href="#" data-bs-


toggle="dropdown">
<img src="assets/img/abizz.jpg" alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">Abizz</span>
</a><!-- End Profile Iamge Icon -->

<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow profile">


<li class="dropdown-header">
<h6>Abizz</h6>
<span>Manager</span>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li>
<a class="dropdown-item d-flex align-items-center" href="users-profile.html">
<i class="bi bi-person"></i>
<span>My Profile</span>
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li>
<a class="dropdown-item d-flex align-items-center" href="users-profile.html">
<i class="bi bi-gear"></i>
<span>Account Settings</span>
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li>

x
APPENDICES

<a class="dropdown-item d-flex align-items-center" href="pages-faq.html">


<i class="bi bi-question-circle"></i>
<span>Need Help?</span>
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li>
<a class="dropdown-item d-flex align-items-center" href="#">
<i class="bi bi-box-arrow-right"></i>
<span>Sign Out</span>
</a>
</li>

</ul><!-- End Profile Dropdown Items -->


</li><!-- End Profile Nav -->
</ul>
</nav><!-- End Icons Navigation -->
</header><!-- End Header -->
<!-- Sales Card -->
<div class="col-xxl-4 col-md-6">
<div class="card info-card sales-card">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-
dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>

<li><a class="dropdown-item" href="#">Today</a></li>


<li><a class="dropdown-item" href="#">This Month</a></li>

xi
APPENDICES

<li><a class="dropdown-item" href="#">This Year</a></li>


</ul>
</div>

<div class="card-body">
<h5 class="card-title">Sales <span>| Today</span></h5>

<div class="d-flex align-items-center">


<div class="card-icon rounded-circle d-flex align-items-center justify-content-
center">
<i class="bi bi-cart"></i>
</div>
<div class="ps-3">
<h6>145</h6>
<span class="text-success small pt-1 fw-bold">12%</span> <span class="text-
muted small pt-2 ps-1">increase</span>

</div>
</div>
</div>

</div>
</div><!-- End Sales Card -->
<!-- Revenue Card -->
<div class="col-xxl-4 col-md-6">
<div class="card info-card revenue-card">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-
dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>

xii
APPENDICES

<li><a class="dropdown-item" href="#">Today</a></li>


<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>

<div class="card-body">
<h5 class="card-title">Revenue <span>| This Month</span></h5>

<div class="d-flex align-items-center">


<div class="card-icon rounded-circle d-flex align-items-center justify-content-
center">
<i class="bi bi-currency-dollar"></i>
</div>
<div class="ps-3">
<h6>3,264</h6>
<span class="text-success small pt-1 fw-bold">8%</span> <span class="text-
muted small pt-2 ps-1">increase</span>

</div>
</div>
</div>

</div>
</div><!-- End Revenue Card -->
<!-- Customers Card -->
<div class="col-xxl-4 col-xl-12">

<div class="card info-card customers-card">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-
dots"></i></a>

xiii
APPENDICES

<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">


<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>
<li><a class="dropdown-item" href="#">Today</a></li>
<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title">Customers <span>| This Year</span></h5>

<div class="d-flex align-items-center">


<div class="card-icon rounded-circle d-flex align-items-center justify-content-
center">
<i class="bi bi-people"></i>
</div>
<div class="ps-3">
<h6>1244</h6>
<span class="text-danger small pt-1 fw-bold">12%</span> <span class="text-
muted small pt-2 ps-1">decrease</span>

</div>
</div>

</div>
</div>

</div><!-- End Customers Card -->


<!-- Reports -->
<div class="col-12">
<div class="card">

<div class="filter">

xiv
APPENDICES

<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-


dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>
<li><a class="dropdown-item" href="#">Today</a></li>
<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title">Reports <span>/Today</span></h5>

<!-- Line Chart -->


<div id="reportsChart"></div>
<script>
document.addEventListener("DOMContentLoaded", () => {
new ApexCharts(document.querySelector("#reportsChart"), {
series: [{
name: 'Sales',
data: [31, 40, 28, 51, 42, 82, 56],
}, {
name: 'Revenue',
data: [11, 32, 45, 32, 34, 52, 41]
}, {
name: 'Customers',
data: [15, 11, 32, 18, 9, 24, 11]
}],
chart: {
height: 350,
type: 'area',
toolbar: {
show: false

xv
APPENDICES

},
},
markers: {
size: 4
},
colors: ['#4154f1', '#2eca6a', '#ff771d'],
fill: {
type: "gradient",
gradient: {
shadeIntensity: 1,
opacityFrom: 0.3,
opacityTo: 0.4,
stops: [0, 90, 100]
}
},
dataLabels: {
enabled: false
},
stroke: {
curve: 'smooth',
width: 2
},
xaxis: {
type: 'datetime',
categories: ["2018-09-19T00:00:00.000Z", "2018-09-19T01:30:00.000Z",
"2018-09-19T02:30:00.000Z", "2018-09-19T03:30:00.000Z", "2018-09-19T04:30:00.000Z",
"2018-09-19T05:30:00.000Z", "2018-09-19T06:30:00.000Z"]
},
tooltip: {
x: {
format: 'dd/MM/yy HH:mm'
},
}
}).render();

xvi
APPENDICES

});
</script>
<!-- End Line Chart -->
</div>
</div>
</div><!-- End Reports -->

<!-- Recent Sales -->


<div class="col-12">
<div class="card recent-sales overflow-auto">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-
dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>

<li><a class="dropdown-item" href="#">Today</a></li>


<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>

<div class="card-body">
<h5 class="card-title">Recent Sales <span>| Today</span></h5>

<table class="table table-borderless datatable">


<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Customer</th>
<th scope="col">Product</th>

xvii
APPENDICES

<th scope="col">Price</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><a href="#">#2457</a></th>
<td>customer-1</td>
<td><a href="#" class="text-primary">product-1</a></td>
<td>100</td>
<td><span class="badge bg-success">Approved</span></td>
</tr>
<tr>
<th scope="row"><a href="#">#2147</a></th>
<td>customer-2</td>
<td><a href="#" class="text-primary">product-2</a></td>
<td>100</td>
<td><span class="badge bg-warning">Pending</span></td>
</tr>
<tr>
<th scope="row"><a href="#">#2049</a></th>
<td>customer-3</td>
<td><a href="#" class="text-primary">product-3</a></td>
<td>100</td>
<td><span class="badge bg-success">Approved</span></td>
</tr>
<tr>
<th scope="row"><a href="#">#2644</a></th>
<td>customer-4</td>
<td><a href="#" class="text-primar">product-4</a></td>
<td>100</td>
<td><span class="badge bg-danger">Rejected</span></td>
</tr>
<tr>

xviii
APPENDICES

<th scope="row"><a href="#">#2644</a></th>


<td>customer-5</td>
<td><a href="#" class="text-primary">product-5</a></td>
<td>100</td>
<td><span class="badge bg-success">Approved</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div><!-- End Recent Sales -->
</div>
</div><!-- End Left side columns -->
<!-- Right side columns -->
<div class="col-lg-4">

<!-- Recent Activity -->


<div class="card">
<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-
dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>

<li><a class="dropdown-item" href="#">Today</a></li>


<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>

<div class="card-body">
<h5 class="card-title">Recent Activity <span>| Today</span></h5>

xix
APPENDICES

<div class="activity">

<div class="activity-item d-flex">


<div class="activite-label">32 min</div>
<i class='bi bi-circle-fill activity-badge text-success align-self-start'></i>
<div class="activity-content">
The Transport vehicle is returning.<a href="#" class="fw-bold text-dark"></a>
</div>
</div><!-- End activity item-->

<div class="activity-item d-flex">


<div class="activite-label">56 min</div>
<i class='bi bi-circle-fill activity-badge text-danger align-self-start'></i>
<div class="activity-content">
Order 2644 has been delivered.
</div>
</div><!-- End activity item-->

<div class="activity-item d-flex">


<div class="activite-label">2 hrs</div>
<i class='bi bi-circle-fill activity-badge text-primary align-self-start'></i>
<div class="activity-content">
The vehicle has left the industry.
</div>
</div><!-- End activity item-->

<div class="activity-item d-flex">


<div class="activite-label">3 hrs</div>
<i class='bi bi-circle-fill activity-badge text-info align-self-start'></i>
<div class="activity-content">
Invoice has been collected <a href="#" class="fw-bold text-dark"></a>
</div>
</div><!-- End activity item-->

xx
APPENDICES

<div class="activity-item d-flex">


<div class="activite-label">2 days</div>
<i class='bi bi-circle-fill activity-badge text-warning align-self-start'></i>
<div class="activity-content">
Production for order 2644 has been completed.
</div>
</div><!-- End activity item-->
<div class="activity-item d-flex">
<div class="activite-label">3 days</div>
<i class='bi bi-circle-fill activity-badge text-muted align-self-start'></i>
<div class="activity-content">
An amount of 20500 has been deposited.
</div>
</div><!-- End activity item-->

</div>
</div>
</div><!-- End Recent Activity -->
<!-- Budget Report -->
<div class="card">
<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-
dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>

<li><a class="dropdown-item" href="#">Today</a></li>


<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>
</section>

xxi
APPENDICES

</main><!-- End #main -->


<!-- ======= Footer ======= -->
<footer id="footer" class="footer">
<div class="copyright">
<strong><span></span></strong>
</div>
<div class="credits">
<a href="">Footer</a>
</div>
</footer><!-- End Footer -->

<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi


bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/apexcharts/apexcharts.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/chart.js/chart.umd.js"></script>
<script src="assets/vendor/echarts/echarts.min.js"></script>
<script src="assets/vendor/quill/quill.min.js"></script>
<script src="assets/vendor/simple-datatables/simple-datatables.js"></script>
<script src="assets/vendor/tinymce/tinymce.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
</html>
MAIN.PY
import subprocess
import tkinter as tk
import tkinter
import util
import cv2
from PIL import Image,ImageTk
import os.path

xxii
APPENDICES

import datetime

class App:
def __init__(self):
self.main_window = tkinter.Tk()
self.main_window.geometry("1200x520+350+100")

self.login_button_main_window = util.get_button(self.main_window, 'login', 'green',


self.login)
self.login_button_main_window.place(x=750, y=300)

self.register_new_user_button_main_window = util.get_button(self.main_window,
'register new user', 'gray',
self.register_new_user, fg='black')
self.register_new_user_button_main_window.place(x=750, y=400)

self.webcam_label = util.get_img_label(self.main_window)
self.webcam_label.place(x=10,y=0,width=700,height=500)

self.add_webcam(self.webcam_label)

self.db_dir = './db'
if not os.path.exists(self.db_dir):
os.mkdir(self.db_dir)

self.log_path= './log.txt'

def add_webcam(self, label):


if 'cap' not in self.__dict__:
self.cap = cv2.VideoCapture(0) # Change camera index to 0 for built-in webcam

if not self.cap.isOpened():
print("Error: Unable to access the camera.")

xxiii
APPENDICES

return

self._label = label
self.process_webcam()

def process_webcam(self):
ret, frame = self.cap.read()

self.most_recent_capture_arr = frame

img_ = cv2.cvtColor(self.most_recent_capture_arr,cv2.COLOR_BGR2RGB)
self.most_recent_capture_pil =Image.fromarray(img_)

imgtk = ImageTk.PhotoImage(image=self.most_recent_capture_pil)

self._label.imgtk = imgtk
self._label.configure(image=imgtk)
self._label.after(20, self.process_webcam)

def login(self):
unknown_img_path = './.tmp.jpg'

cv2.imwrite(unknown_img_path,self.most_recent_capture_arr)
output=str(subprocess.check_output(['face_recognition',self.db_dir,
unknown_img_path]))
name=output.split(',')[1][:-14].strip()

if name in ['unknown_person','no_persons_found']:
util.msg_box('ups.....',"unknown user , please register new user or retry again")
else:
util.msg_box("welcome back !","welcome, {}".format(name))
with open(self.log_path,'a') as f:
f.write('{},{}\n'.format(name,datetime.datetime.now()))
f.close()

xxiv
APPENDICES

os.remove(unknown_img_path)
def register_new_user(self):
self.register_new_user_window= tk.Toplevel(self.main_window)
self.register_new_user_window.geometry("1200x520+370+120")

self.accept_button_register_new_user_window =
util.get_button(self.register_new_user_window, 'Accept', 'green',
self.accept_register_new_user)
self.accept_button_register_new_user_window.place(x=750, y=300)

self.try_again_button_register_new_user_window =
util.get_button(self.register_new_user_window, 'tryagain', 'red',
self.try_again_register_new_user)
self.try_again_button_register_new_user_window.place(x=750, y=400)

self.capture_label = util.get_img_label(self.register_new_user_window)
self.capture_label.place(x=10,y=0,width=700,height=500)

self.add_img_to_label(self.capture_label)
self.entry_text_register_new_user = util.get_entry_text(self.register_new_user_window)
self.entry_text_register_new_user.place(x=750 , y=150)

self.text_label_register_new_user =
util.get_text_label(self.register_new_user_window,"please , \n input username ")
self.text_label_register_new_user.place(x=750 , y=70 )

def try_again_register_new_user(self):
self.register_new_user_window.destroy()

def add_img_to_label(self,label):
imgtk = ImageTk.PhotoImage(image=self.most_recent_capture_pil)

xxv
APPENDICES

label.imgtk = imgtk
label.configure(image=imgtk)

self.register_new_user_capture = self.most_recent_capture_arr.copy()

def start(self):
self.main_window.mainloop()

def accept_register_new_user(self):
name=self.entry_text_register_new_user.get(1.0 ,'end-1c' )

cv2.imwrite(os.path.join(self.db_dir,'{}.jpg'.format(name)),self.register_new_user_capture
)

util.msg_box('success!',"user was registered successfully !")


self.register_new_user_window.destroy()

if __name__ == "__main__":
app = App()
app.start()
UTIL.PY

import os
import pickle
import tkinter as tk
from tkinter import messagebox
import face_recognition
def get_button(window, text, color, command, fg='white'):
button = tk.Button(
window,
text=text,
activebackground="black",
activeforeground="white",
fg=fg,

xxvi
APPENDICES

bg=color,
command=command,
height=2,
width=20,
font=('Helvetica bold', 20)
)

return button

def get_img_label(window):
label = tk.Label(window)
label.grid(row=0, column=0)
return label

def get_text_label(window, text):


label = tk.Label(window, text=text)
label.config(font=("sans-serif", 21), justify="left")
return label

def get_entry_text(window):
inputtxt = tk.Text(window,
height=2,
width=15, font=("Arial", 32))
return inputtxt

def msg_box(title, description):


messagebox.showinfo(title, description)

def recognize(img, db_path):


# it is assumed there will be at most 1 match in the db

embeddings_unknown = face_recognition.face_encodings(img)
if len(embeddings_unknown) == 0:
return 'no_persons_found'

xxvii
APPENDICES

else:
embeddings_unknown = embeddings_unknown[0]

db_dir = sorted(os.listdir(db_path))

match = False
j=0
while not match and j < len(db_dir):
path_ = os.path.join(db_path, db_dir[j])

file = open(path_, 'rb')


embeddings = pickle.load(file)

match = face_recognition.compare_faces([embeddings], embeddings_unknown)[0]


j += 1

if match:
return db_dir[j - 1][:-7]
else:
return 'unknown_person'

xxviii

You might also like