A backend e-commerce system built with Java and Spring Boot.
- Create products
- View products
- Update products
- Delete products
- Track inventory
- Create users
- View users
- Delete users
- Create orders
- Link orders to users
- Add multiple products per order
- Calculate total price automatically
- Transactional order creation
- Java 17
- Spring Boot
- Spring Data JPA
- PostgreSQL
- Docker
- Maven
User → Orders → OrderItems → Products
src
├── controller
├── dto
├── entity
├── repository
├── service
docker run --name ecommerce_postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=ecommerce \
-p 5433:5432 \
-d postgres:16`docker run --name ecommerce_postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=ecommerce \
-p 5433:5432 \
-d postgres:16`curl -X POST http://localhost:8080/api/products \
-H "Content-Type: application/json" \
-d '{"name":"Keyboard","description":"Mechanical","price":99.99,"stockQuantity":10}'curl -X POST http://localhost:8080/api/orders \
-H "Content-Type: application/json" \
-d '{
"userId": 1,
"items": [
{
"productId": 1,
"quantity": 2
}
]
}'