Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

docker/db/
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
## [본 과정] 이커머스 핵심 프로세스 구현
[단기 스킬업 Redis 교육 과정](https://hh-skillup.oopy.io/) 을 통해 상품 조회 및 주문 과정을 구현하며 현업에서 발생하는 문제를 Redis의 핵심 기술을 통해 해결합니다.
> Indexing, Caching을 통한 성능 개선 / 단계별 락 구현을 통한 동시성 이슈 해결 (낙관적/비관적 락, 분산락 등)
## Multi Module Design

#### **의존관계**
- `presentation` → `application` → `infrastructure`
- `application` → `domain`
- `infrastructure` → `domain`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모듈간 순환참조가 없이 잘 구현된 것 같습니다. 👍


#### **모듈별 역할**
- 각 모듈의 상세 설명은 해당 모듈 디렉토리 내 README.md 파일을 참고하십시오.

---

## Table Design
- 테이블 구조는 아래의 다이어그램으로 대체됩니다.
- **![img.png](img.png)**

---

## Architecture

- **Port-Adapter 패턴 적용**
- 각 모듈 간 결합을 제거하여 독립성을 유지합니다.
- `Application` 계층은 비즈니스 로직만 담당하며, 외부 기술에 의존하지 않습니다.
- `Infrastructure` 계층은 외부 기술(JPA, DB, API 등)을 담당하며, Port를 통해 `Application`과 통신합니다.

---

## API Design

#### **`GET /api/v1/screenings`**
- 최신 영화별로 그룹핑하여 빠른 시간순으로 정렬된 상영 영화 목록을 반환합니다.
- 기본적으로 오늘부터 2일 이내 상영 영화 목록을 반환하며, 클라이언트 요청에 따라 기간을 조정할 수 있습니다.
- **HTTP 요청 예시**:
- IntelliJ Http Client `http/getScreenings.http` 참고.

---

## 프로젝트 주요 특징
- **모듈화된 설계**: 명확한 책임 분리를 통해 유지보수와 확장성을 높임.
- **API 유연성**: 다양한 클라이언트 요청 시나리오를 지원할 수 있는 유연한 파라미터 설계.
- **테이블 설계와 아키텍처**: 프로젝트 구조와 데이터베이스 설계를 통해 높은 일관성과 성능을 유지.

---

## 데이터 관리
- **flyway**로 형상 관리. Movie, Genre, Seat, Cinema 엔티티 생성 및 기본 데이터 생성
- Screening(상영 영화 시간표)는 ``CommandLineRunner``를 구현하여 프로잭트 구동 시 생성
60 changes: 60 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
plugins {
id 'java'
id 'io.spring.dependency-management' version '1.1.7'
}

group = 'project.redis'
version = '0.0.1-SNAPSHOT'


repositories {
mavenCentral()
}

dependencyManagement {
imports {
mavenBom 'org.springframework.boot:spring-boot-dependencies:3.4.1'
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}


dependencies {
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'


testCompileOnly 'org.projectlombok:lombok:1.18.36'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.36'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}


test {
useJUnitPlatform()
}
}


jar {
enabled = false
}
21 changes: 21 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'
services:
redis-movie:
image: mysql:9.1.0
container_name: cinema-mysql
restart: always
ports:
- "3309:3306"
volumes:
- ./db/conf.d:/etc/mysql/conf.d
- ./db/data:/var/lib/mysql
- ./db/initdb.d:/docker-entrypoint-initdb.d
environment:
- TZ=Asia/Seoul
- MYSQL_ROOT_PASSWORD=1234
- MYSQL_DATABASE=redis-movie
- MYSQL_USER=hongs
- MYSQL_PASSWORD=local1234
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#org.gradle.configuration-cache=true
#org.gradle.parallel=true
#org.gradle.caching=true
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading