# Team-03-LinkBook-BE
## ๐คฒ๐ป ํ๋ก์ ํธ ์๊ฐ
๋ถ๋งํฌ ๊ณต์ ํ๋ก์ ํธ
> ๊ตฌํ ๊ธฐ๋ฅ
- JWT์ ์ด์ฉํ ๋ก์ปฌ ๋ก๊ทธ์ธ
<br>
## ๐ฌ ํ ์๊ฐ
<table>
<tr>
<td>
<a href="<https://github.com/Nnagman>">
<img src="<https://avatars.githubusercontent.com/u/16336810?v=4>" width="100px" />
</a>
</td>
<td>
<a href="<https://github.com/suy2on>">
<img src="<https://avatars.githubusercontent.com/u/62363580?v=4>" width="100px" />
</a>
</td>
<td>
<a href="<https://github.com/pppp0722>">
<img src="<https://avatars.githubusercontent.com/u/60428537?v=4>" width="100px" />
</a>
</td>
<td>
<a href="<https://github.com/ChoiYeonho0903>">
<img src="<https://avatars.githubusercontent.com/u/76257508?v=4>" width="100px" />
</a>
</td>
<td>
<a href="<https://github.com/su-pernova>">
<img src="<https://avatars.githubusercontent.com/u/48689213?v=4>" width="100px" />
</a>
</td>
</tr>
<tr>
<td><b>์ด์ฐฝํธ</b></td>
<td><b>์ด์์ฐ</b></td>
<td><b>์ด์ผํ</b></td>
<td><b>์ต์ฐํธ</b></td>
<td><b>๊น์๋ฏธ</b></td>
</tr>
<tr>
<td><b>Product Owner</b></td>
<td><b>Developer</b></td>
<td><b>Developer</b></td>
<td><b>Developer</b></td>
<td><b>Developer</b></td>
</tr>
</table>
<br>
## ๐ ๊ธฐ์ ์คํ
### BackEnd
<table>
<tr>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184301901-63ae039a-87d5-4313-a1ce-a4c90badc242.png>" width="100px"/>
</td>
<td>
<img src="<https://images.velog.io/images/leeseojune53/post/b6527e64-30c9-40d4-a955-ddbc647edec1/Gradle_logo.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184303436-1f388f6f-897f-4305-9435-61edd9b67fea.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184302496-44109fa5-b95b-4044-8562-27608d4ea8d5.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184309540-f9438159-5936-4c14-af39-84913c9d751f.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184309618-4677c412-cd2e-470a-931e-28ba10a3f63b.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184302416-34ad1a13-b691-4617-adff-8dcf917354e0.png>" width="100px" />
</td>
</tr>
<tr>
<td><b>Java 11</b></td>
<td><b>Gradle</b></td>
<td><b>Spring</b></td>
<td><b>Spring Boot</b></td>
<td><b>Spring Data JPA</b></td>
<td><b>Spring Security</b></td>
<td><b>MySQL</b></td>
</tr>
</table>
### TestingTool
<table>
<tr>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184303192-74eac7ec-972e-45bf-81bb-0caf7de6e3d7.png>" width="100px"/>
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184303203-e1589d74-9048-428c-a913-1058f268a69a.png>" width="100px" />
</td>
</tr>
<tr>
<td><b>JUnit</b></td>
<td><b>Mockito</b></td>
</tr>
</table>
### DevOps
<table>
<tr>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184303964-343dfe04-11ba-4331-b4c1-02c117a1dd78.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184303992-5e812469-9e71-4538-9ab7-e62cba87020f.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/76257508/184307814-684c586a-1aef-49ce-95aa-4db34096c803.png>" width="100px" />
</td>
</tr>
<tr>
<td><b>Docker</b></td>
<td><b>GithubAction</b></td>
<td><b>EC2</b></td>
</tr>
</table>
### ๋ฌธ์/ํ์
<table>
<tr>
<td>
<img src="<https://user-images.githubusercontent.com/103566826/177922764-354c44a9-05e9-4d5c-a10c-0da6676a80a0.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/103566826/177922777-83956929-35f0-4746-a51b-98c116da2651.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/103566826/177922791-263bc0f1-bebc-4eee-bdb5-9954af5bbaf9.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/103566826/177922794-5a47df94-fc97-4beb-a6f4-16b24e315757.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/103566826/177922809-866718e0-fb19-4840-9caa-111da31795d1.png>" width="100px" />
</td>
<td>
<img src="<https://user-images.githubusercontent.com/103566826/177922816-6888632c-b218-4635-98d5-189addb835ca.png>" width="100px" />
</td>
</tr>
<tr>
<td><b>Notion</b></td>
<td><b>Slack</b></td>
<td><b>Git</b></td>
<td><b>GitHub</b></td>
<td><b>RestDocs</b></td>
<td><b>AsciiDocs</b></td>
</tr>
</table>
<br>
## โ๏ธ ARCHITECTURE
<img width="1049" alt="infra_structure" src="<https://user-images.githubusercontent.com/76257508/184298185-698ea509-3ba0-4144-9d53-070faadc5cd0.png>">
## ๐ผ ERD

<br>
## ๐ฌ Branch ์ ๋ต, ํ๋ก์ ํธ ํ์ ๊ด๋ฆฌ, CI/CD ํ์ดํ๋ผ์ธ
### Branch ์ ๋ต
- GitHub flow ์ฌ์ฉ
- ํธ๋ ํฌ ๊ธฐ๋ฐ ๊ฐ๋ฐ(Trunk-Based Development)
- `์ด์ ๋ฐํ` โ `๋ธ๋์น ์์ฑ` โ `commit` โ `PR ๋ฐํ` โ `main ๋ธ๋์น merge` โ `์๋ ๋ฐฐํฌ`
### ํ๋ก์ ํธ ํ์ ๊ด๋ฆฌ
- Github Issue + Milestone + Project ์ฌ์ฉ
<img width="1146" alt="project_configuration" src="<https://user-images.githubusercontent.com/76257508/184299178-86279a70-695a-48e7-9caf-2ac0a6292aea.png>">
### CI/CD ํ์ดํ๋ผ์ธ
- Github Action ์ฌ์ฉ
- **PR ์ด ๋ฐํ๋๋ ๊ฒฝ์ฐ**
- **AWS RDS DB** ์ฐ๊ฒฐ ๊ธฐ๋ฐ
- **gradle build** ์ ์ฑ๊ณตํ๋ ๊ฒฝ์ฐ **Github Action** ํต๊ณผ
- **PR ์ด main ๋ธ๋์น์ merge ๋๋ ๊ฒฝ์ฐ**
- **AWS RDS DB** ์ฐ๊ฒฐ ๊ธฐ๋ฐ
- **EC2** ์๋ฒ์ **main** ๋ธ๋์น ์ฝ๋ ์๋ ๋ฐฐํฌ
- **gradle build** ๋ฐ **Docker image build** + **compose up(deploy ๊ณผ์ )** ์ฑ๊ณตํ๋ ๊ฒฝ์ฐ
**Github Action** ํต๊ณผ
## ์ปค๋ฐ ๋ฉ์์ง, PR ๊ท์น
### ์ปค๋ฐ ๋ฉ์์ง
> Type
- ๊น๋ชจ์ง ์ฌ์ฉ
- ์ธํ
๋ฆฌ์ ์ด์์ ๋ค์ ํ๋ฌ๊ทธ์ธ์ผ๋ก ์ปค๋ฐ์ ์ฝ๊ฒ ์ฌ์ฉํ ์ ์์
> 
- ์์ด์ฝ์ [์ฌ๊ธฐ](<https://gitmoji.dev>)๋ฅผ ์ฐธ๊ณ ํ์ฌ ์์ฑ
- ๊น๋ชจ์ง์ ์ ๋ชฉ ์ฌ์ด์ ๋์ด์ฐ๊ธฐ ํ์ง ์์
[ ์์ ] โข โจย ๋ก์ปฌ ๋ก๊ทธ์ธ ๊ธฐ๋ฅ ์ถ๊ฐ โข (์๋ต ๊ฐ๋ฅ) ๋ถ์ฐ ์ค๋ช โข (์๋ต ๊ฐ๋ฅ) ํด๊ฒฐ: #123 / ์ฐธ๊ณ : #456, #789
> Subject
โข ๊ธธ์ด์ง์ง ์๋๋ก ์์ฑ โข "~ ์ถ๊ฐ", "~ ์์ ", "~ ๋ฆฌํฉํ ๋ง", ...
> Body
โข ๋ถ์ฐ์ค๋ช ์ด ํ์ํ ๊ฒฝ์ฐ ์ ํํ์ฌ ์์ฑ
> Footer
โข ๋ถ๊ฐ์ ์ผ๋ก issue tracker id๋ฅผ ์์ฑํ ๋ ์์ฑ
### PR ๊ท์น
- `feat/์์
`์์ ๊ธฐ๋ฅ ๊ฐ๋ฐ ํ `develop`์ PR
- PR ์ ๋ชฉ์ ๋ธ๋์น์์ ์์
ํ ๋จ์ โ Jira ์ฐธ๊ณ
- ๋ณธ๋ฌธ์๋ ๋ฆฌ๋ทฐ์ด๋ค์ด ์์์ผ ๋ ์ฌํญ ๋ช
์
- PR ์์ฑ์๋ PR ํ ํฌ์ธํธ ๋๋ ๋ถ๋ถ์ ์
ํ ์ฝ๋ ๋ฆฌ๋ทฐ๋ก ๋ช
์
- ๋๋จธ์ง ํ์๋ค์ PR ๋ฐ์ ์ ์ฝ๋ ๋ฆฌ๋ทฐ
- ์ฝ๋ ๋ฆฌ๋ทฐ ๋ฐ์๋ ๋ถ๋ถ์ `Resolve conversation`
- ๋ชจ๋ ๋ฆฌ๋ทฐ ๋ฐ์ ์๋ฃ ํ `Merge pull request` ํ๊ฑฐ๋ ์ถ๊ฐ์ ์ธ ์ฝ๋ ๋ฆฌ๋ทฐ๊ฐ ํ์ํ๋ฉด `Re-request review`
<br>
## โ
์คํ๋ฐฉ๋ฒ
### application-database.yaml
``` YAML
spring:
jpa:
properties:
hibernate:
default_batch_fetch_size: 1000
format_sql: true
show-sql: true
generate-ddl: true
hibernate:
ddl-auto: update
datasource:
url: jdbc:mysql://linkbook-1.czvbgr7hie3i.ap-northeast-2.rds.amazonaws.com:3306/linkbook
username:
password:
hikari:
maximum-pool-size: 10
jwt:
access-header : Access-Token
refresh-header : Refresh-Token
issuer: prgrms
client-secret:
access-token-expiry-seconds: 3600
refresh-token-expiry-seconds: 1209600
spring:
mail:
host: smtp.gmail.com
port: 587
protocol: smtp
default-encoding: UTF-8
username: [email protected]
password:
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
# ๋น๋ํ๊ธฐ
./gradlew bootJar
# ๋น๋ ํ ์คํ
./gradlew bootRun
# ๋๋
java -jar {jarํ์ผ}
- ์์ฑ๋ ๋์ด๊ธฐ : ๊ธฐ์ ์ ๋์ , ์์ฐ๋ ์ฃผ์ ๊น๋ํ๊ฒ
- ๊ฐ์ ํ ์ฌํญ ์ฐพ์์ ๋ฆฌํฉํ ๋ง : ์ฑ
์๋ถ๋ฆฌ, ํ
์คํธ, ์ํคํ
์ฒ.. , change log์ ํ๊ทธ์ ๋จ๊ฒจ๋๊ธฐ, github release๊ธฐ๋ฅ
- README ์ ์์ฑํ๊ธฐ : ์ํคํ
์ณ, CICD, branch์ ๋ต, test, ์คํ๋ฐฉ๋ฒ
- ๋ฆฐํฐ/ํฌ๋งคํฐ๋ฅผ ์ด์ฉํ ์ฝ๋ ์ปจ๋ฒค์
์ ์ง : pre-commit, pre-push
- ํ
์คํธ ์ฝ๋ ์์ฑํ๊ธฐ
- ๊ฐ๋ฐ/์ด์ ํ๊ฒฝ๊ด๋ฆฌ : DB, API, ํ๊ฒฝ๋ณ์โฆ
- ์๋ํ : CI, CD ๋๊ตฌ๋ค ์ ํ
- ๋ฆด๋ฆฌ์ฆ : ๋ฒ์ ๋(์๋ฉํ
), ํ๊ทธ, ๋์ปค์ ํจ๊ป์ธ๋ ๊ณ ๋ฏผ