A RESTful e-commerce backend built with Spring Boot. Currently, it provides functionality for managing product categories with support for pagination, sorting, and validation.
- Language: Java 21
- Framework: Spring Boot 4.0.1
- Build Tool: Maven
- Database: H2 (In-memory)
- Mapping: ModelMapper
- Utilities: Lombok, Spring Data JPA, Spring Validation
- JDK 21 or higher
- Maven (optional, wrapper provided)
- Clone the repository:
git clone <repository-url> cd springboot-ecomm
- Build the project:
./mvnw clean install
- Run the application:
The server will start at
./mvnw spring-boot:run
http://localhost:8080.
./mvnw clean install: Build and install dependencies../mvnw spring-boot:run: Launch the application../mvnw test: Run unit and integration tests.
GET /api/public/categories: Fetch all categories (paginated).POST /api/public/categories: Create a new category.PUT /api/admin/categories/{categoryId}: Update an existing category.DELETE /api/admin/categories/{categoryId}: Remove a category.
Access the H2 Console at http://localhost:8080/h2-console with:
- JDBC URL:
jdbc:h2:mem:test - Username:
sa(default) - Password: (leave empty)
- TODO: List any externalized configuration variables (currently using defaults in
application.yaml).
Run tests using:
./mvnw testspringboot-ecomm/
├── src/
│ ├── main/
│ │ ├── java/com/ecommerce/project/
│ │ │ ├── config/ # Configuration classes (AppConfig, AppConstants)
│ │ │ ├── controller/ # REST Controllers
│ │ │ ├── exceptions/ # Global Exception Handling
│ │ │ ├── model/ # JPA Entities
│ │ │ ├── payload/ # DTOs (Data Transfer Objects)
│ │ │ ├── repository/ # Spring Data Repositories
│ │ │ ├── service/ # Business Logic Layer
│ │ │ └── SpringbootEcommApplication.java # Main Entry Point
│ │ └── resources/
│ │ └── application.yaml # Application Configuration
│ └── test/ # Unit and Integration Tests
├── pom.xml # Maven Configuration
└── mvnw # Maven Wrapper
- TODO: Add license information.