Spring Boot 4 REST API for an auction-style e-commerce marketplace. Models users, products, bids, orders, ratings, and payment methods through a layered controller / service / repository architecture backed by PostgreSQL via JPA.
- Language: Java 17
- Framework: Spring Boot 4.0.3 (
spring-boot-starter-parent) - Starters: Data JPA, Web MVC, Validation, Lombok
- Database: PostgreSQL 15 (run locally via Docker Compose)
- ORM: Spring Data JPA / Hibernate
- Build: Maven (wrapper included —
./mvnw) - Testing: JUnit 5 (Jupiter) via
spring-boot-starter-data-jpa-test,webmvc-test,validation-test
Three-layer separation under EBAY/src/main/java/com/ebay/api/:
controller/ REST endpoints — @RestController, @RequestMapping
service/ Business logic — orchestrates repositories
repository/ Spring Data JPA — extends JpaRepository<Entity, ID>
domain/ JPA entities + enums (UserRole, OrderStatus, ProductCondition)
| Entity | Purpose |
|---|---|
User |
Buyer / seller account; UserRole enum |
Product |
Listing with ProductCondition enum |
Bid |
A bid placed by a user on a product |
Order |
Post-auction transaction with OrderStatus |
Rating |
Customer feedback |
PaymentMethod |
Payment preference attached to a user |
UserController—/api/usersProductController—/api/products
Repositories are wired for Bid, Order, PaymentMethod, Product, Rating, and User; service layers exist for Product and User.
cd EBAY
docker compose up -dThis brings up postgres:15-alpine on localhost:5432 with database ebay_db, user ebay_user, password ebay_password (defaults in docker-compose.yml).
./mvnw spring-boot:runThe application starts on the default Spring port (8080).
docker compose down./mvnw testIncludes a Spring Boot @SpringBootTest context-load smoke test plus the JPA / web / validation test slices configured through the Spring Boot test starters.
EBAY/
├── docker-compose.yml # PostgreSQL 15 for local dev
├── pom.xml # Maven build, Spring Boot 4.0.3
├── mvnw / mvnw.cmd # Maven wrapper
└── src/
├── main/java/com/ebay/api/
│ ├── ApiApplication.java # @SpringBootApplication entrypoint
│ ├── controller/ # REST endpoints
│ ├── service/ # Business logic
│ ├── repository/ # Spring Data JPA repositories
│ └── domain/ # JPA entities + enums
└── test/java/com/ebay/api/
└── ApiApplicationTests.java # Context-load test
MIT — see LICENSE.