Skip to content

About

Development of a RESTful API, structured according to the MVC (Model-View-Controller) architectural pattern.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Ecommerce API

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.

Java: 21 Spring Boot: 3.5.6 PostgreSQL License: MIT

Quick Links

Description

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.

Technologies

  • 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

Features

Category Management

  • Create, list, update, and remove product categories
  • Filters and pagination

Product Management

  • Full CRUD for products
  • Association with categories
  • Inventory control
  • Pagination and sorting

User Management

  • Full CRUD for users
  • Data validations

Order Management

  • Create and query orders
  • Associated order items
  • Total calculations

Swagger

This project uses SpringDoc OpenAPI to automatically generate interactive API documentation through Swagger UI.

Accessing Swagger

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

Project Structure

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

License

This project is licensed under the MIT License.

About

Development of a RESTful API, structured according to the MVC (Model-View-Controller) architectural pattern.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages