Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ“œ ๋ฆฌ๋“œ๋ฏธ ์ž‘์„ฑ #81

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
58 changes: 0 additions & 58 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

192 changes: 192 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,194 @@
# outfit-of-the-weather
[#OOTW] ๊ทธ๋‚ ์˜ ๋‚ ์”จ๋ฅผ ๋ณด๊ณ  ์˜ค๋Š˜์˜ ์ฝ”๋””๋ฅผ ๊ณต์œ ํ•˜๋Š” ์ปค๋ฎค๋‹ˆํ‹ฐ By ๋นฝ์—”๋‘๋ฆฌ

### ํด๋ก  ํƒ€๊ฒŸ

- [๊พธ์˜จ๊พธ](https://korean.visitkorea.or.kr/detail/rem_detail.do?cotid=14a13909-134a-4a0e-a581-fc1ace95d925)
- ํ˜„์žฌ ๋‚ ์”จ๋ฅผ ํ™•์ธํ•˜๊ณ  ๋‚ ์”จ์— ๋งž์ถฐ ์•„๋ฐ”ํƒ€๋ฅผ ์ฝ”๋””ํ•œ ํ›„ ์ „๊ตญ์˜ ์—ฌํ–‰์ง€๋ฅผ ๋ฐฐ๊ฒฝ์œผ๋กœ ์‚ฌ์ง„์„ ์ฐ์–ด ์—…๋กœ๋“œํ•˜๋Š” ๊ฒŒ์‹œํŒ
- ๋ ˆํผ๋Ÿฐ์Šค ์ด๋ฏธ์ง€

![แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2024-01-16 แ„‹แ…ฉแ„’แ…ฎ 3.17.30.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/a557051f-c7ef-49b4-83dc-fbd1373d5693/6cef6311-6a06-48cd-9643-c1a131869bec/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA_2024-01-16_%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE_3.17.30.png)

### ๊ฐœ๋ฐœ ๋ชฉํ‘œ

- ํ˜„์žฌ์˜ ๋‚ ์”จ๋ฅผ ๋ณด๊ณ  ๊ทธ์— ๋งž๋Š” ์•„๋ฐ”ํƒ€ ์ฝ”๋””๋ฅผ ์„ ํƒํ•ด ์ด๋ฏธ์ง€๋ฅผ ์ €์žฅํ•  ์ˆ˜ ์žˆ๊ณ  ์ €์žฅํ•œ ์ด๋ฏธ์ง€๋ฅผ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒŒ์‹œํŒ์„ ๋งŒ๋“œ๋Š” ๊ฒƒ์„ 1์ฐจ ํ”„๋กœ์ ํŠธ mvp๋กœ ์‚ผ๊ณ  ์ง„ํ–‰
- ์ดํ›„ ํ”„๋กœ์ ํŠธ ๊ณ ๋„ํ™”์— ๋”ฐ๋ผ ์—ฌ๋Ÿฌ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€์ ์œผ๋กœ ๊ตฌํ˜„ ์˜ˆ์ •
- ์ตœ์ข…์ ์œผ๋กœ ํ•ด๋‹น ์ฝ˜ํ…์ธ ๋ฅผ ๋ฉ”์ธ์œผ๋กœ ์•„๋ฐ”ํƒ€ ์•„์ดํ…œ ์ƒ๊ฑฐ๋ž˜๊ฐ€ ๊ฐ€๋Šฅํ•œ ์ปค๋จธ์Šค ์‹œ์Šคํ…œ ๋„์ž…์„ ๋ชฉํ‘œ๋กœ ์ง„ํ–‰ ์˜ˆ์ •

<details>
<summary>moscow</summary>

- Must Have: ๋‚ ์”จ API ๊ธฐ๋ฐ˜ ๊ฒŒ์‹œ๊ธ€, ์‚ฌ์šฉ์ž ์ธ์ฆ, ์ด๋ฏธ์ง€ ์„œ๋น„์Šค
- Should Have: ๋Œ“๊ธ€, ๋ฌดํ•œ ์Šคํฌ๋กค, ์‚ฌ์šฉ์ž ์ธ์ฆ/์ธ๊ฐ€, ์†Œ์…œ ๋กœ๊ทธ์ธ, ์ข‹์•„์š”, ํ•ด์‹œํƒœ๊ทธ, ํžˆ์Šคํ† ๋ฆฌ
- Could Have: ๊ฒ€์ƒ‰, ์„œ๋น„์Šค ๊ตฌ๋…, ์‚ฌ์šฉ์ž ๊ถŒํ•œ, ์‚ฌ์šฉ์ž ์ธ์ฆ/์ธ๊ฐ€
- Won't Have: ๊ฒŒ์‹œ๊ธ€ ๋ถ๋งˆํฌ, ์•Œ๋ฆผ, ์ด๋ฉ”์ผ, ์•„๋ฐ”ํƒ€ ์•„์ดํ…œ ์ปค๋จธ์Šค, ํ†ตํ•ฉํšŒ์›, ํœด๋Œ€ํฐ ์ธ์ฆ

</details>

### ๊ธฐ์ˆ  ์Šคํƒ

- java 17
- springboot 3.2.0
- spring security
- jsonwebtoken jjwt 0.12.3
- openfeign 4.1.0
- spring data jpa
- spring data redis
- spring mail
- green mail
- minio 8.5.7

### ํŒ€ ์—ญํ• (SM, PO, Dev)

<table>
<tr align="center">
<td><B>SM</B></td>
<td><B>PO</B></td>
<td><B>Dev</B></td>
</tr>
<tr align="center">
<td><a href="https://github.com/Sehee-Lee-01">์ด์„ธํฌ</a></td>
<td><a href="https://github.com/shoeone96">์ด์ค‘์›</a></td>
<td><a href="https://github.com/ASak1104">๊น€ํ˜„์šฐ</a></td>
</tr>
<tr align="center">
<td>
<img src="https://github.com/Sehee-Lee-01.png?size=100">
</td>
<td>
<img src="https://github.com/shoeone96.png?size=100">
</td>
<td>
<img src="https://github.com/ASak1104.png?size=100">
</td>
</tr>
</table>

1. ๊ทธ๋ผ์šด๋“œ ๋ฃฐ
- **ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…** ๊ฒฝํ—˜์€ **2์ฃผ ๋‚ด**์— ๊ธฐ๋กํ•˜๊ณ  ๊ณต์œ 
- [Git Wiki](https://github.com/spring-comes-to-us/outfit-of-the-weather/wiki)์— ์ž‘์„ฑ
- **๊ฐ€๋…์„ฑ**์„ ์ค‘์š”ํ•˜๊ฒŒ ์ƒ๊ฐํ•˜์—ฌ ์ฝ”๋“œ ์ž‘์„ฑ.
- ์„œ๋กœ์˜ ์ง€์‹์„ **๊ณต์œ **ํ•˜๊ณ  ์ฝ”๋“œ์™€ ์˜๊ฒฌ์„ **์กด์ค‘**ํ•˜์ž
2. ์Šคํฌ๋Ÿผ ๊ทœ์น™

| ์ง„ํ–‰ ์‹œ๊ฐ„ | ๋‚ด์šฉ |
| --- | --- |
| ๋งค์ผ ์˜ค์ „ 9์‹œ, 15~30๋ถ„ <br>(QR ์ฐ๊ณ  ์ง„ํ–‰) | - ์–ด์ œ ํ•œ ์ผ(์ „๋‚  ์ปค๋ฐ‹ ๊ธฐ๋ก) ๊ณต์œ  <br>- ์˜ค๋Š˜ ํ•  ์ผ(์ฒดํฌ ๋ฆฌ์ŠคํŠธ) ๊ณต์œ  |
| ๊ธˆ์š”์ผ ์˜ค์ „ 9์‹œ <br>(QR ์ฐ์ž๋งˆ์ž ์ง„ํ–‰) | - ์Šคํ”„๋ฆฐํŠธ(1์ฃผ) ํšŒ๊ณ , ํ”ผ๋“œ๋ฐฑ |
3. ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…
4. ํ”„๋กœ์ ํŠธ ๊ด€๋ฆฌ

## ์ฃผ์š” ๊ธฐ๋Šฅ

### ์œ ์ € ๊ธฐ๋Šฅ

- ํšŒ์›๊ฐ€์ž…
- Email ๊ฒ€์ฆ
- [RFC 5322](https://www.rfc-editor.org/rfc/rfc5322#section-3.4.1)๊ธฐ์ค€์˜ ์ •๊ทœ ํ‘œํ˜„์‹ ๊ฒ€์ฆ
- ์ตœ๋Œ€ ๊ธธ์ด 255
- Password ๊ฒ€์ฆ
- ์ตœ์†Œ ํ•œ ๊ฐœ ์ด์ƒ์˜ ์˜๋ฌธ์ž, ์ˆซ์ž, ํŠน์ˆ˜๋ฌธ์ž๊ฐ€ ๊ฐ๊ฐ ํ•„์š”
- ์ตœ์†Œ ๊ธธ์ด 8, ์ตœ๋Œ€ ๊ธธ์ด 30
- DTO์—์„œ`@Password`์ปค์Šคํ…€ ์–ด๋…ธํ…Œ์ด์…˜ ๊ธฐ๋ฐ˜์œผ๋กœ ์ง„ํ–‰
- Entity ์ƒ์„ฑ์ž๋ฅผ ํ†ตํ•œ 2์ฐจ ๊ฒ€์ฆ
- ์ธ์ฆ ์ฝ”๋“œ ๋ฐœ์†ก
- ํšŒ์›๊ฐ€์ž… ์‹œ ํšŒ์›๊ฐ€์ž…ํ•œ Email๋กœ ์ธ์ฆ ์ฝ”๋“œ ๋‚ ๋ฆฌ๋Š” ์‹œ์Šคํ…œ ๋„์ž… (์žฌ์ „์†ก ๊ฐ€๋Šฅ)
- Spring `MailSender`๋กœ ํšŒ์› ๊ฐ€์ž…์ž ์ด๋ฉ”์ผ๋กœ ํšŒ์› ๊ฐ€์ž… ์ธ์ฆ ์ฝ”๋“œ ์ „์†ก
- mail์„ ๋ณด๋‚ด๋Š” ๋ฉ”์„œ๋“œ๋Š” `@Async`๋ฅผ ์ด์šฉํ•˜์—ฌ ๋น„๋™๊ธฐ ์ฒ˜๋ฆฌ
- ํšŒ์› ์ •๋ณด๋ฅผ ์ €์žฅํ•˜๋˜ ํšŒ์› ์ธ์ฆ ์—ฌ๋ถ€(`certified`)๋ฅผ `false`๋กœ ์ €์žฅํ•˜๊ณ  `true`๊ฐ€ ๋  ๋•Œ๊นŒ์ง€ ๋กœ๊ทธ์ธ ์„œ๋น„์Šค๋ฅผ ์ด์šฉํ•  ์ˆ˜ ์—†๊ฒŒ ์„ค์ •
- `GreenMail` ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ†ตํ•œ ์ธ์ฆ ์ฝ”๋“œ ์ „์†ก ํ…Œ์ŠคํŠธ ์ง„ํ–‰
- ํšŒ์›๊ฐ€์ž… ์ฝ”๋“œ ์ธ์ฆ
- ๊ฐ€์ž…ํ•œ ์ด๋ฉ”์ผ๊ณผ ์ฝ”๋“œ๋ฅผ body์— ๋‹ด์•„ ํšŒ์› ๊ฐ€์ž… ์ธ์ฆ ์ง„ํ–‰
- ํšŒ์› ํ…Œ์ด๋ธ”์˜ `certified` column์„ `true`๋กœ ๋ณ€๊ฒฝํ•˜๊ณ  ๋กœ๊ทธ์ธ ํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋งŒ๋“ฌ
- ์ธ์ฆ ์ฝ”๋“œ๋ฅผ `Redis`์—์„œ ๊ด€๋ฆฌ
- Redis TTL ์„ค์ •์œผ๋กœ 10๋ถ„์ด ์ง€๋‚œ ์ธ์ฆ ์ฝ”๋“œ๋Š” ๋งŒ๋ฃŒ ์ฒ˜๋ฆฌ
- ๋กœ๊ทธ์ธ
- jwtToken ๊ธฐ๋ฐ˜์˜ ์ธ์ฆ ์‹œ์Šคํ…œ ๋„์ž…
- ๋กœ๊ทธ์ธ ์ •๋ณด๋ฅผ ๋ฐ›์€ ํ›„ ์œ ์ € ๊ฒ€์ฆ ํ›„ `TokenProvider`๋ฅผ ํ†ตํ•ด ํ† ํฐ ๋ฐœ๊ธ‰ ๋ฐ ๊ฒ€์ฆ
- ํ† ํฐ ํ”„๋กœ์„ธ์Šค๋Š” `jsonwebtoken jjwt` ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ™œ์šฉ
- Token ์ธ์ฆ ํ•„ํ„ฐ
- SecurityFilter ๋‚ด๋ถ€์— `JwtAuthenticationFilter`๋ฅผ ์ถ”๊ฐ€
- `JwtAuthenticationFilter`์—์„œ ๋กœ๊ทธ์ธ ์‹œ ์‚ฌ์šฉํ•œ ํ† ํฐ์„ ํŒŒ์‹ฑ ํ›„ `userId`๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ `UsernameAuthenticationToken`์„ ์ƒ์„ฑ
ํ›„ `SecurityContext`์— ์ €์žฅ
- ๋กœ๊ทธ์ธ์ด ํ•„์š”ํ•œ API์—์„œ `Authentication` ๊ฐ์ฒด๋ฅผ ๋ฐ›๊ฑฐ๋‚˜ ์ง์ ‘ `principal`์„ ํ˜ธ์ถœํ•˜๋Š” ๋ฉ”์„œ๋“œ๋กœ user ์ •๋ณด ํ˜ธ์ถœ

### ํ˜„์žฌ ๋‚ ์”จ ์กฐํšŒ ๊ธฐ๋Šฅ

- ๊ธฐ์ƒ์ฒญ OpenAPI ํ˜ธ์ถœ
- `OpenFeign`์„ ์ด์šฉํ•˜์—ฌ ๊ธฐ์ƒ์ฒญ API๋ฅผ ํ˜ธ์ถœ
- ๊ธฐ์ƒ์ฒญ API ์‘๋‹ต ์ค‘ ํ˜„์žฌ ๋‚ ์”จ ์ •๋ณด(ํ˜„์žฌ ๊ธฐ์˜จ, ๊ฐ•์ˆ˜ ํ˜•ํƒœ, ํ•˜๋Š˜ ์ƒํƒœ) ์ •๋ณด ์กฐํšŒ
- ๋ณต์žกํ•œ OpenAPI ์‘๋‹ต์„ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด `@JsonDeserialize` ๋ฅผ ์ด์šฉํ•˜์—ฌ API ์‘๋‹ต ๋น„์ง๋ ฌํ™” ๊ตฌํ˜„
- ์š”์ฒญ์ด ์ œํ•œ๋œ ๊ธฐ์ƒ์ฒญ API๋ฅผ ๋ฐ˜๋ณต์ ์œผ๋กœ ํ˜ธ์ถœํ•˜๋Š” ๋ฌธ์ œ ์ƒํ™ฉ
- ์ถ”ํ›„ ๋‚ ์”จ ์š”์ฒญ ์œ„์น˜๋ฅผ Enum(์‹œ.๋„.๋™ ๋“ฑ)์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ณ  Redis ๊ธฐ๋Šฅ์„ ์ด์šฉํ•˜์—ฌ ์บ์‹ฑ ๊ธฐ๋Šฅ ์ถ”๊ฐ€ํ•˜์—ฌ ์™ธ๋ถ€ API ์ค‘๋ณต ํ˜ธ์ถœ์„ ์ค„์ผ ์˜ˆ์ •
- `Coordinate` ํด๋ž˜์Šค ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
- `@Grid` ์ปค์Šคํ…€ ์–ด๋…ธํ…Œ์ด์…˜ ๊ธฐ๋ฐ˜์œผ๋กœ Controller์—์„œ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์ง„ํ–‰

### ๊ฒŒ์‹œํŒ ๊ธฐ๋Šฅ

- ๊ฒŒ์‹œํŒ CRUD ๊ธฐ๋Šฅ ์ž‘์„ฑ
- ๋กœ๊ทธ์ธ ์—ฌ๋ถ€์— ๋”ฐ๋ผ ๋ณด์—ฌ์ฃผ๋Š” ์ •๋ณด ๋ถ„๊ธฐ๋ฌธ ์ž‘์„ฑ
- jmeter ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ์ค‘ ๊ฒŒ์‹œ๊ธ€ ๋ชฉ๋ก ์กฐํšŒ ์„ฑ๋Šฅ์ด ๊ฐ€์žฅ ์•ˆ ์ข‹์€ ๊ฒƒ์„ ํ™•์ธ
- ์ถ”ํ›„ ์กฐํšŒ ์„ฑ๋Šฅ์„ ๋” ๋ถ„์„ํ•ด๋ณด๊ณ  ๊ฐœ์„  ์˜ˆ์ •
- ๋ชฉ๋ก ์กฐํšŒ๋Š” ํ•„ํ„ฐ ์กฐํšŒ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•  ์˜ˆ์ •
- ๊ฒŒ์‹œ๊ธ€ ์ƒ์„ฑ ์‹œ `OpenFeign`์„ ์ด์šฉํ•˜์—ฌ ๊ธฐ์ƒ์ฒญ OpenAPI ํ˜ธ์ถœ
- ๊ฒŒ์‹œ๊ธ€ ์ž‘์„ฑ ์‹œ ์ผ๊ต์ฐจ(์ตœ์ €/์ตœ๊ณ  ๊ธฐ์˜จ) ์ •๋ณด ๋ฐ˜์˜ํ•˜์—ฌ ์ €์žฅ
- ๋ ˆ์ด์–ด๋ณ„ ์š”์ฒญ ๊ฐ’ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
- ์š”์ฒญ dto์—์„œ annotation์œผ๋กœ 1์ฐจ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
- Entity ์ƒ์„ฑ์‹œ 2์ฐจ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
- ๊ฒŒ์‹œํŒ ์ข‹์•„์š” ๊ธฐ๋Šฅ
- ์ข‹์•„์š” ์—ฌ๋ถ€(`isLike`) ๋ฐ”๊ฟ”์ฃผ๋Š” Patch API๋กœ ์ข‹์•„์š” ๊ธฐ๋Šฅ ์ฒ˜๋ฆฌ
- ๊ฒŒ์‹œ๊ธ€์— ์ข‹์•„์š”๊ฐ€ ๋ˆŒ๋Ÿฌ์ง„ ์ˆซ์ž๋ฅผ ๊ฒŒ์‹œํŒ ํ…Œ์ด๋ธ”์— ์ถ”๊ฐ€
- ์ข‹์•„์š” ๋™์‹œ์„ฑ ๋ฌธ์ œ ํ•ด๊ฒฐ
- ํ•œ ์‚ฌ๋žŒ์ด ํ•œ ๊ฒŒ์‹œ๋ฌผ์— ๋Œ€ํ•ด ์—ฌ๋Ÿฌ ๋ฒˆ ์ข‹์•„์š”๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ์ƒ๊ธฐ๋Š” ๋ฌธ์ œ
- ์—ฌ๋Ÿฌ ์‚ฌ๋žŒ์ด ํ•œ ๊ฒŒ์‹œ๋ฌผ์— ๋Œ€ํ•˜์—ฌ ๋™์‹œ์— ์ข‹์•„์š”๋ฅผ ๋ˆ„๋ฅด๋Š” ๋ฌธ์ œ
- ๋น„๊ด€์  ๋ฝ(`Pessimistic Lock`)์„ ์‚ฌ์šฉํ•˜์—ฌ ๋™์‹œ์„ฑ ๋ฌธ์ œ ํ•ด๊ฒฐ
- jmeter ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ์ค‘ ๋‘ ๋ฒˆ์งธ๋กœ ์„ฑ๋Šฅ์ด ์•ˆ ์ข‹์€ ๊ฒƒ์„ ํ™•์ธ
(ํ‰๊ท  ์‹œ๊ฐ„์ด ์ „์ฒด ์กฐํšŒ๋ฅผ ์ œ์™ธํ•˜๊ณ  ๊ฐ€์žฅ ์˜ค๋ž˜ ๊ฑธ๋ฆผ)
- ์ถ”ํ›„ ์„ฑ๋Šฅ ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ ํ™•์ธ ํ›„ ๋‚™๊ด€์  ๋ฝ(`Optimistic Lock`) or `Redis`๋ฅผ ์ด์šฉํ•œ ์„ฑ๋Šฅ ๊ฐœ์„  ์˜ˆ์ •

### ์•„๋ฐ”ํƒ€ ์ด๋ฏธ์ง€ ๊ธฐ๋Šฅ

- ์•„๋ฐ”ํƒ€ ์ด๋ฏธ์ง€ ๋“ฑ๋ก ๋ฐ ์กฐํšŒ ๊ธฐ๋Šฅ
- Enum Validation annotation ์ƒ์„ฑ ๋ฐ ์ ์šฉ
- ๋ชจ๋“  Enum ํƒ€์ž…์„ String์œผ๋กœ ๋ฐ›๊ณ  ๊ทธ Enum์— ํ•ด๋‹นํ•˜๋Š” ๊ฐ’์ด ์กด์žฌํ•˜์ง€ ์•Š์„ ์‹œ ์˜ˆ์™ธ๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” annotation ์ƒ์„ฑ
- AvatarItem ์ „์šฉ validation ํด๋ž˜์Šค๋กœ Entity validation ์ง„ํ–‰
- ํŒŒ์ผ ์ €์žฅ ์˜คํ”ˆ ์†Œ์Šค `MinIO` ๋„์ž…
- ์ถ”ํ›„ ๋ฐฐํฌ ์‹œ S3์™€์˜ ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•ด ๋กœ์ปฌ ์ž‘์—…์—์„œ MinIO๋ฅผ ๋„์ž…

โ†’ S3 ์„ค์ •๊ณผ MinIO ์„ค์ • ๋ฐ ๋ฉ”์„œ๋“œ๊ฐ€ ๋™์ผํ•˜์—ฌ interface๋กœ ์ž‘์„ฑ, ๋ฐฐํฌ ๋ฒ„์ „์—์„œ๋Š” S3 ๋„์ž… ์˜ˆ์ •

- Docker๋ฅผ ์ด์šฉํ•ด ์ปจํ…Œ์ด๋„ˆ๋กœ ์ด๋ฏธ์ง€ ์ €์žฅ์†Œ ์ƒ์„ฑ
- `MinIO` ์„ค์ • ํ›„ ์ด๋ฏธ์ง€ ์ €์žฅ ๋ฐ ์ด๋ฏธ์ง€ URL ๋ฐ˜ํ™˜ ์„œ๋น„์Šค ์ƒ์„ฑ
- ๊ฒŒ์‹œํŒ, ์•„๋ฐ”ํƒ€ ์ด๋ฏธ์ง€์— ๋กœ์ง ์ง„ํ–‰ ์ค‘ ์ด๋ฏธ์ง€ ์ €์žฅ ํ›„ ์‹คํŒจํ•˜๋ฉด ์ด๋ฏธ์ง€ ์‚ญ์ œํ•˜๋Š” ๋กœ์ง ์ถ”๊ฐ€
- ๋Œ€์šฉ๋Ÿ‰ ์ด๋ฏธ์ง€, ์ด๋ฏธ์ง€ ์ด์™ธ์˜ ํƒ€์ž…์„ ํ•„ํ„ฐ๋ง ํ•ด์ฃผ๋Š” annotation ๊ธฐ๋ฐ˜ validation ์ ์šฉ
- Post, AvatarItem ๋“ฑ ์ด๋ฏธ์ง€๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ํ…Œ์ด๋ธ”์ด ๋งŽ์•„ ์ด๋ฏธ์ง€๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๋ณ„๋„์˜ ํ…Œ์ด๋ธ” ์ƒ์„ฑ
- ์ถ”ํ›„ ์•„๋ฐ”ํƒ€ ์ด๋ฏธ์ง€/๊ฒŒ์‹œ๊ธ€์˜ ์ˆ˜์ • ์‚ญ์ œ ๋กœ์ง ํ›„ ๋ฐœ์ƒ ๊ฐ€๋Šฅํ•œ ์ด๋ฏธ์ง€ ์ •ํ•ฉ์„ฑ ๋ฌธ์ œ ํ™•์ธ ๋ฐ scheduling์„ ๋„์ž…, ์ผ์ • ์‹œ๊ฐ„ ๋งˆ๋‹ค `@Async` ๋ฅผ ์ด์šฉํ•˜์—ฌ ๋น„๋™๊ธฐ์ ์œผ๋กœ ์ฒ˜๋ฆฌ ์ž‘์—…์ค‘
- filename์˜ unique ์กฐ๊ฑด์„ ์œ„ํ•ด UUID๋ฅผ ์ด์šฉํ•œ filename ์ƒ์„ฑ ๋„์ž…

### CI ๋„์ž…(Github Action)

- pull request ์‹œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ๋ชจ๋‘ ๋Œ๋ ค๋ณด๋Š” CI ํ™˜๊ฒฝ ์ƒ์„ฑ
- ๋กœ์ปฌํ™˜๊ฒฝ๊ณผ ๋™์ผํ•˜๊ฒŒ Docker-compose ๊ธฐ๋ฐ˜์˜ ์ปจํ…Œ์ด๋„ˆ ๊ตฌ๋™ ํ›„ test, build๋ฅผ ์ง„ํ–‰ํ•˜๋Š” ๋ฐฉ์‹ ์ ์šฉ
- github secret ๊ธฐ๋ฐ˜์œผ๋กœ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์ง€์ •
- Jacoco ํ…Œ์ŠคํŠธ ๋ฆฌํฌํŠธ ์ž๋™ํ™”

### Jacoco ๋„์ž…

- test coverage๋ฅผ ์„ค์ •ํ•˜์—ฌ ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ์‹œ test code๋ฅผ ์ž‘์„ฑํ•˜์ง€ ๋ชปํ•œ ์ผ€์ด์Šค ํ™•์ธ
- ๋ฉ”์„œ๋“œ ๊ฐœํ–‰ ์ œํ•œ ๋ฐ ๋ถ„๊ธฐ๋ฌธ์— ๋”ฐ๋ฅธ test ๊ธฐ์ค€ ์ถ”๊ฐ€
- Class Line Coverage โ†’ 70% ์ด์ƒ
- Branch Coverage โ†’ 70% ์ด์ƒ
- Method Line Count โ†’ 20์ค„
- ์ „์ฒด ํ”„๋กœ์ ํŠธ ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ **โœจ98.48%โœจ** (2024.01.18 15:00 ๊ธฐ์ค€)

### Check style ๋„์ž…

- google checkstyle ํŒŒ์ผ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํŒ€ ํ”„๋กœ์ ํŠธ์— ์ ํ•ฉํ•œ ์ฝ”๋“œ ์Šคํƒ€์ผ ์ปจ๋ฒค์…˜ ์ •์˜
- import ๋ฌธ, ์—ฌ๋ฐฑ ๋“ฑ ์ฝ”๋“œ ์Šคํƒ€์ผ ์ปจ๋ฒค์…˜์„ build ์‹œ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋„๋ก gradle ์„ค์ •
- ์ •์˜ํ•œ checkstyle ํŒŒ์ผ์„ ํ†ตํ•ด Intelij ์ฝ”๋“œ ์Šคํƒ€์ผ ์ž๋™ ์ •๋ ฌ ์„ค์ •

### JMeter ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ์‹คํ–‰

- ์ˆ˜์น˜๋กœ ๋‚˜ํƒ€๋‚œ ๊ฐ๊ด€์ ์ธ ์„ฑ๋Šฅ์„ ํŒŒ์•…ํ•˜๊ธฐ ์œ„ํ•ด ์ผ๋ถ€ API ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ์ง„ํ–‰
- ๋™์‹œ ์ ‘์†์ด ๋งŽ์•„์ง€๋ฉด ์ผ๋ถ€ ์š”์ฒญ์ด ์˜ˆ์™ธ๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ฒƒ์„ ํ™•์ธ
- ์ตœ๋Œ€ DB Connection Pool์„ ์กฐ์ ˆํ•จ์œผ๋กœ์จ ํ•ด๊ฒฐ
11 changes: 1 addition & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id 'jacoco'
id 'checkstyle'
}

group = 'com.backendoori'
Expand Down Expand Up @@ -83,14 +82,6 @@ jacocoTestCoverageVerification {
}
}
}
dependsOn jacocoTestReport
}

checkstyle {
toolVersion = "10.12.5"
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
configProperties = [
"org.checkstyle.google.suppressionfilter.config" : "suppressions.xml",
"org.checkstyle.google.suppressionxpathfilter.config": "suppressions.xml"
]
dependsOn jacocoTestReport
}
Loading