Booking Application - Full Stack
Booking Application - Full Stack
SYNOPSIS .................................................................................................................................
xi
1 INTRODUCTION ...................................................................................................................
1
ii
2.5 Software Specification ...................................................................................................
12
2.5.7 GitHub...................................................................................................................
17
iii
3.2.5 History Table ....................................................................................................... 24
8 CONCLUSION ......................................................................................................................
65
APPENDICES ..........................................................................................................................
67
References ............................................................................................................................. 85
v
LIST OF TABLES
vi
vii
LIST OF FIGURES
Table Design 21
Fig 4.1
26
Fig 4.2 Registration flowchart .……………………………………….
28
Fig 4.3 Search and Filter flowchat …………………………………...
29
Fig 4.4 Slot Booking Flowchart ……………………………………...
30
Fig 4.5 Charging History flowchart …………………………………..
31
Fig 4.6 My Booking Flowchart ………………………………………
32
Fig 5.1
My Payment Flowchart ………………………………………
33
Fig 5.2
User Interface for Web…..…………………………………… 35
Fig 5.3 User Interface for App…..…………………………………… 36
Fig 5.4
Welcome Page for Web…..…………………………………… 38
Fig 5.5
Welcome Page for App…..…………………………………… 38
Fig 5.6
Registration Page for Web…..……………………………….. 39
Fig 5.7
Registration Page for App…..……………………………….. 39
Fig 5.8
OTP Page for Web…..………………………………………. 40
Fig 5.9
OTP Page for App…..……………………………………….. 40
Fig 5.10
41
Homepage for Web…..………………………………………
41
viii
Homepage for App……..……………………………………
ix
x
Fig 5.11 Filter Screen for Web…..…………………………………… 42 42 43
xi
Search Screen for Web…..…………………………………
xii
xiii
Fig 5.39 Profile picture Screen for App…..………………………… 56
A-2.2 Fig A- 83
Add station API in Postman….……………………………..
2.3 84
Station Details in pgAdmin.…………………………………
Fig A-2.4 84
i
Putty Server …………………………………………………
i
i
SYNOPSIS
Everyone these days knows the importance of saving fuel for the future
generations. If the fuel usage is not keep on by the people, it will be impossible
for future generations to even know what it was. As this thought is thriving
incredibly these days, the automobile brands are also trying to make innovations
that can lead us to save petrol on a vast scale. Keeping this idea in mind,
automobile companies have created a revolutionary idea of electric vehicles.
Electric Vehicles are the future of the automobile industry. The
companies manufacturing EVs have also set up charging stations across the
country where the people can plug in their electric vehicle (EV) to recharge its
batteries. These stations are typically found at public locations. Some EV
charging stations are free to use, while others may require a fee. There comes a
need for an application or a solution that helps in locating these charging stations
to the owners of such vehicles.
The Find Green – Electric Vehicle Charging Station Finder App is a
web application designed to help electric vehicle owners easily locate and
navigate to charging stations in their area. The app provides a user-friendly
interface for finding and selecting charging stations, as well as useful
information about each station, such as availability, charging speed, and cost.
This allows the user to book the available slots and make the payments online
and get notified.
Find Green – Electric Vehicle Charging Station Finder Project is a cross
platform system that will be used by EV owners. The solution is expected to
display the nearby charging stations, their details such as available slots, type of
connectors/plugs, charging types available, payment details.
xi
1 INTRODUCTION
1
As of now electric charging stations are limited in India due to which people
cannot find the right charging station which will save their time and money. EV
charging stations requires space like parks, malls, societies. For private and
semipublic charging stations, this space is available in the parking areas of the
societies, apartment buildings, or of commercial or public or institutional areas.
Due to this there is more difficulty for EV owners to find charging stations nearby
them.
The problem is not only to find the charging station but also to charge it
quickly because of the time required to charge the EV’s. This leads to inconvenience of EV
users as requires a lot of time, so need of slot booking is require in the charging of EV’s. As
electrical vehicle industry is growing in India and less charging stations are available and
also new registrations of charging station is growing, so there is no availability of these
growing charging station on virtual Maps. This leads to inconvenience of user for finding
charging station virtually.
When a customer buys an electric vehicle, the maintenance of these vehicle
is not like the ordinary cars. One have to seek some help such as an Electric
vehicle charging station finder system to find charging stations. An electric
vehicle charging station finder app can save the time to find these charging
station rather than search independently. One cannot find charging stations like
the petrol or diesel or CNG station which are available everywhere. Due to this
problem, the developers have to plan the charging of these vehicles, but with the
help of this apps which directly navigate the user to nearby EV charging stations.
In this project, the developers will design and develop an app and website
which will find nearby charging stations of users locality. The system will show
all nearby electric vehicle charging stations. The user can directly navigate to
this charging stations. This system will provide a facility of booking slots for
2
charging the Electric vehicle of the users based on the type and charging port of
their vehicle in their convenient time slots. This system will save a lot of time of
Electric vehicle owners.
The software and hardware needed for the development and implementation
of the application are discussed in the following sub-sections under hardware
requirements and software requirements.
RAM : 4GB
Backend : NodeJS
3
Database : PostgreSQL
2 SYSTEM ANALYSIS
• Limited personalization: An existing app may not have the ability to provide
personalized recommendations based on the user's past charging habits and
preferences.
• Usage tracker: Existing EV apps do not have any usage tracker for the users
making it less user friendly.
• Limited charging options: The existing apps only show charging stations for
certain networks or providers, which could limit the options for users.
• Limited information: Many of the existing apps do not provide all the
information that users need, such as the types of connectors available at a
charging station or the cost of charging.
• Slot Booking system: The users would be able to reserve charging spots in
advance, reducing the chances of arriving at a charging station only to find
all spots taken.
• Advanced features such as route optimization: An EV app can take into
account the remaining charge of the EV and also the location of charging
stations. This feature would allow the user to optimize the route and reach the
destination with the least amount of charge required.
4
• Personalized recommendations: The users would be able to receive
personalized recommendations for charging stations based on their past
charging habits and preferences.
The following are the modules that are required for the development of
this project. • Registration
• Navigation
• Notification
• Charging Stations
• Search
• Filter
• Slot Booking
• User Profile
• Charging History
• My Bookings
Registration:
The users should be able to register themselves and the users have to fill in
the sign up details. Users need to enter login details to access the application.
Notification:
The users will receive notifications for charging stations available, reminders
for the booking made etc.
Navigation:
5
With the help of GPS and Google Maps (APIs) users can track to find stations
nearby. Users can also get directions to the CS. Google Maps can be used to
navigate across the location.
Search for the Charging Station and Various filters can be used to sort the
available station.
Slot Booking:
The users can book the charger in a particular station for a particular date
and for specified amount of time.
Lists the details of all the available Charging Stations to book slots in
advance and the users charging history.
My Bookings:
Payments:
The users can have options to make payment via app using different payment
options like debit/credit card, wallets and others.
2.4.1 Node JS
Whenever a client requests something from the client side of the application
what happens is, the request is first sent to the server and then in that server
some processing goes on for the validation of the client side request and after
doing all such validation a response is sent to the client side. Basically for doing
all such calculations and processing , the NodeJs framework of JavaScript is
used.
6
For running the web applications outside the client’s browser , NodeJS
is basically used as an open-source and cross platform JavaScript runtime
environment. For running the server side applications the developers use this.
For building the I/O intensive applications like video streaming sites ,online
chatting applications and many other applications , it is used. Many established
tech giant companies and newly created start-ups are using NodeJs framework
in their company.
Node.js is an open-source, cross-platform JavaScript runtime
environment and library for running web applications outside the client's
browser. Developers use Node.js to create server-side web applications, and it
is perfect for data-intensive applications since it uses an asynchronous, event-
driven model.
Express is a flexible Node.js web application framework that provides
a wide set of features to develop both web and mobile applications. It's a layer
built on the top of the Node.js that helps manage a server and routes.
NPM is a popular Node.js package library and the jewel in the crown
of the Node.js community. It has millions of downloadable libraries, organized
according to specific requirements, and is the largest software registry in the
world. NPM is free. These libraries are growing fast to this very day, and they
strengthen the Node.js community.
Node.js has attracted the attention of businesses and organizations
from all sectors. This is hardly a surprise, considering its versatility and strong
community support. With adopters such as Netflix, Paypal, and other tech
companies, Node.js has seen an exponential increase in its use in web
development.
Fig 2.1 illustrates the nodejs code in the visual studio environment.
It also consists of express framework which is used with routers.
7
Fig 2.1 NodeJs Code
2.4.2 React Native
8
Fig 2.2 React Native Code
2.4.3 React JS
9
Fig 2.3 ReactJs Code
10
Android Studio uses an Apply Changes feature to push code and resource
changes to a running application. A code editor assists the developer with writing
code and offering code completion, refraction and analysis. Applications built in
Android Studio are then compiled into the APK format for submission to the
Google Play Store.
Android Studio is available for macOS, Windows and Linux desktop
platforms. It replaced Eclipse Android Development Tools (ADT) as the primary
IDE for Android application development. It is used to develop applications using
react native in this project.
2.5.3 PostgreSQL
The POSTGRES project aimed at adding fewest features like the ability to
define various data types and to fully describe relationships – something used
widely, but maintained completely by the end-user. POSTGRES used various
ideas of Ingres, but had its unique source code.
2.5.4 pgAdmin
11
The developers can use PGAdmin to do any Postgres database
administration tasks. Pgadming can be run as an web or desktop application. As
the developers put it, pgAdmin 4 is the latest version, and its development
involved a complete rewrite of the original pgAdmin tool. This version was
created using a combination of Javascript/jQuery and Python. Now, the users can
use pgAdmin as a desktop runtime or on a web application server, depending on
your use case. No matter how the user run pgAdmin 4, the users will find that it
easily accepts one or more users and creates an environment that looks and feels
like a desktop application.
While it's possible to accomplish these same things without pgAdmin, the
value of this tool is that it provides a user-friendly data administration interface
for the users to handle SQL queries, maintenance, and other necessary processes
without using command line prompts.
Fig 2.4 illustrates the pgAdmin screen. It contains all the databases, tables etc.
Here all the input from the users are stored in the particular tables of the database.
The data can be retrieved from the tables of the database. The developers can
add, update, delete and view the data in the database. Here it illustrates show the
charging station details of the project.
12
Fig 2.4 pgAdmin screen
2.5.5 Postman
Postman is one of the most popular software testing tools which is used for
API testing. With the help of this tool, developers can easily create, test, share,
and document APIs.
Postman is one of the most popular software testing tools which is used for
API testing. With the help of this tool, developers can easily create, test, share,
and document APIs. This tool has the ability to make various types of HTTP
requests like GET, POST, PUT, PATCH, and convert the API to code for
languages like JavaScript, Nodejs, Python etc.
Fig 2.5 illustrates the postman screen. Here the developers can create the
APIs and pass the values of the input into the database. The developer the use
the methods like POST to add data into the database, GET to get the values from
the database, DEL to delete the data in database, PATCH to update the data in
database etc.
13
2.5.6 Visual Studio Code
Visual Studio Code is a code editor in layman’s terms. Visual Studio Code is
“a free-editor that helps the programmer write code, helps in debugging and
corrects the code using the intelli-sense method. In normal terms, it facilitates
users to write the code in an easy manner. Many people say that it is half of an
IDE and an editor, but the decision is up to the coders. Any program/software that
the developers see or use works on the code that runs in the background.
Traditionally coding was used to do in the traditional editors or even in the basic
editors like notepad! These editors used to provide basic support to the coders.
VI Editor, Sublime Text Editor, is one of the many kinds of editors that came
into existence. The most prominent and which supports almost every coding
language is VISUAL STUDIO CODE. Its features let the user modify the editor
as per the usage, which means the user is able to download the libraries from the
internet and integrate it with the code as per his requirements.
14
projects. GitHub also serves as a social networking site where developers can
openly network, collaborate, and pitch their work. This free service comes with
several helpful features for sharing code and working with others in real time.
While anyone can code independently, teams of people build most
development projects. Sometimes these teams are all in one place at once time,
but more often they work asynchronously. There are many challenges to creating
collaborative projects with distributed teams. The company creates a GitHub link
in which all the developers push their code and pull it anytime.
15
commands directly to the remote computer. With regards to cut and paste features,
PuTTY can be customized to act similarly to xterm.
It is easier to configure and is more stable. It is also more persistent in
comparison to others, as a remote session can be resumed as soon the connection
is restored after an interruption. It has an easy-to-use graphical user interface.
Some terminal control sequences like the Linux console sequences which are
unsupported by xterm are supported by PuTTY.
The user can click the login button to go to the login page if they already
have an account or else they can click the register button which will take the user
to the registration page.
The user can register by entering their first and last name, email id and
mobile number and click ‘Create Account’ button. It will take the user to the OTP
page. After clicking the ‘Create Account’ button in the registration page, it gets
directed to this otp page. The user gets opt to their mobile number and email id.
16
They should enter the correct opt to confirm their registration. Once registered,
the user can login and gets directed to the Homepage.
The user can filter the stations based on the charger type, availability,
vehicle type, distance, connector type, favourite station, fast changing etc or
search the station based on the address, name, area, city, pincode etc. Once Apply
button is clicked, it list the station details based on the filters applied. The station
details includes the station name, place, city, working hours, status, available
connectors, connector types, rate etc. Here the user can add the station as
favourite station or share the station to others or navigate to the station. The
stations will be viewed either in the list format or map view.
Once the user selects a station in the Station page it displays the station
name, place, working hours, connector type, charger type, capacity, tariff,
amenities, date and time pickers etc. Here the user can book a slot by selecting
the date, time and duration. Once chosen, the user click proceed, which will take
the user to the payment page.
It will display the amount to be paid and the methods of payment. Here
the user should select the payment method and proceed with payment. If the
payment is done successfully and if the slot is free then the slot gets booked and
shows success message. If the payment is not successful or if the slot is not free
then the slot doesn’t get booked and it shows the booking failure page.
Once the booking and payment is completed successfully, it will take the
user to the homepage. This is the workflow of the project. Fig 3.1 illustrates the
workflow diagram of the project.
17
Fig 3.1 Project Workflow
3.2 Table Design
Table 3.1 gives the user_id (primary key), name, email, phone_no,
country,postal_code, vehicle_model, vehicle_no, connector_type, profile_pic and
status. The values which the users enter in the Registration page like first and last
name, email id, mobile number and in My Profile Page like vehicle type, country,
connector type, profile picture is stored in this table.
19
station_id int Primary Key
20
Date Date Not Null
Table 3.4 gives the fave_id (primary key),user_id (foreign key) and
station_id (foreign key). This table is used to display the favourite stations of a
particular user in the Favourites page. So this table is linked to station table and
user table.
Table 3.5 gives the user_id (foreign key) and booking_id (foreign key). This
table is used to display the Charging history of a particular person. This table is
21
linked with the user table and booking table. It gets the value from these values
and displays it.
22
Fig 3.2 Table Design
4 MODULE DESIGN
4.1 Registration
23
The user can click the login button to go to the login page if they already
have an account or else they can click the register button which will take the user
to the registration page.
The user can register by entering their first and last name, email id and
mobile number and click create account button. It will take the user to the OTP
page. After clicking Create Account button in the registration page, it gets directed
to this otp page. The user gets opt to their mobile number and email id. They
should enter the correct opt to confirm their registration. Once registered, the user
can login and gets directed to the Homepage. Fig 4.1 illustrates the flowchat of
the registration.
The user can filter the stations based on the charger type, availability,
vehicle type, distance, connector type, favourite station, fast changing etc or
search the station based on the address, name, area, city, pincode etc. Once Apply
button is clicked, it list the station details based on the filters applied. The station
details includes the station name, place, city, working hours, status, available
24
connectors, connector types, rate etc. Here the can add the station as their favourite
station or share the station to others or navigate to the station. The stations will be
viewed either in list format or map view. Fig 4.2 the flowchat of the search and
filter.
The user can click the login button to go to the login page if they already
have an account or else they can click the register button which will take the user
to the registration page. Once registered, the user can login and gets directed to
the Homepage.
The user can filter the stations. Once Apply button is clicked, it list the
station details based on the filters applied. Once the user selects a station in the
Station page it displays the station details. Here the user can book a slot by
25
selecting the date, time and duration. Once chosen, the user click proceed, which
will take the user to the payment page.
It will display the amount to be paid and the methods of payment. Here
the user should select the payment method and proceed with payment. If the
payment is done successfully and if the slot is free then the slot gets booked and
shows success message. If the payment is not successful or if the slot is not free
then the slot doesn’t get booked and it shows the booking failure page. Once done
it will take the user to the homepage.
Fig 4.3 illustrates the flowchat of the slot booking process in the find green
project.
26
Fig 4.3 Slot Booking Flowchart
4.4 Charging History
It shows the charging history of the user. It shows the details of the
completed or cancelled booking of the user. It displays the details like the date
and time, station name, user ratings, slot, time, completed or cancelled status etc.
It also contains filter option using which the user can view the history based on
days, months or years. Fig 4.4 illustrates the flowchat of the charging.
27
Fig 4.4 Charging History flowchart
4.5 My Bookings
If the user chooses upcoming bookings, it displays the details like the date
and time, station name, payment method, slot, time etc.
If the user chooses cancelled bookings, it displays the details like the date
and time, station name, payment method, slot, time etc. The user can book the same
station by clicking the station name. Fig 4.5 illustrates the flowchat of the my
booking.
28
Fig 4.5 My Booking Flowchart
4.6 My Payment
The user can add their payment methods like card details or recharge
money to their wallet, add the gpay account etc. The user can also remove the
payment methods by clicking the ‘Remove’ button. The users can have options to
make payment via app using different payment options like debit/credit card,
wallets and others. Fig 4.6 illustrates the flowchat of the my payment.
29
Fig 4.6 My Payment Flowchart
5 USER INTERFACE AND EXPERIENCE
The user interface is the point at which human users interact with a
computer, website or application. The goal of effective UI is to make the user's
experience easy and intuitive, requiring minimum effort on the user's part to
receive the maximum desired outcome.
User interface is important to meet user expectations and support the
effective functionality of your site. A well-executed user interface facilitates
effective interaction between the user and the program, app or machine through
contrasting visuals, clean design and responsiveness.
30
User interfaces can be visualized in many ways and in many degrees of
fidelity. On the web user interfaces are usually rendered as HTML & CSS, and in
native applications using native or custom libraries. A design system is often
visualised as a collection of UI elements that define a guideline for building a user
experience within a given platform.
When designing a UI for the site, it's important to consider the user's
expectations in terms of accessibility, visual aesthetic and ease of use. An optimal
mix of effective visuals and efficient responsiveness will improve our site's
conversion rates, as it anticipates the needs of the user and then satisfies those
needs.
In this project, the wireframes created using the whimsical website. All the
web design and app design was designed in that site.
5.1.1 Whimsical
31
Fig 5.1 User Interface for Web
The implementation activity begins with the creation of prototype (model)
that enables usage scenarios to be evaluated. As iterative design process continues
a User Interface toolkit that allows the creation of windows, menus, device
interaction, error messages, commands, and many other elements of an interactive
environment can be used for completing the construction of an interface.
32
Fig 5.2 User Interface for App
5.2 User Experience
User experience (UX) design is the process design teams use to create
products that provide meaningful and relevant experiences to users. UX design
involves the design of the entire process of acquiring and integrating the product,
including aspects of branding, design, usability and function.
Since UX design encompasses the entire user journey, it’s a
multidisciplinary field–UX designers come from various backgrounds such as
visual design, programming, psychology and interaction design. To design for
human users also means working with a heightened scope regarding accessibility
and accommodating many potential users’ physical limitations, such as reading
small text.
A UX designer’s typical tasks vary but often include user research,
creating personas, designing wireframes and interactive prototypes, and testing
designs. These tasks can vary significantly from one organization to the next.
33
In this project, to design the user experience design for both website and
app, the tool called Adobe XD was used.
5.2.1 Adobe XD
Fig 5.3 illustrates the welcome page of the website and Fig 5.4 illustrates
the welcome screen of the app.This page appears once the user opens the app or
the website. Here the user can click the login button to go to the login page if they
already have an account or else they can click the register button which will take
the user to the registration page.
34
Fig 5.4 Welcome Page for App
5.3.2 Registration Page
Fig 5.5 illustrates the registration page of the website, Fig 5.6 illustrates the
registration screen of the app.Here the user can register by entering their first and
last name, email id and mobile number and click create account button. It will take
the user to the OTP page. If the user already has an account, the user the click
Login hyperlink to go to the login page.
35
Fig 5.6 Registration Page for App
Fig 5.7 and 5.8 illustrates the otp page of the website and app. After clicking
Create Account button in the registration page, it gets directed to this otp page. The
user gets opt to their mobile number and email id. They should enter the correct
opt to confirm their registration. If they didn’t receive their otp, they can click
Resend OTP hyperlink to get the otp again. If the user wants to change their details
the can click Go Back button to go back to the registration page.
36
Fig 5.8 OTP Page for App
5.3.4 Homepage
Fig 5.9 and 5.10 illustrates the homepage of the website and app. Here the user
can choose any option. If the user clicks My Profile it gets directed to profile page.
If the user clicks ‘My Bookings’ it shows details about the user bookings. If the user
clicks ‘Charging history’ it shows the user’s charging history. If the user clicks
‘Payment’ it shows the payment details. If the user clicks Favourite station it shows
the list of favourite stations. If the user clicks Logout it gets directed to Login page.
37
Fig 5.10 Homepage of App
Fig 5.11 and 5.12 illustrates the filter page of the website and app. Here the
user can filter the stations based on the charger type, availability, vehicle type,
distance, connector type, favourite station, fast changing etc. Once Apply button
is clicked, it list the station details based on the filters applied. If the Clear button
is clicked, it will clear all the applied filters.
38
Fig 5.12 Filter Screen for App
Fig 5.13 and 5.14 illustrates the station page of the website and app. It displays
the station details based on the filters applied. The station details includes the
station name, place, city, working hours, status, available connectors, connector
types, rate etc. Here the can add the station as their favourite station or share the
station to others or navigate to the station. The stations will be viewed either in list
format or map view.
39
Fig 5.14 Station Screen for App
5.3.7 Booking Page
Fig 5.15 and 5.16 illustrates the booking page of the website and app. The
page appears when the user selects a station in the Station page. This page displays
the station name, place, working hours, connector type, charger type, capacity,
tariff, amenities, date and time pickers etc. Here the user can book a slot by
selecting the date, time and duration. Once chosen, the user click ‘Proceed’ button,
it will take the user to the payment page or the user can cancel using the Cancel
button.
40
Fig 5.16 Booking Screen for App
Fig 5.17 and 5.18 illustrates the payment page of the website and app. Once
the slot is selected it gets directed to the payment page. It will display the amount
to be paid and the methods of payment. Here the user should select the payment
method and proceed with payment. If the payment is successful it will show
success screen or it will show the failure screen.
41
Fig 5.18 Payment Screen for App
5.3.9 Booking Success/Failure Page
Fig 5.19 and 5.20 illustrates the booking success/failure page of the website
and app. If the payment is done successfully and if the slot is free then the slot gets
booked and shows success message. If the payment is not successful or if the slot
is not free then the slot doesn’t get booked and it shows the booking failure page.
Once payment is done it will take the user to the homepage.
42
Fig 5.20 Booking Failure Screen for App
5.3.10 My Profile Page
Fig 5.21 and 5.22 illustrates the My profile page of the website and app.
Here the user can edit their details like their first and last name, email id, mobile
number, vehicle type, country, connector type etc. The user can add their profile
picture by clicking the plus sign or remove the picture by clicking the X sign. The
user should click Save to save the user details and it takes the user to the homepage.
43
Fig 5.22 My Profile Screen for App
5.3.11 My Booking Page (Upcoming Bookings)
Fig 5.23 and 5.24 illustrates the upcoming booking page of the website and
app. This page displays the user’s upcoming bookings. It displays the details like
the date and time, station name, payment method, slot, time etc. The user can book
the same station by clicking the station name. The user can cancel the booking by
clicking the Cancel hyperlink.
44
Fig 5.24 Upcoming Booking Screen for App
Fig 5.25 and 5.26 illustrates the user’s cancelled bookings. It displays the
details like the date and time, station name, payment method, slot, time etc. The
user can book the same station by clicking the station name. The user can also book
the station again by clicking the Visit Again hyperlink.
45
Fig 5.26 Cancelled Booking Screen for App
5.3.13 Charging History Page
Fig 5.28 and 5.29 illustrates the charging history page of the website and
app. This page shows the charging history of the user. It shows the details of the
completed or cancelled booking of the user. It displays the details like the date and
time, station name, user ratings, slot, time, completed or cancelled status etc. It also
contains filter option using which the user can view the history based on days,
months or years.
46
Fig 5.28 Charging History Screen for App
5.3.14 Manage Payment Page
Fig 5.29 and 5.30 illustrates the manage payment page of the website and
app. Here the user can add their payment methods like card details or recharge
money to their wallet, add the gpay account etc. The user can also remove the
payment methods by clicking the Remove button.
47
Fig 5.30 Manage Payment Screen for App
5.3.15 Favourite Page
Fig 5.31 illustrates the favourites page of the website and app. This page
displays the list of favourite stations added by the user. The station details includes
the station name, place, city, working hours, status, available connectors,
connector types, rate etc. Here the user can remove favourite station or share the
station to others or navigate to the station. The stations will be viewed either in the
list format or map view.
48
Fig 5.31 Favourite Station Screen for App
5.3.16 Notification Page
Fig 5.32 illustrates the notification page of the website and Fig 5.33 illustrates
the notification screen of the app.This page displays the notifications like
successful booking or reminding about the booking, payment successful or
payment failure, refund amount etc.
49
Fig 5.32 Notification Screen for Web
Fig 5.34 and 5.35 illustrates the rating screen of the website and app. This
screen appears after the successful booking a slot in the station. It displays five
stars meaning that the user should rate the station in the range of 1 to 5. The user
can ignore it by clicking Cancel button. Once the stars are clicked, the user can
click the Submit button. It will go the success page.
50
Fig 5.34 Rating Screen for Web
Fig 5.36 and 5.37 illustrates the search page of the website and app. Here the
user can search the station based on the address, name, area, city, pincode etc. Once
Allow button is clicked, it list the station details based on the filters applied. If the
user clicks the Cancel button, it will not search the station and goes to the homepage.
The user can also search the stations by clicking ‘Use current location’. It will show
the nearby stations.
51
Fig 5.36 Search Screen for Web
Fig 5.38 and 5.39 illustrates the My profile page of the website and app. The
user can add their profile picture by clicking the plus sign or remove the picture by
clicking the X sign. When the plus sign is clicked, the user will ask whether to
choose the picture from the camera or gallery. Once that is clicked, the user can
choose any picture and click Ok. The user should click Save to save the user details
and it takes the user to the homepage.
52
Fig 5.38 Profile picture Screen for Web
6.1 Testing
53
Software testing can also provide an objective, independent view of the
software to allow the business to appreciate and understand the risks of software
implementation. Test techniques include, but are not limited to the process of
executing a program or application with the intent of finding Software Bugs.
Testing is vital to the success of the system. System testing marks a logical
assumption that all the parts of the system are correct; the goal successfully
achieved. Special test data is input for processing and the results are examined to
locate unexpected results.
NodeJS unit testing refers to testing individual units or components of a
Node.js application using specialized automation testing frameworks and libraries.
These tests can include testing the functionality of individual functions, modules,
or classes and the interactions between different parts of the application. Some
popular NodeJS unit testing frameworks include Jest, Mocha, and AVA.
54
This also provides an added advantage to the users in the way that they can add any
new features without breaking any other part of their application. For the NodeJS
applications, Jest can be used for Unit Testing.
6.3 JEST
Jest Features:
• isolated tests: Jest tests are run parallelly to improve run time.
Fig 6.1 illustrates the code coverage percentage for testing the project code
using the jest in visual studio code teminal.
55
Fig 6.1 Code Coverage
56
have to follow the proper sequence. Exposing the defects is the major focus of the
integration testing and the time of interaction between the integrated units.
Since testing is the common thing, there are a number of libraries and tools
such as JSUnit, Unit.js, QUnit, Jasmine, Karma, Mocha, Chai etc…
Mocha and Chai are two JavaScript frameworks commonly used together
for unit testing. Mocha is a testing framework that provides functions that are
executed according in a specific order, and that logs their results to the terminal
window.
When the tester read tests written in Mocha, the tester will see regular use
of the keywords describe and it. These keywords, provided by Mocha, provide
structure to the tests by batching them into test suites and test cases.
A test suite is a collection of tests all relating to a single functionality or
behavior. A test case or a unit test is a single description about the desired behavior
of the code that either passes or fails. Test suites are batched underneath the describe
keyword, and test cases are batched under the it keyword.
Additionally, Mocha provides tools for cleaning the state of the software
being tested in order to insure that test cases are being run independently of each
other. The tester might end up using other tools, to stub or mock the desired
behaviors of other units that a given unit of code might interact with. The
independence of test cases is a key principle of unit testing, as it allows the cause
of errors to be pinpointed more specifically if a test case fails, thereby speeding up
the debugging process.
The following are the few test cases for Create station API. Here in the first
test condition, it is written for successful creation and it returns 201 code meaning
that the station is created. In the second test condition, it is written for invalid access
token. When an invalid token is passed or if token is missing, it will throw the 400
error. In the third test condition, it is written for invalid input like pincode has less
than 6 characters. So if user gives pincode with less than 6 characters, it will throw
57
the 400 error. The remaining test cases are in Appendix 1 under
station.controller.test.js
// test cases
describe('createStation', () => {
let newStation;
test('should return 201 and successfully create new station if data is ok', async ()
=> {
newStation = {
station_name: "shell ev charging station",
station_address: "professor colony",
station_area: "seliyur", station_city:
"chennai", station_pincode: "620082",
station_latitude:"27.28",
station_longitude:"29.6",
station_working_time: "5-11",
station_available_connector: "3",
station_connector_type: "AC Type 1",
station_charger_type: "ac",
station_charging: "fast",
station_vehicle_type: "bike",
station_status: "available"
};
58
});
await request(app).post('/v1/station/add-station')
.set('x-access-token', `${token}`)
.send().expect(400);
});
test('should return 400 error if pincode length is less than 6 characters', async ()
=> {
newStation = {
station_name: "shell ev charging station", station_address:
"professor colony", station_area: "seliyur", station_city:
"chennai", station_pincode: "89065",
station_latitude:"27.28", station_longitude:"29.6",
station_working_time: "5-11",
station_available_connector: "3", station_connector_type:
"AC Type 1", station_charger_type: "ac",
station_charging: "fast", station_vehicle_type: "bike",
station_status: "available"
};
await request(app)
.post('/v1/station/add-station')
.set('x-access-token', `${token}`)
.send(newStation)
.expect(201);
});
});
59
7 SYSTEM INTEGRATION AND DEPLOYMENT
7.1 Integration
60
Fig 7.1 Integration Code
7.2 Deployment
If the developer want the ability to make changes without these affecting
your live website, then you can add additional environments. These environments
are called development environments or deployment environments. The additional
development environments will typically be a local environment, a development
environment, and a staging environment (also known as a staging site). Once this
deployment process has been completed the new changes will be visible in the live
environment.
8 CONCLUSION
8.2 Implementation
• Station Maintenance and Repair Notifications: The app can notify users
when charging stations are undergoing maintenance or are out of service,
helping them plan their charging needs accordingly.
• Personalized Charging Recommendations: The app can use data on
users' driving habits and vehicle battery status to provide personalized
charging recommendations and alerts.
62
APPENDICES
//station_model.js
63
false, validate: { notEmpty:
true,
},
}, station_pincode: {
type: DataTypes.REAL,
unique: false, allowNull:
false, validate: {
notEmpty: true,
}, }, station_latitude: {
type: DataTypes.REAL,
unique: false, allowNull:
false, validate: {
notEmpty: true,
},
}, station_longitude:
{ type:
DataTypes.REAL,
unique: false,
allowNull: false,
validate: {
notEmpty: true,
},
},
station_working_time: {
type: DataTypes.STRING,
unique: false, allowNull:
false, validate: {
notEmpty: true,
},
}, station_available_connector:
{
type: DataTypes.STRING,
unique: false, allowNull:
64
false, validate: {
notEmpty: true,
},
}, station_connector_type:
{
type: DataTypes.STRING,
unique: false, allowNull:
false, validate: {
notEmpty: true,
},
},
station_charger_type: {
type: DataTypes.STRING,
unique: false, allowNull:
false, validate: {
notEmpty: true,
},
}, station_charging: { type:
DataTypes.STRING,
unique: false, allowNull:
false, validate: { notEmpty:
true,
},
}, station_vehicle_type:
{
type: DataTypes.STRING,
unique: false, allowNull:
false, validate: {
notEmpty: true,
}, }, station_status: { type:
DataTypes.STRING,
unique: false, allowNull:
false, validate: { notEmpty:
true,
},
65
},
},
{ timestamps:
false,
}
);
return station;
};
module.exports = Station;
//station_controller.js
if (!station) {
throw new ApiError(httpStatus.NOT_FOUND, 'Station not found');
}
logger.info(station); res.send(station);
});
});
module.exports = {
createStation,
searchStations,
filterStations,
getStation,
deleteStation,
updateStation,
nearStation,
findStations,
};
//station.controller.test.js
69
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjksImlhdCI6MTY3ODIx
MTk2NCwiZXhwIjoxNjgwODAzOTY0LCJ0eXBlIjoicmVmcmVzaCJ9.dR5gfE
vc7TjyBghK3gBvfdGgs7TWD9ajZklK7hqPUiA';
describe('createStation', () => {
let newStation;
test('should return 201 and successfully create new station if data is ok', async
() => { newStation
={
station_name: "shell ev charging station",
station_address: "professor colony",
station_area: "seliyur", station_city:
"chennai", station_pincode: "620082",
station_latitude:"27.28",
station_longitude:"29.6",
station_working_time: "5-11",
station_available_connector: "3",
station_connector_type: "AC Type 1",
station_charger_type: "ac",
station_charging: "fast",
station_vehicle_type: "bike",
station_status: "available"
};
const res = await request(app)
.post('/v1/station/add-station')
.set('x-access-token', `${token}`)
.send(newStation)
.expect(201);
});
});
describe('getStation', () => {
test('should return 200 and the station object if data is ok', async () => {
70
let stationId=450;
const res = await request(app)
.get(`/v1/station/getStation/${stationId}`)
.set('x-access-token', `${token}`)
.send()
.expect(() => { if
(!stationId) {
throw new ApiError(httpStatus.NOT_FOUND, 'Station not found');
} else
expect(404);
});
});
});
describe('deleteStation', () => {
.set('x-access-token', `${token}`)
.send(updateBody)
.expect(201);
}
});
});
});
describe('searchStations', () => {
72
test('should return 200 and the station object if data is ok', async () => {
.get(`/v1/station/searchStations?stationSearch=${stationSearch}&station_pincode
=${station_pincode}`)
.set('x-access-token', `${token}`)
.send()
.expect(200);
});
});
describe('findStations', () => {
test('should return 200 and the station object if data is ok', async () => {
let stationSearch="tambaram";
let station_pincode=620081; let
station_vehicle_type= "car"; let
station_charger_type="dc"; let
station_connector_type= "AC
Type 2"; let station_status=
"busy"; let station_charging=
"slow"; const res = await
request(app)
.get(`/v1/station/findStations?stationSearch=${stationSearch}&station_pincode=$
{station_pincode}&station_vehicle_type=${station_vehicle_type}&station_charg
er_type=${station_charger_type}&station_connector_type=${station_connector_t
ype}&station_status=${station_status}&station_charging=${station_charging}`)
.set('x-access-token', `${token}`)
.send()
.expect(200);
});
73
});
describe('filterStations', () => {
test('should return 200 and the station object if data is ok', async () => {
describe('nearStations', () => {
let nearby;
test('should return 200 and the station object if data is ok', async () => {
nearby={
latitude:"20.28",
longitude:"24.6",
maxDistance: 50,
74
}
Postman Screen
75
Fig A-2.2 Add station API in Postman
pgAdmin Screen
Putty Server
76
Fig A-2.4 Putty Server
REFERENCES
[1] https://www.tutorialspoint.com/nodejs/nodejs_express_framework.htm
[2] https://www.tutorialspoint.com/nodejs/nodejs_restful_api.htm
[3] https://www.baeldung.com/postman-upload-file-json
[4] https://www.tutorialspoint.com/postgresql/postgresql_expressions.htm [5]
https://www.digitalocean.com/community/tutorials/how-to-use-sequelize- with-
node-js-and-mysql
77