0% found this document useful (0 votes)
12 views73 pages

Felipe Cunha - HDIP Final Project Report

Uploaded by

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

Felipe Cunha - HDIP Final Project Report

Uploaded by

Mala Badj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

GER’S GARAGE

Felipe Cunha
ABSTRACT

This is a project thought and developed at the very end of the last semester of the Higher
Diploma in Science Computing course at CCT College. The students were given a booking system
scenario to work on and that’s where Garage system was. The idea of project is to create the
web system where carries out maintenance for all kinds of small to medium vehicles (i.e.
motorbikes, cars, small vans and small buses).Allowing the clients make the book online will help
the garage system manager the book for each mechanic has, will help the client/ staff save time
given details about the problems before the vehicles arrived the garage.

FELIPE DA SILVA CUNHA


2
ACKNOWLEDGEMENTS
I would like to express my heartfelt gratitude to Ken and Aldana, my research advisor, for their
invaluable guidance, insightful feedback, and unwavering support throughout the course of this
project. Their expertise and encouragement have been instrumental in shaping the direction of
my research. Special thanks to classmates for their stimulating discussions and [specific
assistance], which significantly contributed to the development of my ideas. I am grateful to CCT
college for providing access to the library, laboratory that was essential for the successful
completion of this project

FELIPE DA SILVA CUNHA


3
TABLE OF CONTENTS

CHAPTER 1 ......................................................................................................... 6
I. Project context:............................................................................................ 6
II. Why is it a good project? ............................................................................. 7
III. Main goal ................................................................................................... 7
IV. Objectives.................................................................................................. 7
V. AREAS TO COVER ...................................................................................... 7
VI. Personal Challenges .................................................................................. 8
PLANE ................................................................................................................. 9
Chapter 2.......................................................................................................... 10
Literature Review............................................................................................. 10
DATABASE ........................................................................................................ 12
VII. CHAPTER III ............................................................................................ 12
SYSTEM ANALYSIS & DESIGN .......................................................................... 12
FUNCTIONAL REQUIRENMENTS ...................................................................... 12
Main requirements: .......................................................................................... 13
User interface Diagrams: ................................................................................. 33
DATA REQUIRENMENTS: .................................................................................. 35
Diagrams & Design........................................................................................... 36
CONCEPTUAL DESIGN ...................................................................................... 36
PHYSICAL DESIGN ........................................................................................... 39
How I decided created all those table: ............................................................ 40
Functional design: ............................................................................................ 41
CHAPTER IV: IMPLEMENTATION OF THE SYSTEM ........................................... 44
IMPLEMENTATION OF THE SYSTEM: ............................................................... 47
The main logical of system............................................................................... 54
Book service ..................................................................................................... 54
Print invoice ..................................................................................................... 56
Spring security ................................................................................................. 58

FELIPE DA SILVA CUNHA


4
VIII. CHAPTER V:TESTING & EVALUATION ..................................................... 59
CHAPTER VI: CONCLUSIONS & FURTHER WORK ............................................. 67
FURTHER WORK ............................................................................................... 68
APPENDIX A: CLASS DIAGRAM ........................................................................ 69
APPENDIX B: LINK GITRUB ............................................................................. 70
REFERENCES .................................................................................................... 72

FELIPE DA SILVA CUNHA


5
CHAPTER 1

INTRODUCTION
I. PROJECT CONTEXT:

Due to Ger has small garage and has no web system to control the book. Ger need to manage
the books of car/van/bus/motorbike and make the scheduling for the staff, check how many
books he has by day or week. This system will be helpful because at moment the client does not
have any book online.

In contact with the customer was made a survey of requirements and needs the
systems, the functionalities that will contain the system:

➢ The system will have tree types of user: ADM,MECHANIC,CLIENT.


➢ Privileges of ADM user:
 Able to allocate vehicle’s book to each mechanic;
 Able to see/delete/ all the clients/mechanic/ADM
registered on system;
 Able to see/cancel all the vehicle’s booked;
 Able to add new ADM/MECHANIC user if there is need;
 Able to view bookings for any particular day OR week;
 Able to print the invoice when the book is completed.
 Edit his profile;

➢ Privileges of MECHANIC user:


 Able to update the status vehicle’s book;
 Able to add cost the vehicle’s book if there is need.
 Able to see all the vehicle’s booked;

➢ Privileges of CLIENT user:


 Able to register on system;
 Able to add vehicle/van/car/bus/motorbike;
 Able to edit/cancel the book.
 Able to see all the book has done by himself;
 Able to see/edit/delete all the vehicle registered by himself
on the system.
➢ All the types of user can edit their profile/make login/make logout.
➢ When whoever user make the register they have to provide
details/Name, phone Number, address, ,email, password.
➢ Only the mechanic has inform the PPSno.

FELIPE DA SILVA CUNHA


6
II. WHY IS IT A GOOD PROJECT?

Through this garage web system it will be possible to keep the user data and make
contact when necessary and pass updates on the service through the website or even
accessing the customer details making direct contact.
The system will make a biting of the history of the car, this will help a lot to solve current
mechanical problems of the vehicle.
With the functionality of scheduling online services will avoid an over load of demand
of the mechanics being able to meet the deadline for delivery of the vehicle. With the
possibility of checking the status of the service will pass a greater confidence to the
customer about the service being provided.
In the future this system can provide reports with average service time, which procedure
are being more expensive for the Garage. This can be able to make strategic decisions to
improve the business.

III. MAIN GOAL

Develop the web system where the user can make book for his vehicle.

IV. OBJECTIVES

➢ Research of technologies and review of previous concepts;


➢ Define design and diagrams of the project;
➢ DB connection;
➢ Connect the Front-end with Back-end.;
➢ Complete final report.

V. AREAS TO COVER

I have to decided to develop the system in Java and the technologies that will be covered are
listed below:

• Spring boot;
• Spring security;
• Model-View-Controller (MVC) as architectural pattern;
• Apache Tomcat as Web server tool, to provide a HTTP web server environment;
• Bootstrap framework;
• Java Script – Validation the label and give the message to users.
• HTML;
• Thymeleaf;
• MYsql;
• Password Hashing;
• Programming logic;
FELIPE DA SILVA CUNHA
7
• Relational Database (MySQL), to store the data of the program;
• Project planning techniques such as Gantt Charts;

VI. PERSONAL CHALLENGES

The biggest challenge for me was thinking about how I was going to make a front-to-
back connection and then tie an object into the database. Front-end is not a technology
that I don't have much knowledge of.
So I started researching some framework most used in java programming. So I decided
to make use of Spring Boot. My initial plan was to create a small project to get to know
me the framework. After that I started the Garage project. There was a lot of difficulty in
issues of configuration of the environment, entered how the dependencies work, it took a
long time to be able to generate the tables in the bank due to the version of java. Every
unexpected mistake I could count on colleagues and chats in the internet of people who
went through error that I went through.

FELIPE DA SILVA CUNHA


8
PLANE

It was used Gantt Charts for manager the task by the time and see how long each task took for
developed. The tool provide the deadline about each task and is easy update.

Illustration 1:plan

FELIPE DA SILVA CUNHA


9
CHAPTER 2

LITERATURE REVIEW

The aim of this chapter is to present all academic research carried out throughout the
project cycle. It is important that learners produce research that defends their
justifications for choosing one from of technology or software over another, and other
sources of information that have helped inform the individuals thinking, planning and
delivery of the project.

➢ Java maven project;


➢ MVC Spring boot;
➢ Data base.

I have done a research and I have done networking with who work as developer
in Java. Accordingly with I get spring boot is framework from Java really helpful
building the project. Could be hard in the beginner who never has used before but
will save time in the future because many configuration It is already done by
Spring boot for example the server. By the way I have decide used Java because I
have more skills and one of the language that was taught during the course. Due
to deadline really short I thoughted was better chose some technology that I
have more skills.

In the beginner I have to created small project Spring Boot just for to know how
structure od project works.

Illustration 2:Strucure of Spring Boot

➢ Spring WEB: belong of Spring framework that It is the platforms Java made for get easy
the develop of applications. The Spring web give components for to build apps web in
Java and give many library help with develop the application:

▪ Spring Web includes the Spring MVC module, which is an


implementation of the Model-View-Controller design pattern. It helps in
separating concerns in web applications by dividing them into three

FELIPE DA SILVA CUNHA


10
main components: Model (data and business logic), View (user
interface), and Controller (handles user requests and coordinates the
flow).
▪ Web Controllers: Spring provides annotations such as @Controller
and @RestController, which simplify the process of creating request-
handling controllers. These controllers can handle different types of
requests (GET, POST, PUT, DELETE, etc.) and map them to
corresponding methods.
▪ View Resolvers: Spring Web supports various view resolvers, allowing
you to easily integrate different view technologies, such as JSP,
Thymeleaf, and FreeMarker. These view resolvers resolve the logical
view names returned from the controllers to actual view templates.
▪ Data Binding: Spring Web facilitates data binding between HTML
form fields and Java objects. It automatically maps incoming request
parameters to Java object properties and vice versa, simplifying form
handling.
➢ JPA is a Java specification that provides a standard way to interact with relational
databases using Object-Relational Mapping (ORM). It allows developers to map Java
objects (entities) to database tables and provides an abstraction layer to perform CRUD
(Create, Read, Update, Delete) operations on the database without writing explicit SQL
queries. JPA implementations such as Hibernate, EclipseLink, and OpenJPA provide the
concrete implementations of the JPA specification.
Key concepts in JPA include:
▪ Entities: Java classes annotated with @Entity that represent database
tables.
▪ Persistence Context: The first-level cache of JPA that manages the
lifecycle of entities and tracks changes.
▪ Entity Manager: An interface to interact with the persistence context
and perform database operations.
▪ JPQL (Java Persistence Query Language): A query language
similar to SQL, but it operates on JPA entities rather than database
tables.

How the JPA works with Spring boot?

When using JPA with Spring Boot, you can leverage the built-in support for JPA entities and
data access. By adding the necessary dependencies, Spring Boot automatically configures the
data source, entity manager, and transaction management, making it easy to perform database
operations using JPA.

To use JPA with Spring Boot, you typically:

▪ Define JPA entities using @Entity annotations on Java classes that means each class
that will have annotations @Entity will become tables on database.
▪ Create a data source configuration in the application.properties or application.yml file
for make the connection java with data base.

FELIPE DA SILVA CUNHA


11
▪ Use Spring Data JPA repositories or create custom data access components to interact
with the database like find all the client by ID.
▪ Let Spring Boot handle the rest, including managing the entity manager, transaction
handling, and connection to the database.

Source: https://www.michellibrito.com/

DATABASE

I have decide to user MYsql due to had to work with it for 4 year and It easy to use the language
SQL for manipulate the data and supported small project that It was necessary for Ger’s garage.

Below some concept about MYsql:

❖ MySQL is an RDBMS, which means it organizes data into tables with rows and columns,
allowing for efficient data retrieval and management.
❖ MySQL is an open-source database, making it freely available for use without any licensing
costs. This makes it a cost-effective option, especially for projects with budget constraints.
❖ MySQL has a straightforward setup and configuration process. Its SQL-based query language
is easy to learn and use, making it accessible to developers with varying levels of expertise.
❖ MySQL can be integrated with many programming languages and platforms, such as PHP,
Python, Java, Ruby, and more, allowing developers to work with their preferred technologies.
❖ MySQL provides various security mechanisms, including user authentication, data encryption,
and access control, ensuring data integrity and protection against unauthorized access.

Source: https://www.w3schools.com/MySQL/default.asp

VII. CHAPTER III

SYSTEM ANALYSIS & DESIGN

Ger’s system basic will make book online for car/vans/bus/motorbike where the system
will manager the book service that means allocate the book service to each staff, print
the invoice when the service is completed. This chapter will show up functional
requirements and functional design. In addition, it will provide the Diagrams that support both
back-end and front-end.

FUNCTIONAL REQUIRENMENTS

The application involves functional requirements for mechanic/admin/clients users:

FELIPE DA SILVA CUNHA


12
MAIN REQUIREMENTS:

➢ The CLIENT will abler register on the system for book his service;
➢ The ADMIN will able to allocate the book to Mechanic and print the invoice;
➢ The MECHANIC will able to update the status of service and make notes and add extra
cost if there is need.;
➢ All the users are able to edit their profile;
➢ All the user are able make login and log out.

ACCESS TO THE SYSTEM:

When the system run the ADMIN user is created automatic and he can make the login.
The first the page on the system is login page where the client will have two option, make
the login or register on the system.
Client have to provide those information for register;
• First Name;
• Last name;
• Phone number;
• Address;
• Email;
• Password;

If the client has already account created just have to type email and password and make login.

Mechanic/ADMIN user are able just for make the login. The ADMIN user will have option for
register MECHANIC USER/ADM

Log-in: MECHANIC/ADMIN/CLIENT ABLE MAKE LOGIN.


➢ Email;
➢ Password
Use-case access the system:

FELIPE DA SILVA CUNHA


13
Illustration 3:acess the system

Register vehicles:

When the client make login on system will have all those option:
➢ CAR
▪ New Car;
▪ List Cars;
➢ VAN
▪ New Van;
▪ List Vans;
➢ BUS
▪ New Bus;
▪ List Buses;
➢ Motorbike
▪ New Motorbike;
▪ List Motorbikes;
➢ Book service;
▪ Book Car;
▪ Book Van;
▪ Book Bus;
▪ Book Motorbike;

When the user want register whatever vehicles have to provide details:
 Makes;
 Types;
 Engine types;
 Capacity passenger;
 Cylinder Capacity(This label just show up for register Motorbike)
 Numbers of doors(this label does not show up for register motorbike);
 Year;
 Plate;
 Color;

FELIPE DA SILVA CUNHA


14
Use-case register vehicles:

Illustration 5: register vehicles

MECHANIC/ADIMIN/MECHANCI are able to edit their profile:


Use-case edit profile:

Illustration 6: edit profile

FELIPE DA SILVA CUNHA


15
Edit details vehicles:
Clients are able to edit/delete/list the details about their vehicles that It is registered on
system:
Use-case edit/delete/list vehicles:

Illustration 7: Use-case edit/delete/list vehicles

Book a service vehicles:


The client will able to book Service for his vehicles. It will show up to client those option:
➢ Book Service:
 Book car
 Book van;
 Book Bus;
 Book motorbike;
The client gave to provide all those details for book the service:
➢ Type of service;
➢ Date of book;
➢ Time of book;
➢ Details about the problems.

FELIPE DA SILVA CUNHA


16
Use-case register Book:

Illustration 8: Use-case register book

Client able to see/edit/cancel all the book that they have.


Use-Case see/edit/Cancel books:

Illustration 10: Use-case see/edit/Cancel books

FELIPE DA SILVA CUNHA


17
ADMIN USER:
Admin user will have option:
➢ Client;
 List all the clients registered on the system;
➢ Admin;
 List all the Admin registered on the system;
 Add new admin user;
➢ Mechanic;
 List all the mechanics registered on the system;
 Add new mechanic user;

Use-Case side-menu of admin:

Illustration 11: Use-Case side-menu of admin

FELIPE DA SILVA CUNHA


18
Menu book’s vehicles on the system for ADMIN USER:
The admin user will have for option for check the books by the type of vehicles
van/car/bus/motorbike where each option will show up all the books that was done on
the system and will be possible allocate the book to mechanic.
➢ Check the car’s books;
 Allocate book to mechanic;

➢ Check the van’s books;


 Allocate book to mechanic;

➢ Check the bus’s books;


 Allocate book to mechanic;

➢ Check the motorbike’s books;


 Allocate book to mechanic.

Use-case allocate book:

Illustration 12: Use-case allocate book

FELIPE DA SILVA CUNHA


19
➢ Generate invoice;

Use-Case side-menu generate invoice:

Illustration 13: Use-Case side-menu generate invoice

Menu book’s vehicles on the system for MECHANIC user:


The mechanic user will have for option for check the books by the type of vehicles:
van/car/bus/motorbike where each option will show up all the books that was done on
the system and will be possible update the status of book and add extra cost and give
some details about what was done in vehicles.
➢ Check the car’s books;
 Update status of book;

➢ Check the bus’s books;


 Update status of book;

➢ Check the van’s books;


 Update status of book;

➢ Check the motorbike’s books;


 Update status of book;

FELIPE DA SILVA CUNHA


20
Use-case Mechanic’s menu:

Illustration 14: Use-case Mechanic’s menu

Wireframes:

The following Wireframes represents the skeletal framework of the website, taking into
consideration the above requirements.
Login page: will be available for the user make sing in or sing up if the one of the user
will not have account, if the user put something different that format of email will show
up error message:

Illustration 15: login page

FELIPE DA SILVA CUNHA


21
Register client: If the client does not have account will press bottom sing up and fill
the form , all the labels are mandatory, if the user put some number instead letter for
example will show up the message, All the label from all the page has validation as well
and make sure the user will type the right data.

Illustration 16: registerClient

Once registered, the Client will access :

➢ Edit his profile, this option show up all users client/admin/mechanic:

Illustration 17: edit profile

FELIPE DA SILVA CUNHA


22
➢ Add vehicles /list/edit all the types:

Illustration 18: add vehicles list

▪ Register car for example:


There is one validation for make sure the user type the right plate in format of
Ireland:

Illustration 18: register car

FELIPE DA SILVA CUNHA


23
▪ List car for example:

Illustration 19: list of car

❖ Edit car evidence that the all the labels are mandatory to fill:

Illustration 19: edit car

FELIPE DA SILVA CUNHA


24
➢ Book the service, on the side-menu the client will have access book the service for
Car/Van/Bus/Motorbike:

Illustration 20: Book service

▪ List of cars registered on the system for make the Book Service:

Illustration 20: list the cars for make book

FELIPE DA SILVA CUNHA


25
▪ Register book car the user is not allow book the service Sunday and Book the
service just between 9:00 to 17:00 Monday to Saturday.

Illustration 21: register book

When there is no book available for the day:

FELIPE DA SILVA CUNHA


26
➢ See all the book that It was done:

Illustration 22: list of books

▪ List all the books:

FELIPE DA SILVA CUNHA


27
Illustration 23: list books

▪ Edit book:

Illustration 24: edit book

➢ Admin user menu:

▪ The ADMIN user will have permission to see all the books by
type:

FELIPE DA SILVA CUNHA


28
Illustration 25: list books admin user

Illustration 26: list books admin user

▪ The ADMIN user will have permission to allocate the book to


Mechanic:

Illustration 27: allocate book

FELIPE DA SILVA CUNHA


29
llustration 28: allocate book

▪ The ADMIN user will have permission to generate invoice:

llustration 29: generate invoice

llustration 30: invoice

FELIPE DA SILVA CUNHA


30
▪ The ADMIN user will have permission list/delete all the
CLIENT/ADMIN/MECHANIC registered on system:

llustration 32: delete client/admin/mechanic

▪ The ADMIN user will have permission edit/delete/register the


ADMIN/MECHANIC registered on system:

llustration 33: edit /delete/register users

Register ADMIN user:

llustration 34: register admin

FELIPE DA SILVA CUNHA


31
OBS- When the admin user register the mechanic user he has to
provide PPSNO:

llustration 35: register admin

Edit/delete mechanic/Admin user:

llustration 36: register admin

➢ The mechanic will have permission to add any extra cost if there is need on the
book:
➢ List all the books allocate for the mechanic that is login in the
system. That means the mechanic can see all the books that only
allocate to him:

llustration 37: mechanic menu

FELIPE DA SILVA CUNHA


32
llustration 38: mechanic menu

➢ Just the mechanic will able to update the status and add any extra
cost for book that It is booked for him:

llustration 39: edit book by mechanic user

USER INTERFACE DIAGRAMS:

Bootstrap is a popular open-source front-end framework used for building


responsive and visually appealing websites and web applications. It was developed
by Twitter and is now maintained by the Bootstrap community. Bootstrap makes it
easier for developers to create consistent and responsive user interfaces by
providing a set of pre-designed HTML, CSS, and JavaScript components.

➢ Database design:
Each functionality is interact with DB for storge the information.

Access to system:
▪ Register user: storage the data provide of user;
▪ Log in: read the information provide of user from DB.

FELIPE DA SILVA CUNHA


33
Register/List/edit/delete Admin/Client/Mechanic user:
▪ All those functionality is done by read the data from DB that was
storage when the user provided the data.

Book service:
▪ Storage the service from de data that the user provide and get
the user/vehicles that already storage from DB.
▪ Allocate mechanic to service from the list of mechanic from DB.
▪ Update the status and add any extra cost to book service from
DB and update those information in DB.

Check book service:


▪ Admin user can read all the book that was done from any all the
client.
▪ Client user can read all the books that was done by himself;
▪ Mechanic can read all the book that was allocated just for him.

FELIPE DA SILVA CUNHA


34
DATA REQUIRENMENTS:

Explain how will work:

FELIPE DA SILVA CUNHA


35
DIAGRAMS & DESIGN

CONCEPTUAL DESIGN

The following diagram is part of the early design process of the Database, which shows the
interactions between the entities previously described, based on the data requirements.

llustration 40: conceptual design

LOGICAL DESIGN

Client/Mechanic/ADM is strong entity because can exist without any book service, means the
user can make register on the system and do not make the book.

llustration 41: entity client

FELIPE DA SILVA CUNHA


36
Car is week entity because for add new car have to exist one client registered on system.

llustration 42: entity car

Book Car/Book Van/Book Bus/Book Motorbike are week entity because if the client wants
make a book for his car depends of two another entity CLIENT/CAR:

llustration 43: entity book car

Relationship between client and car/bus/van/motorbike are ONE TO MANY because the client
can have many cars registered on the system. This relationship is week because for register a car
on the system the client have exist.

llustration 44: relationship between car and client

Relationship between client and bookCar/bookVan/bookBus/BookMotorbike are ONE TO


MANY because one client can have many books on the system. This relationship is week because
if the client wants make a book have to exist client and car registered on the system.

llustration 45: relationship between book and client

FELIPE DA SILVA CUNHA


37
Relationship between MECHANIC and bookCar is ONE TO MANY because the mechanic can have
two book per day. It is strong relationship because the client can make a book and the allocate of
the service will happen after the book done.

llustration 46: relationship between book and mechanic

Relationship between bookCar/bookVan/bookBus/BookMotorbike and Car/Van/Bus/Motorbike are


ONE TO ONE because one car belong just one book per time. Relationship is week because if the
client wants book a service for his car this car have exist on system:

llustration 47: relationship between book and car

FELIPE DA SILVA CUNHA


38
PHYSICAL DESIGN

The following image shows the final physical design of the database:

llustration 47: PHYSICAL DESIGN

FELIPE DA SILVA CUNHA


39
HOW I DECIDED CREATED ALL THOSE TABLE:

Following the structure of object oriented programming:

llustration 48: structure of class

FELIPE DA SILVA CUNHA


40
FUNCTIONAL DESIGN:

llustration 50: Spring Book Architecture

As I mention before the Spring Boot is a popular Java-based framework used to build web
applications and microservices. Here's a step-by-step overview of how Spring Boot typically works
from the front-end to the database:

➢ Front-end Interaction:
 The client (front-end) sends an HTTP request to the Spring Boot application.
This request could be triggered by a user interacting with a web page, a mobile
app, or any other client application.
 The request can contain parameters, headers, and possibly a request body,
depending on the nature of the operation being performed.
➢ Controller Layer:
 In Spring Boot, the DispatcherServlet is the front controller that handles
incoming HTTP requests.
 It receives the HTTP request and routes it to the appropriate controller based
on the URL mapping defined in the application.
➢ Service Servlet:
 The DispatcherServlet routes the request to the appropriate controller class,
which is responsible for processing the request.
 The controller interacts with the business logic of the application to perform the
required operations.
➢ Data Access Layer:
FELIPE DA SILVA CUNHA
41
 The data access layer, also known as the persistence layer, interacts with the
database.
 Spring Boot provides various options for data access, such as Spring Data JPA
(Java Persistence API), JDBC (Java Database Connectivity), or other ORM
(Object-Relational Mapping) frameworks.
 The data access layer typically performs CRUD (Create, Read, Update, Delete)
operations on the database.

➢ Database Interaction:
 The data access layer communicates with the database to perform the required
operations;
 The database processes the received SQL or other query languages to perform
data manipulation or retrieval;
 If the operation is successful, the database returns the requested data or an
acknowledgment to the data access layer;

➢ Service and Controller Interaction:


 If required, the service layer can perform additional processing on the data
returned by the data access layer before passing it back to the controller.
 The controller prepares the response to be sent back to the client.

➢ Response to Client:
 The controller generates an HTTP response containing the result of the
operation or the requested data.
 The DispatcherServlet sends the response back to the client.

➢ Front-end Display:
 The client (front-end) receives the HTTP response and processes it to display
the data or perform further actions as required.

FELIPE DA SILVA CUNHA


42
The following diagram shows a general idea of the functional design of the
Application based on the user actions and taking into consideration the requirements
of the Application:

llustration 52: general idea of project

Follow the structure of project using Spring boot and the accomplishing of all
the package:

llustration 53: packages

FELIPE DA SILVA CUNHA


43
CHAPTER IV: IMPLEMENTATION OF THE SYSTEM

This chapter is meant to explain the Development phase of the project.

ARCHITECTURE:

As it was already mentioned, the ‘GER’S GARAGE’ was developed using Spring Boot framework
from Java witch support all the idea of project and keep the good structure as MVC.

TECHNOLOGIES IMPLEMENTED

FRONT END:

❖ HMTL;
❖ Java Script;
❖ CSS;
❖ Bootstrap framework;
❖ Thymeleaf;
❖ Apache Tomcat as Web server tool, to provide a HTTP web server environment;

BACK END

❖ Spring Data JPA: This module simplifies database access by providing an abstraction layer
over the JPA (Java Persistence API). It allows you to interact with relational databases using
object-oriented approaches.
❖ Hibernate: Often used as the JPA provider, Hibernate is an Object-Relational Mapping
(ORM) framework. It maps Java objects to database tables, making database interaction
more intuitive.
❖ Spring Security: For handling authentication and authorization, Spring Security offers a
wide range of features to secure your application, including user authentication, role-based
access control, and more.
❖ Spring Boot Starter Web: This starter module provides essential components for building
web applications, including embedded web servers like Tomcat, Jetty, or Undertow, and tools
for handling HTTP requests and responses.
❖ Spring Boot Starter Data: This starter module simplifies database operations by providing
pre-configured data sources and JPA support, which makes it easier to interact with
databases.
❖ iText is a powerful and versatile Java library for creating and manipulating PDF documents.
It offers various signing functionalities including creating PDF documents, adding text,
images, tables, charts, form filling, digital and much more.

DATABASE

❖ Relational Database (MySQL), to store the data of the program;


❖ Storage engine for MySQL;

DEVELOPMENT

The table below show up step by step how was implemented the system:

FELIPE DA SILVA CUNHA


44
Componen Action IDE Technology Issue/Chall Solution
t enge

Spring Created the project Spring NetBeans Sprint Boot In the It was research
boot book to run in NetBeans beginner I the message
had that show up in
problems some forum of
about the developed.
version of Finally I find out
Java that only run in
Java 17.

Database Create the DB and make Workbenc Workbench


the connection with my h
project in NetBeans

Back end CREATE all the entity(class) NetBeans Java problems in It was done the
and became them in to generate downgrade of
table in DB the tables Spring Boot
when the Version.
programs
run

Front-end Created the pages that was NetBeans Thymeleaf


necessary for each
functionality

Back-end Implement the CRUD's NetBeans Java/ Problems It was done


users(client/admin, Thymeleaf about research how
mechanic) passing the the thymeleaf
object from works with
front to back.
back

Back-end Implement the CRUD's NetBeans Java/


vehicles(car/van, Thymeleaf
motorbike/bus)

FELIPE DA SILVA CUNHA


45
Back- Implement the Spring NetBeans Java/ Problems It was done
end/front- security for make the Thymeleaf about the downgrade of
end permission of users. version of version.
Spring
Security.

Back- Implement the login of NetBeans Java/Spring


end/front- client/admin/mechanic Security
end

Back-end Implement the connection NetBeans Java It hard find It was using the
between the client and out how to method from
vehicle when the user add passing the Spring security
new vehicles ID of the that get the id
user to of user that It is
method login in the
register car application.
vehicles

Back- Implement the permission NetBeans Java/Spring


end/front- about all the users like just Security
end the client can
add/edit/delete

Back-end Implement the book NetBeans Java It hard get It passed the id
Service for the of client as
van/bus/motorbike/car it client that hidden and get
was done the CRUD Book was table that id in DB
Service. vehicles as and storage as
FK and FK on the table
storage as book service.
FK in table
book
Service

Back- It created the bottom NetBeans Java/


end/front- allocate book to mechanic Thymeleaf
end

Back- Implement the bottom for NetBeans Java/


end/front- edit the book service and Thymeleaf
end add some labels as :extra
cost, minimum cost, details
about the service

FELIPE DA SILVA CUNHA


46
Back-end Implement the method NetBeans Java
that set up the minimum
cost for the service
accordingly of type of
service.

Back-end Implement the logical for NetBeans Java


sum the minimum cost plus
extra cost .

front-end Implement the validation NetBeans Java Script


about all the label for make
sure the user type the right
information for each label.

front-end Implement the function for NetBeans Java Script


do not allow the user book
service on Sunday/and
allow the user book just
9:00 to 17:00

Back end Implement the generate NetBeans Java/


invoice for each book Thymeleaf
service

IMPLEMENTATION OF THE SYSTEM:

I had decide using abstract class for created the project.

As I decide created Abstract class as USER and the subclass as CLIENT/ADMIN/MECHANIC the
database behaviour the same logical:

FELIPE DA SILVA CUNHA


47
User- Abstract class:

llustration 54: Abstract class

I had used the notation @MappedSuperclass that means when the system run the Java know
that It is a superclass and will not generate the table in data base, Will generate the table just in
sub class through notation @Entity that means every tables that has this notation will become
table on DB and all attributes of this class will became labels in DB.

llustration 55: subclass class

FELIPE DA SILVA CUNHA


48
It was used the same logical for Book Service/vehicles:

Book service Abstract class:

llustration 56: Book service Abstract class

One of the Subclass from book service:

llustration 57: subclass class

FELIPE DA SILVA CUNHA


49
Abstract class vehicle :

llustration 58: Abstract vehicle class

One of subclass from vehicle class:

llustration 59: Abstract car subclass

FELIPE DA SILVA CUNHA


50
Connection with database:

As was mentioned before in your application.properties or application.yml file, It is define


properties related to the database connection. These properties include information such as the
database URL, username, password, driver class, and any other database-specific configuration:

llustration 60: connection with DB

Tables created in database:

llustration 61: Table in DB

Query Methods: Spring Boot's auto-generated query methods in repository interfaces allow to
perform common CRUD operations without writing explicit SQL queries. These methods are
based on the method names and follow specific naming conventions.

How is possible to use CRUD ?

First was created the object in front-end for pass this object to back and finally save in DB.

For show up the form below It was used the method GET in CLASS ClientController.

ClientController- Each entity will have one Controller and this class will have the annotation
@Controller When annotate a class with @Controller, it indicates that this class will handle
incoming HTTP requests. Each public method within the controller class is typically responsible
for handling a specific URL or request mapping.

In addition to the @Controller annotation, will often see methods within the controller
annotated with @RequestMapping (or other specific mapping annotations like @GetMapping,
@PostMapping, etc.). These annotations define the URLs or paths that the methods should
handle.

FELIPE DA SILVA CUNHA


51
@GetMapping – show up the forms to user:

llustration 62: Get forms from front-end

When the user press SAVE the object ‘client; will sent to method POST and save in data base.

llustration 63: Page HTML register user

@PostMapping – Save the object in DB:

FELIPE DA SILVA CUNHA


52
llustration 64: storage the client on DB by JPA.

How is possible save the client in data base ?

For each entity was created the interface called repositoryClient for example, where this class
extends JPARepository where has all the method like save/delete/list and etc:

llustration 65: Client repository.

Example of another methos that was used for make the CRUD:

llustration 66: Methods from JPA

FELIPE DA SILVA CUNHA


53
It was used the same structure for implement the CRUD of BOOKSERVICE/VECHIELS/.

THE MAIN LOGICAL OF SYSTEM

BOOK SERVICE

Page hmtl:

In the page below It was passing the id of user/idCar hidden to method post:

llustration 67: Page register book

FELIPE DA SILVA CUNHA


54
llustration 68: Storge the book in DB.

After get those IDs It was called the method find ClientbyId from JPARepository for get the client
that who wants book the service. It was done the same for get the Car.

Before save the object to BookCar in DB It was set up the client/car as FK in the table BookCar.

There is two method that was created for set up the minimum cost of type of service and
another one for update the final cost if there is extra cost in service, All those methos are in the
picture from method post.

Final result in DB:

llustration 68: Table book service.

FELIPE DA SILVA CUNHA


55
PRINT INVOICE

For print the invoice was used the library from java itext as was mentioned before.

Class that build the PDF :

llustration 69: Logical print the invoice.

FELIPE DA SILVA CUNHA


56
Method generate invoice:

llustration 70: Method generate Invoice.

How was done relationship between the table form back-end:

Many-to-One Relationship: A many-to-one relationship is the reverse of a one-to-many


relationship. Many instances of one entity are associated with a single instance of another entity.
Use the @ManyToOne annotation.

llustration 70: relationship between the tables.

FELIPE DA SILVA CUNHA


57
This example show up was set up relationship between BookCar to Client/mechanic/Car.

I was done the same logical for another relationship in diagrama.

SPRING SECURITY

As was mentioned before I had used the Spring security for make the permission of
user.
The method below show up how to get the user that It is login:

llustration 71: get the profile user.

Through the method getAuthorities from Spring Boot It possible set up the permission
accordingly profile of user.
Example how was implement the permission just the mechanic user is allow update the
status of service:

llustration 72: make the permission by user.

In this case It hidden the bottom update Status for CLIENT/ADM users.
Challenges:
The front-end implied one of the biggest challenges, in terms of connecting it with the back end.
The hard part for me It was how pass the understand how to pass the object and their attributes

FELIPE DA SILVA CUNHA


58
to back-end. But after done the first one It was easy implemented to other because the logical
was same.

VIII. CHAPTER V:TESTING & EVALUATION

This chapter will cover the final test and evaluation process of project Spring Boot. During the
development of the application, it was necessary to make changes to the structure according to
the system requirements.

This chapter will cover the input and output for each functionality.

➢ ACESS TO THE SYSTEM:


Test input Expected result Actual Result Comment

Fill the form register Storage the client on Correct. It is not show up any
new client Table and back to message to user like
page login “You have been
registered”. In
additional It show up
message of error if
the user put some
wrong information in
any labels.

Make the login Authentication of user Correct.


in the system and
access the menu of
system.

➢ EDIT USER’S PROFILE:


Test input Expected result Actual Result Comment

Edit profile Make the update that Correct. It is not show up any
client/admin/mechanic the user want and message to user like
save in DB. “You have been
registered”. In
additional It show up
message of error if
the user put some
wrong information in
any labels.

➢ MAKE LOGOUT:

FELIPE DA SILVA CUNHA


59
Test input Expected result Actual Result Comment

Users make the logout Return to page login Correct. It is not show up any
message to user.

➢ CAR:
Test input Expected result Actual Result Comment

Press the bottom list List all the cars Correct.


the cars. registered for the
user.
Fill the form car’s Get the id of user Correct. It is not show up any
details who is login and car’s message to user like
details that was “You have been
provide from user registered”. In
and storage Client as additional It show up
FK in CAR’S table and message of error if
storge the car in table the user put some
as well. wrong information in
any labels.

Edit the form car’s Salve the updates Correct. It is not show up any
details car’s tables. message to user like
“You have been
registered”. In
additional It show up
message of error if
the user put some
wrong information in
any labels.

Delete car Delete the car in Correct It is not show up any


CAR’s table. message to user.

➢ VAN:
Test input Expected result Actual Result Comment

Press the bottom list List all the vans Correct.


the vans. registered for the
user.
Fill the form van’s Get the id of user Correct. It is not show up any
details. who is login and van’s message to user like
details that was “You have been
provide from user registered”. In

FELIPE DA SILVA CUNHA


60
and storage Client as additional It show up
FK in VAN’S table and message of error if
storge the van in the user put some
table as well. wrong information in
any labels.

Edit the form van’s Salve the updates Correct.


details van’s tables.
Delete the van Delete van in van’s Correct It is not show up any
table. message to user.

➢ BUS:
Test input Expected result Actual Result Comment

Press the bottom list List all the buses Correct.


the buses. registered for the
user.
Fill the form bus’s Get the id of user Correct. It is not show up any
details. who is login and bus’s message to user like
details that was “You have been
provide from user registered”. In
and storage Client as additional It show up
FK in BUS’S table and message of error if
storge the bus in the user put some
table as well. wrong information in
any labels.

Edit the form bus’s Salve the updates Correct.


details bus’s tables.
Delete bus Delete bus in bus’s Correct It is not show up any
table. message to user.

➢ MOTORBIKE:
Test input Expected result Actual Result Comment

Press the bottom list List all the Correct.


the motorbikes. motorbikes
registered for the
user.
Fill the form Get the id of user Correct. It is not show up any
motorbike’s details. who is login and bus’s message to user like
details that was “You have been
provide from user registered”. In

FELIPE DA SILVA CUNHA


61
and storage Client as additional It show up
FK in MOTORBIKES’S message of error if
table and storge the the user put some
motorbike in table as wrong information in
well. any labels.

Edit the form Salve the updates Correct. It is not show up any
motorbike’s details motorbike’s tables. message to user like
“You have been
registered”. In
additional It show up
message of error if
the user put some
wrong information in
any labels.

Delete motorbike Delete motorbike in Correct It is not show up any


motorbike’s table. message to user.

➢ BOOK SERVICE VAN/BUS/MOTORBIKE/CAR:


Test input Expected result Actual Result Comment

Fill the form book Get the Correct. It is not show up any
service. idUser/idVehicle and message to user like
all the details provided “You have been
by the user storage in registered”. In
vehicle’s table. additional It show up
message of error if
the user put some
wrong information in
any labels.

Press the bottom for Lista all the book by Correct.


see all the books that user that It is log in in
was done by the user. the system .
Fill the forms edit Salve the updates Correct. It is not show up any
book book in message to user like
van/bus/car/motorbike van/bus/car/motorbike “You have been
table. registered”. In
additional It show up
message of error if
the user put some
wrong information in
any labels.

FELIPE DA SILVA CUNHA


62
Delete book Delete Correct It is not show up any
van/bus/car/motorbike van/bus/car/motorbike message to user.
in DB.

➢ ADMIN MENU:
Test input Expected result Actual Result Comment

Press the bottom list List all Correct.


all the client/admin/mechanic
client/admin/mechanic from DB.
registered on system.
Fill the form Get the details Correct. It is not show up any
mechanic/admin user. provided by the message to user like
ADMIN user and “You have been
storge in DB. registered”. In
additional It show up
message of error if
the user put some
wrong information in
any labels.

Edit the form bus’s Salve the updates Correct.


details bus’s tables.
Delete bus Delete bus in bus’s Correct It is not show up any
table. message to user.

➢ ADMIN MENU ABOUT THE BOOK:


Test input Expected result Actual Result Comment

List all the books that List all Correct.


was done. van/car/motorbike
/bus from DB.
Choose the mechanic List all the mechanics Correct. It is not show up any
that It is registered on from DB and storage message to user like.
system and allocate to the mechanic that and It not limited the
book. was choose by Admin amount of book by
in the Book’s table as mechanic.
FK.
Press generate invoice Generate the Correct.
for the book. document as PDF
with some details
from book.

FELIPE DA SILVA CUNHA


63
Correct It is not show up any
message to user.

➢ MECHANIC MENU ABOUT THE BOOK:


Test input Expected result Actual Result Comment

Press the bottom List all the books that Correct.


check all the books was allocated for him
that It allocated for from DB.
him.
Change the Status of Get the details (extra Correct.
book and fill extra cost/list of services)
cost and provide and save those
some details about information in DB.
the fix like list of The label extra cost It
service that It was add to final cost in DB
done and how much .
cost those.

➢ TEST ABOUT THE REQUIMENT:


Test input Expected result Actual Result Comment

Client try book the Show up a message Correct.


service Sunday. to user Sunday It is
not available.
Client try book the Show up the message Correct. It is show up the
service when there is to user that there is message that there is
no book available. no book available for no book available just
Limit of books is 6 per this day. on console. I did
day. have type to send the
message to front.

Type the plate wrong Show up the message Correct.


when the client how the correct
register the new car . format of plate for
Ireland.
Type email wrong Show up the message Correct
to user that Email It
is wrong.
Type number instead Show up the message Correct
letter for any label. to user that label
accept just letters.
Type letter instead Show up the message Correct
number. to user that label
accept just number.

FELIPE DA SILVA CUNHA


64
Type wrong phone Do not allow the user Correct
number type letter.
User do not fill some Show up the message Correct This validation It
label. that label have to be works all the label for
fill. any form that the user
try fill.

Admin user allocate Do not allow allocate I did have time for
the book to mechanic. the book to mechanic implement It.
if the mechanic has
two books for the
day.
Option other if there Allow the user type I did have time for
is no type/makes for makes/types vehicles. implement It.
vehicles on list
Generate roster for Generate the PFD I did have time for
any particular date. document implement It.
Choose type of Add minimum cost Correct.
service when the accordingly type of
client book the service service.
Choose the time of Show up the message Correct.
book before 9:00 or to user that time of
after 17:00 book It just 9:00 to
17:00.

Extra functionality:

▪ Method encodes (hashes) the given password using BCrypt

• Admin user has :


▪ List all the clients registered on system.
▪ Delete client/mechanic/admin
▪ List all the mechanic registered on system.
▪ List all the admin registered on system.

FELIPE DA SILVA CUNHA


65
FELIPE DA SILVA CUNHA
66
CHAPTER VI: CONCLUSIONS & FURTHER WORK

I'm truly proud of the journey I've undertaken with my Spring Boot project in Java. Initially, I
believed that the primary challenge would be adapting to new technical concepts in English, but I
soon discovered that wasn't the case. The real test was balancing the demanding schedule, work
responsibilities, and managing college commitments, which proved to be the most significant
obstacle.

Although I didn't achieve every goal I set for this project, I am confident that I gave it my all and
performed exceptionally well given the constraints of time. The most daunting aspect for me was
integrating the diverse technologies I had learned—front-end, back-end, and database—all of
which I had studied separately. It was a challenge to understand how these components could
seamlessly work together.

Opting for Spring Boot as my framework of choice was a decision that initially filled me with
apprehension due to my lack of knowledge about it. However, through dedicated networking and
effort, I gradually grasped how Spring Boot functions, and I'm convinced that this investment in
learning will pay off by streamlining future project development. This framework has sparked my
curiosity, motivating me to delve even deeper into it. I've even made plans to replicate the
project using the Angular framework.

My journey to Ireland initially began as an opportunity to improve my English, but midway


through, I took the life-changing decision to embark on a Higher Diploma in Computing Science.
This choice has been the best decision I've made. It has allowed me to surpass my own
expectations and has given me the confidence to tackle any technological challenge that comes
my way.

In conclusion, I've learned a great deal from this experience, not only in terms of technical skills
but also in terms of time management, adaptability, and personal growth. The journey has been
challenging, but it's equipped me with the tools and knowledge to face future endeavors with
confidence and determination.

FELIPE DA SILVA CUNHA


67
FURTHER WORK

Keeping going ahead with this project I would like complete the functionality It is missing:

❖ Print the roster for any particular date;


❖ Show up the message to user to front-end that day It not available.
❖ Make list of service;
❖ Improve the layout of invoice.
❖ Add option other in list makes/type;

Extra functionality :

❖ Find the client/book by name;


❖ Find the car by client;

Make the same project using Angular Framework.

FELIPE DA SILVA CUNHA


68
APPENDIX A: CLASS DIAGRAM

FELIPE DA SILVA CUNHA


69
APPENDIX B: LINK GITRUB

https://github.com/FelipeCunha03/GARAGE-2022250

Instructions:
When the program run It is created 2 types of user just user Admin/mechanic. I used
this for make the test and save time for record the demo. Bus you are free for make new
register whatever user for test.
Mechanic user:
 Email: [email protected]
 Password:Positivo11
Admin user:
 Email: [email protected]
 Password: Positivo10

The program have to be execute in Java17 for avoid bug because version;
LinkWeb: http://localhost:8080/login;
Connection to DB: When the program run the DB and all the table are created automatic.
Just update password and user name in file below and save:

FELIPE DA SILVA CUNHA


70
The program have to be run main class below:

There is one side menu on system and whatever page user go through this side-menu go
as well, if the user try choose some option from side menu after went through whatever
page It is not work, this happens sometimes just. I did not have time for fix it.

FELIPE DA SILVA CUNHA


71
REFERENCES

Java point (2020). Learn Spring Boot Tutorial - javatpoint. [online] www.javatpoint.com.
Available at: https://www.javatpoint.com/spring-boot-tutorial.

Maven (2020). Maven Repository: Search/Browse/Explore. [online] mvnrepository.com.


Available at: https://mvnrepository.com.

Packtpub.com. (2019). Packt | Programming Books, eBooks & Videos for Developers. [online]
Available at: https://www.packtpub.com/.

Stack Overflow. (2014). unidirectional vs bidirectional in one-to-one relationship. [online]


Available at: https://stackoverflow.com/questions/21661856/unidirectional-vs-bidirectional-in-
one-to-one-relationship [Accessed 12 Aug. 2023].

www.youtube.com. (2020). Spring Boot | Curso Completo 2022. [online] Available at:
https://www.youtube.com/watch?v=LXRU-Z36GEU&t=6554s [Accessed 12 Aug. 2023].

www.youtube.com. (2022). Spring Security without the WebSecurityConfigurerAdapter. [online]


Available at: https://www.youtube.com/watch?v=s4X4SJv2RrU [Accessed 12 Aug. 2023].

FELIPE DA SILVA CUNHA


72
FELIPE DA SILVA CUNHA
73

You might also like