Felipe Cunha - HDIP Final Project Report
Felipe Cunha - HDIP Final Project Report
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.
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
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:
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.
Develop the web system where the user can make book for his vehicle.
IV. OBJECTIVES
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;
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.
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
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.
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.
➢ 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:
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.
▪ 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.
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.
❖ 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
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 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.
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
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;
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:
❖ Edit car evidence that the all the labels are mandatory to fill:
▪ List of cars registered on the system for make the Book Service:
▪ Edit book:
▪ The ADMIN user will have permission to see all the books by
type:
➢ 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:
➢ Just the mechanic will able to update the status and add any extra
cost for book that It is booked for him:
➢ 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.
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.
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.
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.
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:
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.
The following image shows the final physical design of the database:
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;
➢ 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.
Follow the structure of project using Spring boot and the accomplishing of all
the package:
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
DEVELOPMENT
The table below show up step by step how was implemented the system:
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.
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
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-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
As I decide created Abstract class as USER and the subclass as CLIENT/ADMIN/MECHANIC the
database behaviour the same logical:
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.
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.
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.
When the user press SAVE the object ‘client; will sent to method POST and save 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:
Example of another methos that was used for make the CRUD:
BOOK SERVICE
Page hmtl:
In the page below It was passing the id of user/idCar hidden to method post:
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.
For print the invoice was used the library from java itext as was mentioned before.
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:
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:
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
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.
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.
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:
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
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.
➢ VAN:
Test input Expected result Actual Result Comment
➢ BUS:
Test input Expected result Actual Result Comment
➢ MOTORBIKE:
Test input Expected result Actual Result Comment
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.
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.
➢ ADMIN MENU:
Test input Expected result Actual Result Comment
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:
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.
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.
Keeping going ahead with this project I would like complete the functionality It is missing:
Extra functionality :
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:
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.
Java point (2020). Learn Spring Boot Tutorial - javatpoint. [online] www.javatpoint.com.
Available at: https://www.javatpoint.com/spring-boot-tutorial.
Packtpub.com. (2019). Packt | Programming Books, eBooks & Videos for Developers. [online]
Available at: https://www.packtpub.com/.
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].