About • Features • Diagrams • How it works • Tech Stack • How to contribute • Author
Spring Boot order management application focused on domain model implementation. The domain model includes "client", "order", "order item", "order status" and "product" entities to be instantiated. By design, an order can be associated with only one client; on the other hand, an order can be associated with many items, but each item can only belong to a single order ("one to many" relationship), and each item is associated with a single product. The class and object diagrams can be seen here. The Object-Relational Mapping is achieved with the use of JPA (Hibernate), and the relational database chosen is the in-memory H2.
- Class and object diagrams
- Relational database
- Database seeding through CommandLineRunner
- Domain model implementation with Object-Relational Mapping
- JPA with Hibernate
- Web service API
- Structure divided into Entities, Repositories and Controllers
- Classes and objects
- Encapsulation, getters and setters
- Enum types
Before getting started, you'll need to have the following tools installed on your machine:
In addition, you might also want an IDE to work with the code, like IntelliJ IDEA.
git clone https://github.com/alexbraga/dmi.git
Navigate to the root directory of the project
cd dmi
Build the project
mvn compile
Run the application
mvn spring-boot:run
-
Alternatively, open the project folder with your preferred IDE and run
/src/main/java/com/example/dmi/DMIApplication.java
-
The server will start at
localhost:8080
-
Get all orders in the database:
GET
/orders
-
Get order by id:
GET
/orders/{id}
The following tools were used in the construction of the project:
- Spring Web
- Spring Data JPA
- H2 Database
See the file pom.xml
- Dependency Manager: Maven
- IDE: IntelliJ IDEA
- API Testing: Postman
- Fork the project
- Create a new branch with your changes:
git checkout -b my-amazing-feature
- Save your changes and create a commit message (in present tense) telling what you did:
git commit -m "Add my amazing feature"
- Submit your changes:
git push origin my-amazing-feature
- Create a pull request