Skip to content

f-lab-edu/ECom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ECom - Enterprise E-Commerce Platform

Java Spring Boot MySQL Redis License

πŸ“‹ ν”„λ‘œμ νŠΈ κ°œμš”

ECom은 ν˜„λŒ€μ μΈ λ§ˆμ΄ν¬λ‘œμ„œλΉ„μŠ€ μ•„ν‚€ν…μ²˜λ₯Ό 기반으둜 κ΅¬μΆ•λœ E-commerce ν”Œλž«νΌμž…λ‹ˆλ‹€. Spring Boot 3.x와 Java 17을 μ‚¬μš©ν•˜μ—¬ κ°œλ°œλ˜μ—ˆμœΌλ©°, ν™•μž₯μ„±κ³Ό μœ μ§€λ³΄μˆ˜μ„±μ„ κ³ λ €ν•œ λ©€ν‹°λͺ¨λ“ˆ ꡬ쑰둜 μ„€κ³„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🎯 μ£Όμš” κΈ°λŠ₯

  • μ‚¬μš©μž 관리: JWT 기반 인증/인가 μ‹œμŠ€ν…œ
  • RBAC λ³΄μ•ˆ: μ—­ν•  기반 μ ‘κ·Ό μ œμ–΄ (User, Admin, Super Admin)
  • μƒν’ˆ 관리: μΉ΄ν…Œκ³ λ¦¬λ³„ μƒν’ˆ 관리, 이미지 μ—…λ‘œλ“œ, 검색 및 필터링
  • μž₯λ°”κ΅¬λ‹ˆ: μ‹€μ‹œκ°„ μž₯λ°”κ΅¬λ‹ˆ 관리 및 μ„Έμ…˜ μœ μ§€
  • μ£Όλ¬Έ 처리: μ£Όλ¬Έ 생성, 결제 처리, μ£Όλ¬Έ 좔적
  • 배솑 관리: λ°°μ†‘μ£Όμ†Œ 관리, κΈ°λ³Έ μ£Όμ†Œ μ„€μ •
  • κ΄€λ¦¬μž μ‹œμŠ€ν…œ: μƒν’ˆ, μ£Όλ¬Έ, μ‚¬μš©μž 관리

πŸ—οΈ 기술 μŠ€νƒ

Backend

  • Framework: Spring Boot 3.4.3, Spring Security, Spring Data JPA
  • Language: Java 17
  • Build Tool: Gradle 8.x
  • Authentication: JWT (jjwt 0.11.5)
  • Authorization: RBAC (Role-Based Access Control)
  • Query: QueryDSL 5.0.0
  • Validation: Spring Boot Starter Validation

Database & Cache

  • Primary DB: MySQL 8.0
  • Cache: Redis
  • Connection Pool: HikariCP

File Storage

  • Cloud: AWS S3
  • Local Development: MinIO

Infrastructure

  • Containerization: Docker, Docker Compose
  • Testing: JUnit 5, Spring Boot Test, H2 (Test DB)

πŸ›οΈ μ•„ν‚€ν…μ²˜

graph TB
    subgraph "Client Layer"
        WEB[Web Client]
        MOBILE[Mobile App]
        ADMIN[Admin Panel]
    end
    
    subgraph "Gateway Layer"
        LB[Load Balancer]
    end
    
    subgraph "Application Layer"
        API[API Module]
        ADMIN_API[Admin Module]
    end
    
    subgraph "Core Layer"
        CORE[Core Module]
        DOMAIN[Domain Entities]
        REPO[Repositories]
    end
    
    subgraph "Infrastructure Layer"
        DB[(MySQL 8.0)]
        REDIS[(Redis Cache)]
        S3[AWS S3/MinIO]
    end
    
    WEB --> LB
    MOBILE --> LB
    ADMIN --> LB
    LB --> API
    LB --> ADMIN_API
    API --> CORE
    ADMIN_API --> CORE
    CORE --> DB
    CORE --> REDIS
    CORE --> S3
    
    classDef client fill:#e1f5fe
    classDef app fill:#f3e5f5
    classDef core fill:#e8f5e8
    classDef infra fill:#fff3e0
    
    class WEB,MOBILE client
    class API,ADMIN_API app
    class CORE core
    class DB,REDIS,S3 infra
Loading

λ©€ν‹°λͺ¨λ“ˆ ꡬ쑰

ECom/
β”œβ”€β”€ api/                          # API λͺ¨λ“ˆ (μ‚¬μš©μž λŒ€μƒ)
β”‚   └── src/main/java/com/example/api/
β”‚       β”œβ”€β”€ ApiApplication.java
β”‚       β”œβ”€β”€ core/config/          # API μ„€μ •
β”‚       └── module/               # κΈ°λŠ₯별 λͺ¨λ“ˆ
β”‚           β”œβ”€β”€ auth/             # 인증
β”‚           β”œβ”€β”€ cart/             # μž₯λ°”κ΅¬λ‹ˆ
β”‚           β”œβ”€β”€ order/            # μ£Όλ¬Έ
β”‚           β”œβ”€β”€ product/          # μƒν’ˆ
β”‚           β”œβ”€β”€ payment/          # 결제
β”‚           └── shipping_address/ # λ°°μ†‘μ£Όμ†Œ
β”œβ”€β”€ admin/                        # κ΄€λ¦¬μž λͺ¨λ“ˆ
β”‚   └── src/main/java/com/example/admin/
β”‚       β”œβ”€β”€ AdminApplication.java
β”‚       └── module/
β”‚           └── auth/             # κ΄€λ¦¬μž 인증
β”œβ”€β”€ core/                         # 핡심 λͺ¨λ“ˆ (곡톡)
β”‚   └── src/main/java/com/example/core/
β”‚       β”œβ”€β”€ CoreApplication.java
β”‚       β”œβ”€β”€ config/               # 곡톡 μ„€μ •
β”‚       β”œβ”€β”€ domain/               # 도메인 μ—”ν‹°ν‹°
β”‚       β”œβ”€β”€ dto/                  # 데이터 전솑 객체
β”‚       β”œβ”€β”€ enums/                # μ—΄κ±°ν˜•
β”‚       β”œβ”€β”€ exception/            # μ˜ˆμ™Έ 처리
β”‚       β”œβ”€β”€ model/                # 응닡 λͺ¨λΈ
β”‚       └── utils/                # μœ ν‹Έλ¦¬ν‹°
β”œβ”€β”€ docker-compose.yml            # 둜컬 개발 ν™˜κ²½
└── build.gradle                  # λΉŒλ“œ μ„€μ •

πŸš€ λΉ λ₯Έ μ‹œμž‘

ν•„μˆ˜ 쑰건

  • Java 17+
  • Docker & Docker Compose
  • Gradle 8.x+

개발 ν™˜κ²½ μ„€μ •

  1. μ €μž₯μ†Œ 클둠
git clone https://github.com/f-lab-edu/ECom.git
cd ECom
  1. 인프라 μ„œλΉ„μŠ€ μ‹œμž‘
docker-compose up -d
  1. μ• ν”Œλ¦¬μΌ€μ΄μ…˜ λΉŒλ“œ 및 μ‹€ν–‰
# Core λͺ¨λ“ˆ λΉŒλ“œ
./gradlew :core:build

# API μ„œλ²„ μ‹€ν–‰
./gradlew :api:bootRun

# κ΄€λ¦¬μž μ„œλ²„ μ‹€ν–‰ (별도 터미널)
./gradlew :admin:bootRun
  1. μ„œλΉ„μŠ€ 확인

πŸ“š API λ¬Έμ„œ

인증 (Authentication)

Method Endpoint Description Auth Required
POST /api/v1/auth/signup νšŒμ›κ°€μž… ❌
POST /api/v1/auth/login 둜그인 ❌
POST /api/v1/auth/refresh 토큰 κ°±μ‹  ❌

μƒν’ˆ (Products)

Method Endpoint Description Auth Required
GET /api/v1/products μƒν’ˆ 검색 (μΉ΄ν…Œκ³ λ¦¬, 가격, μ •λ ¬, νŽ˜μ΄μ§•) ❌
GET /api/v1/products/{productId} μƒν’ˆ 상세 쑰회 ❌
POST /api/v1/products/image 이미지 μ—…λ‘œλ“œ βœ… (ADMIN/SUPER_ADMIN)
POST /api/v1/products μƒν’ˆ 생성 βœ… (ADMIN/SUPER_ADMIN)
PUT /api/v1/products/{productId} μƒν’ˆ μˆ˜μ • βœ… (ADMIN/SUPER_ADMIN)
DELETE /api/v1/products/{productId} μƒν’ˆ μ‚­μ œ βœ… (ADMIN/SUPER_ADMIN)

μž₯λ°”κ΅¬λ‹ˆ (Cart)

Method Endpoint Description Auth Required
GET /api/v1/cart μž₯λ°”κ΅¬λ‹ˆ 쑰회 βœ… (USER)
POST /api/v1/cart/products μƒν’ˆ μΆ”κ°€ βœ… (USER)
PUT /api/v1/cart/products/{productId} μˆ˜λŸ‰ μˆ˜μ • βœ… (USER)
DELETE /api/v1/cart/products/{productId} μƒν’ˆ μ‚­μ œ βœ… (USER)

μ£Όλ¬Έ (Orders)

Method Endpoint Description Auth Required
POST /api/v1/order/product μƒν’ˆ μ£Όλ¬Έ βœ… (USER)
GET /api/v1/order μ£Όλ¬Έ λͺ©λ‘ 쑰회 βœ… (USER)
GET /api/v1/order/{orderId} μ£Όλ¬Έ 상세 쑰회 βœ… (USER)

λ°°μ†‘μ£Όμ†Œ (Shipping Address)

Method Endpoint Description Auth Required
GET /api/v1/shipping-address λ°°μ†‘μ£Όμ†Œ λͺ©λ‘ βœ… (USER)
POST /api/v1/shipping-address λ°°μ†‘μ£Όμ†Œ 생성 βœ… (USER)
PUT /api/v1/shipping-address/{addressId} λ°°μ†‘μ£Όμ†Œ μˆ˜μ • βœ… (USER)
PUT /api/v1/shipping-address/{addressId}/default κΈ°λ³Έ μ£Όμ†Œ μ„€μ • βœ… (USER)
DELETE /api/v1/shipping-address/{addressId} λ°°μ†‘μ£Όμ†Œ μ‚­μ œ βœ… (USER)

κ΄€λ¦¬μž (Admin)

Method Endpoint Description Auth Required
POST /admin/v1/auth/login κ΄€λ¦¬μž 둜그인 ❌
POST /admin/v1/auth/refresh 토큰 κ°±μ‹  ❌
POST /admin/v1/auth/admins κ΄€λ¦¬μž 생성 βœ… (SUPER_ADMIN)

κΆŒν•œ μš”μ•½

κΈ°λŠ₯ USER ADMIN SUPER_ADMIN
νšŒμ›κ°€μž…/둜그인 βœ… βœ… βœ…
μƒν’ˆ 쑰회 βœ… βœ… βœ…
μž₯λ°”κ΅¬λ‹ˆ 관리 βœ… ❌ ❌
μ£Όλ¬Έ 생성/쑰회 βœ… ❌ ❌
λ°°μ†‘μ£Όμ†Œ 관리 βœ… ❌ ❌
μƒν’ˆ 관리 (CRUD) ❌ βœ… βœ…
κ΄€λ¦¬μž 생성 ❌ ❌ βœ…
  • Method-Level Security: @PreAuthorize μ–΄λ…Έν…Œμ΄μ…˜ ν™œμš©
  • URL-Level Security: Spring Security ν•„ν„° 체인 ν™œμš©
  • JWT 톡합: 토큰에 μ—­ν•  정보 포함
  • μžλ™ μ—­ν•  ν• λ‹Ή: νšŒμ›κ°€μž… μ‹œ ROLE_USER μžλ™ λΆ€μ—¬

μ„±λŠ₯ μ΅œμ ν™”

  • 캐싱: Redisλ₯Ό ν™œμš©ν•œ 쑰회 μ„±λŠ₯ ν–₯상
  • Pessimistic Lock: 재고 관리 λ™μ‹œμ„± μ œμ–΄

λ³΄μ•ˆ

  • RBAC (Role-Based Access Control): μ—­ν•  기반 μ ‘κ·Ό μ œμ–΄ μ‹œμŠ€ν…œ
    • ROLE_USER: 일반 μ‚¬μš©μž κΆŒν•œ (μž₯λ°”κ΅¬λ‹ˆ, μ£Όλ¬Έ, λ°°μ†‘μ£Όμ†Œ 관리)
    • ROLE_ADMIN: κ΄€λ¦¬μž κΆŒν•œ (μƒν’ˆ 관리, μ‚¬μš©μž 쑰회)
    • ROLE_SUPER_ADMIN: 졜고 κ΄€λ¦¬μž κΆŒν•œ (κ΄€λ¦¬μž 생성, 전체 μ‹œμŠ€ν…œ 관리)
  • JWT 인증: 토큰 기반 인증/인가, μ—­ν•  정보 포함
  • Method-Level Security: @PreAuthorize μ–΄λ…Έν…Œμ΄μ…˜μ„ ν†΅ν•œ μ„Έλ°€ν•œ κΆŒν•œ μ œμ–΄
  • URL-Level Security: Spring Security 섀정을 ν†΅ν•œ μ—”λ“œν¬μΈνŠΈλ³„ μ ‘κ·Ό μ œμ–΄
  • λΉ„λ°€λ²ˆν˜Έ Salt + Hash μ €μž₯

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages