English | Português
Development of a RESTful API, structured according to the MVC (Model-View-Controller) architectural pattern, with the goal of managing products, orders, users, and other resources in an e-commerce system.
This project is a RESTful API built with Spring Boot for complete ecommerce management. The application implements CRUD (Create, Read, Update, Delete) operations for categories, products, users, and orders, following best practices for development and layered architecture.
The API uses PostgreSQL as the database, Flyway for migration versioning, and Spring Data JPA for the persistence layer.
- Java 21
- Spring Boot 4.1.1
- Spring Web
- Spring Data JPA
- Spring Boot DevTools
- PostgreSQL - Relational database
- Flyway - Database version control
- Lombok - Reduces boilerplate code
- SpringDoc OpenAPI - Automatic API documentation (Swagger)
- Maven - Dependency management
- Create, list, update, and remove product categories
- Filters and pagination
- Full CRUD for products
- Association with categories
- Inventory control
- Pagination and sorting
- Full CRUD for users
- Data validations
- Create and query orders
- Associated order items
- Total calculations
This project uses SpringDoc OpenAPI to automatically generate interactive API documentation through Swagger UI.
When the application is running, you can access the interactive API documentation at the following route:
Note
The base URL ({{URL}}) is usually http://localhost:8080, unless you have configured a different port.
{{URL}}/swagger-ui/index.html
You can also access the OpenAPI specification in JSON format:
{{URL}}/v3/api-docs
ecommerce-api/
├── src/
│ └── main/
│ ├── java/com/lpatros/ecommerce_api/
│ │ ├── configuration/ # Application configuration
│ │ ├── controller/ # REST controllers
│ │ ├── dto/ # Data Transfer Objects
│ │ ├── entity/ # JPA entities
│ │ ├── exception/ # Exception handling
│ │ ├── mapper/ # DTO <-> Entity mappers
│ │ ├── repository/ # JPA repositories
│ │ ├── service/ # Business rules
│ │ ├── util/ # Utilities
│ │ └── validator/ # Custom validators
│ └── resources/
│ ├── application.properties
│ └── db/migration/ # Flyway scripts
│
├── pom.xml # Maven dependencies
├── README-PTBR.md # Documentation in Portuguese
└── README.md # Documentation in English
This project is licensed under the MIT License.