Question: Task 1 : Project Setup Initialize a Spring Boot Project: Use Spring Initializer or your preferred IDE to create a new Spring Boot project. Include

Task 1: Project Setup
Initialize a Spring Boot Project:
Use Spring Initializer or your preferred IDE to create a new Spring Boot project.
Include dependencies for MySQL, JPA, Security, Lombok, and Thymeleaf.
Configure Database:
Set up your application.properties to connect to a MySQL database.
Create a database named coffeeshopdb.
Task 2: Entity and Repository
Create Entity:
Design an entity class representing a coffee product with attributes like id, name, price, etc.
Use Lombok annotations for generating getters, setters, and constructors.
Implement Repository:
Create a JPA repository interface for the coffee product entity.
Include methods for basic CRUD operations.
Task 3: Security and Authentication
Security Configuration:
Implement security configurations to secure your application.
Create a custom UserDetailsServiceImpl for user authentication.
Admin User:
Create an admin user in the database with roles that allow access to product management functionalities.
Task 4: Web Pages and Controllers
Thymeleaf Templates:
Develop Thymeleaf templates for displaying the list of coffee products, product details, and forms for adding/editing products.
Controller Methods:
Implement controller methods for handling requests related to coffee products (e.g., listing, adding, editing, deleting).
Use appropriate security annotations to restrict access.
Task 5: JUnit Testing
Write JUnit Tests:
Develop JUnit tests for each method in your service and repository classes.
Ensure that tests cover positive and negative scenarios.
Task 6: Additional Features
Mandatory: Styling and Validation:
Add CSS styles to improve the look and feel of your web pages.
Implement form validation for input fields in your Thymeleaf templates.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!