This Spring Boot application allows users to purchase products from an online store, ensuring secure inventory management even in concurrency scenarios.
- Spring Boot: Java application development framework.
- Spring Data JPA: Facilitates access to relational data through the Java Persistence API (JPA) technology.
- H2 Database: In-memory database for development and testing purposes.
- Docker: Container platform for packaging, distributing, and running applications.
- JUnit: Testing framework for Java.
- Mockito: Testing framework for simulating object behavior in a controlled environment.
- Java Development Kit (JDK) 8 or higher.
- Docker installed on your machine.
-
Clone the repository:
git clone https://github.com/your-username/your-repository.git
-
Import the project into your preferred IDE as an existing Maven project.
-
Start the application from your IDE or using Maven:
mvn spring-boot:run
-
Access the application in your web browser:
-
Build the application with Maven:
mvn clean package
-
Build the Docker image:
docker build -t ecommerce-app .
-
Run the Docker container:
docker run -p 8080:8080 ecommerce-app
-
Access the application in your web browser:
If you'd like to contribute to this project, please:
- Fork the repository.
- Create a branch for your new feature (
git checkout -b feature/new-feature
). - Make your changes and commit (
git commit -am 'Add a new feature'
). - Push the branch (
git push origin feature/new-feature
). - Create a new pull request.
The project includes unit and integration tests to ensure code quality. To run the tests, use the following Maven command:
mvn test
Here you will find a useful resource that was used as a reference during the development of this project:
Baeldung - Understanding JPA Transaction Locks: This article on Baeldung provides valuable insights into Java Persistence API (JPA) transaction locks and their usage. Understanding JPA Transaction Locks Feel free to explore this resource to enhance your understanding of JPA transaction locks and their application within your Spring Boot project!
This project is licensed under the MIT License.