Skip to main content

Welcome to E-Commerce Backend API

A production-ready Spring Boot REST API designed with clean architecture principles, implementing CQRS patterns and Domain-Driven Design for building scalable e-commerce applications.

Quick Start

Get your development environment set up and running in minutes

Architecture Overview

Understand the clean architecture and DDD patterns used in this project

API Endpoints

Explore the complete API reference for users and products

Database Setup

Configure MySQL and set up your database schema

Key Features

Clean Architecture

Organized into domain, application, and infrastructure layers for maintainability and testability

CQRS Pattern

Separates commands and queries for better scalability and performance

User Management

Complete user registration and authentication system with secure password handling

Product Catalog

Manage products with detailed information and pricing using value objects

Value Objects

Domain validation through immutable value objects ensuring data integrity

Exception Handling

Global exception handler providing consistent error responses across the API

Technology Stack

This API is built with modern Java technologies:
  • Spring Boot 3.5.7 - Enterprise-grade application framework
  • Spring Data JPA - Simplified data access with Hibernate
  • MySQL 8 - Robust relational database
  • Lombok - Reduced boilerplate code
  • Maven - Dependency management and build automation

Architecture Highlights

The project follows Hexagonal Architecture (Ports and Adapters) with clear separation of concerns:
src/main/java/com/example/demo/
├── core/               # Shared infrastructure
├── producto/           # Product domain
│   ├── application/   # Use cases and command/query handlers
│   ├── domain/        # Domain models, VOs, and repositories
│   └── infrastructure/# JPA entities, adapters, and persistence
└── usuario/           # User domain
    ├── application/   # Use cases and command/query handlers
    ├── domain/        # Domain models, VOs, and repositories
    └── infrastructure/# Controllers, entities, and persistence
Each bounded context (User, Product) is organized into three distinct layers, promoting loose coupling and high cohesion.

Getting Started

1

Prerequisites

Ensure you have Java 17+, Maven 3.6+, and MySQL 8+ installed on your system.
2

Clone the Repository

Clone the project and navigate to the root directory.
3

Configure Database

Set up MySQL database connection in application.properties.
4

Run the Application

Execute mvn spring-boot:run to start the API server.
Ready to dive in? Head over to the Quick Start Guide to set up your development environment.

Build docs developers (and LLMs) love