"Awesome Pizza" is a Spring Boot API that enables customers to place orders for pizzas without registration. The pizzaiolo (pizza maker) can view the pizza Order queue nd process them one at a time.
- Java 17+
- Spring Boot
- Maven
- H2 In-Memory Database
- Mockito (for unit testing)
- JDK 17 or higher
- Maven
- Clone the repository:
git clone https://github.com/parez93/awesome_pizza.git- Navigate to the project directory:
cd awesome_pizza- Build the project:
mvn clean install- Run the application:
mvn spring-boot:runThe application uses an H2 in-memory database for development and testing purposes. The configuration is set in the application.properties file:
spring.datasource.url=jdbc:h2:mem:awesomepizza
spring.datasource.driver-class-name=org.h2.Driverspring.datasource.username=sa
spring.datasource.password=password
spring.h2.console.enabled=true
spring.jpa.database-platform=org.hibernate.dialect.H2DialectTo access the H2 console, navigate to:
http://localhost:8080/h2-console
Use the following credentials:
- JDBC URL:
jdbc:h2:mem:awesomepizza - Username:
sa - Password:
password
To run the unit tests, execute the following command:
mvn testTo generate a JaCoCo code coverage report, execute the following commands:
mvn clean test
mvn jacoco:reportThe report will be generated in the target/site/jacoc.
Open the index.html file in a web browser to view the coverage report.
src/main/java/com/awesomepizza:controller/OrderController.java: Handles API requests for pizza orders.service/OrderService.java: Contains the business logic for managing orders.repository/OrderRepository.java: Interfaces with the in-memory database.model/Order.java: Represents the pizzaOrder entity.
src/test/java/com/awesomepizza: Unit tests for the application.
[src/main/resources/application.properties]
spring.datasource.url=jdbc:h2:mem:awesomepizza
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.h2.console.enabled=true
spring.jpa.database-platform=org.hibernate.dialect.H2DialectThis project uses GitHub Actions for CI/CD. The GitHub Actions workflow is defined in the .github/workflows directory
A swagger is provided for the Order feature. (see the folder)
A postman is provided for the Order feature. (see the folder)
This project is licensed under the MIT License. See the LICENSE file for details.
Federico Parezzan