Skip to content

MILTONADINA/Ebay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ebay — Auction Marketplace REST API

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.


Stack

  • 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

Architecture

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)

Domain entities

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

Controllers (current surface)

  • UserController/api/users
  • ProductController/api/products

Repositories are wired for Bid, Order, PaymentMethod, Product, Rating, and User; service layers exist for Product and User.


Run locally

1. Start PostgreSQL

cd EBAY
docker compose up -d

This brings up postgres:15-alpine on localhost:5432 with database ebay_db, user ebay_user, password ebay_password (defaults in docker-compose.yml).

2. Run the API

./mvnw spring-boot:run

The application starts on the default Spring port (8080).

3. Stop the database

docker compose down

Test

./mvnw test

Includes a Spring Boot @SpringBootTest context-load smoke test plus the JPA / web / validation test slices configured through the Spring Boot test starters.


Project layout

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

License

MIT — see LICENSE.

About

Spring Boot REST API for an auction-style marketplace (users, products, bids, orders) with Docker Compose and JUnit integration tests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages