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

docs: Update README.md #331

Merged
merged 4 commits into from
Aug 31, 2024
Merged
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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Set FCM_JSON_PATH
run: echo "FCM_JSON_PATH=smeem-output-notification/src/main/resources/firebase-config/smeem_fcm_dev.json" >> $GITHUB_ENV

- name: Create FireBase JSON file From AWS
run: |
aws s3 cp --region ap-northeast-2 s3://${{ secrets.AWS_BUCKET_NAME }}/json/smeem_fcm.json smeem-notification/src/main/resources/firebase-config/smeem_fcm.json
run: aws s3 cp --region ap-northeast-2 ${{ secrets.AWS_S3_FCM_JSON_URI_DEV }} ${{ env.FCM_JSON_PATH }}

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
Expand Down
98 changes: 27 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,61 @@
# Smeem(์Šค๋ฐˆ) Server
# Smeem(์Šค๋ฐˆ)

### ์ผ๊ธฐ๋กœ ์‹œ์ž‘ํ•˜๋Š” ์™ธ๊ตญ์–ด ํ›ˆ๋ จ, ์Šค๋ฐˆ โœ๏ธ

<img width="908" alt="image" src="https://github.com/Team-Smeme/Smeme-server-renewal/assets/55437339/d375dc1c-abb0-4e2e-a6e5-aad074913114">

<br/><br/>

- โœ๏ธ **์„œ๋น„์Šค ์†Œ๊ฐœ**: [์„œ๋น„์Šค ์†Œ๊ฐœ ๋ฐ”๋กœ๊ฐ€๊ธฐ](https://linktr.ee/smeem)
- ๐Ÿ“ฑ **iOS ๋‹ค์šด๋กœ๋“œ**: [App Stroe ๋ฐ”๋กœ๊ฐ€๊ธฐ](https://apps.apple.com/kr/app/smeem-%EC%8A%A4%EB%B0%88-%EC%98%81%EC%9E%91-%EC%98%81%EC%96%B4%EC%9D%BC%EA%B8%B0-%EC%98%81%EC%96%B4%EB%85%B8%ED%8A%B8/id6450711685)
- ๐Ÿ“ฑ **Android ๋‹ค์šด๋กœ๋“œ**: [Play Store ๋ฐ”๋กœ๊ฐ€๊ธฐ](https://play.google.com/store/apps/details?id=com.sopt.smeem&hl=ko&gl=US)
## Architecture
### Server Architecture
<img alt="image" width="600" src="https://github.com/user-attachments/assets/fb290cc9-1f98-4536-b4cb-c7fb5b421580"/>

<br/>

## ๐Ÿง‘โ€๐Ÿ’ป ํŒ€์› ์†Œ๊ฐœ (Team)

| [๊น€์†Œํ˜„](https://github.com/thguss) | [์ตœ์œคํ•œ](https://github.com/unanchoi) |
|:---:|:---:|
|<img width="250" alt="image" src="https://avatars.githubusercontent.com/u/55437339?v=4" />|<img width="250" alt="image" src="https://github.com/Team-Smeme/Smeme-server-renewal/assets/55437339/e546c4ee-b991-4168-bd94-f97d296b095e" />|
| Server Lead Developer | Server Developer |
|- ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ ์„ค๊ณ„/๋ฆฌํŒฉํ† ๋ง<br/>- ์ผ๊ธฐ ๊ด€๋ จ ๊ธฐ๋Šฅ ๊ตฌํ˜„|ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ ์„ค๊ณ„/๋ฆฌํŒฉํ† ๋ง<br/> - ์ธ์ฆ, ํšŒ์› ๊ด€๋ จ ๊ธฐ๋Šฅ ๊ตฌํ˜„|
|[[์•„ํ‹ฐํด] FCM์œผ๋กœ ํ‘ธ์‹œ์•Œ๋ฆผ ๊ธฐ๋Šฅ ๊ตฌํ˜„ํ•˜๊ธฐ](https://soso-hyeon.tistory.com/87) <br/> [[์•„ํ‹ฐํด] ๋ฉ€ํ‹ฐ๋ชจ๋“ˆ ๊ตฌ์กฐ ์„ค๊ณ„ ๊ธฐ๋ก](https://soso-hyeon.tistory.com/83)|[[์•„ํ‹ฐํด] Presentation Layer <-> Application Layer DTO ๋ฆฌํŒฉํ† ๋ง](https://ntnb.tistory.com/35)|
### Hexagonal Architecture (based Multi-Module)
<img alt="image" width="600" src="https://github.com/user-attachments/assets/fc6d8bff-2cbc-499e-854a-4b5ef6c9a197"/>

<br/>
<br/><br/>

## โš’๏ธ ๊ธฐ์ˆ  ์Šคํƒ (Tech)
## Tech Stack
- Java, Spring Boot
- PostgreSQL, Spring Data JPA, QueryDSL
- AWS : EC2, RDS, Code Deploy, Nginx
- JUnit5
- Swagger
- Sentry, Discord WebHook
- Kakao/Apple Oauth, Discord WebHook, Firebase Messaging Service

<br/>

## ๐ŸŒณ ์ธํ”„๋ผ ์•„ํ‚คํ…์ฒ˜ (Infra Architecture)
## Server Developer

<img width="600" alt="image" src="https://github.com/Team-Smeme/Smeme-server-renewal/assets/81692211/ba9bcd6d-0c33-4790-90c1-443b3b410baa" />
|<img width="200" alt="image" src="https://avatars.githubusercontent.com/u/55437339?v=4" />|<img width="200" alt="image" src="https://github.com/Team-Smeme/Smeme-server-renewal/assets/55437339/e546c4ee-b991-4168-bd94-f97d296b095e" />|
|:--:|:--:|
|[๊น€์†Œํ˜„(thguss)](https://github.com/thguss)|[์ตœ์œคํ•œ(unanchoi)](https://github.com/unanchoi)|
|mvp ~ | mvp ~ sprint2|

<br/>

## ๐Ÿ—‚๏ธ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ (Project Architecture) : ๋ฉ€ํ‹ฐ๋ชจ๋“ˆ ๊ตฌ์กฐ (Multi-Module)
Smeem ํ”„๋กœ์ ํŠธ๋Š” ๋‹จ์ผ ๋ชจ๋“ˆ ๊ตฌ์กฐ์—์„œ ์‹œ์ž‘ํ•˜์—ฌ, ์ฝ”๋“œ ๊ฐ„์˜ ์˜์กด๋„์™€ ๊ฒฐํ•ฉ๋„๋ฅผ ์ค„์—ฌ๋ณด๊ณ ์ž ๋ฉ€ํ‹ฐ๋ชจ๋“ˆ ๊ตฌ์กฐ์˜ ํ”„๋กœ์ ํŠธ๋กœ ๋ฆฌํŒฉํ† ๋ง์„ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.

<img width="600" alt="image" src="https://github.com/Team-Smeme/Smeme-server-renewal/assets/55437339/367330ae-bb98-4f09-9caa-6a63353e4a64" />

### smeem-api
- ํด๋ผ์ด์–ธํŠธ์™€ ๊ฐ€์žฅ ์ง์ ‘์ ์œผ๋กœ ์†Œํ†ตํ•˜๋Š” ๊ณ„์ธต์œผ๋กœ, API์™€ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์„ ๋ชจ์•„๋‘” ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค.
- Controller, Service ํŒŒ์ผ์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

### smeem-batch
- batch ์ž‘์—…์„ ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ๋ชจ์•„๋‘” ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค.
- scheduler ํŒŒ์ผ์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

### smeem-common
- ํ”„๋กœ์ ํŠธ ์ „๋ฐ˜์— ๊ณตํ†ต์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๊ฐ์ฒด๋ฅผ ๋ชจ์•„๋‘” ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค.
- ๋ฉ€ํ‹ฐ ๋ชจ๋“ˆ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ์˜ ์˜๋ฏธ๋ฅผ ๊ทน๋Œ€ํ™”ํ•˜๊ธฐ ์œ„ํ•ด ์ตœ์†Œํ•œ์˜ ์ฝ”๋“œ๋งŒ ํฌํ•จํ–ˆ์Šต๋‹ˆ๋‹ค.

### smeem-domain
- Domain(Model)๊ณผ Database๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ธฐ๋Šฅ์˜ ์ฝ”๋“œ๋ฅผ ๋ชจ์•„๋‘” ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค.
- Entity, Repository ํŒŒ์ผ์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

### smeem-external
- Database๋ฅผ ์ œ์™ธํ•œ ์™ธ๋ถ€ ์„œ๋น„์Šค๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ธฐ๋Šฅ์„ ํ•˜๋Š” ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค.
- ์†Œ์…œ๋กœ๊ทธ์ธ(์นด์นด์˜ค, ์• ํ”Œ), FCM, Discord Webhook์˜ ์™ธ๋ถ€ API๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.
### Article
- by @unanchoi
- [Presentation Layer <-> Application Layer DTO ๋ฆฌํŒฉํ† ๋ง](https://ntnb.tistory.com/35)

- by @thguss
- [FCM์œผ๋กœ ํ‘ธ์‹œ์•Œ๋ฆผ ๊ธฐ๋Šฅ ๊ตฌํ˜„ํ•˜๊ธฐ](https://soso-hyeon.tistory.com/87)
- [๋ฉ€ํ‹ฐ๋ชจ๋“ˆ ๊ตฌ์กฐ ์„ค๊ณ„ ๊ธฐ๋ก](https://soso-hyeon.tistory.com/83)
- [CI/CD ํŒŒ์ดํ”„๋ผ์ธ ๊ตฌ์ถ•ํ•˜๊ธฐ](https://soso-hyeon.tistory.com/119)

<br/>

## ๐Ÿ“Œ ์ฝ”๋“œ ์ปจ๋ฒค์…˜ (Code Convention)
## Convention

### Code
- ํ•˜๋‚˜์˜ ๋ฉ”์„œ๋“œ(method) ๊ธธ์ด 12์ค„, ๊นŠ์ด(depth) 3 ์ด๋‚ด๋กœ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.
- Lombok์˜ val์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

### Entity
- id ์ž๋™ ์ƒ์„ฑ ์ „๋žต์€ IDENTITY๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
- @NoArgsConstructor ์‚ฌ์šฉ ์‹œ access๋ฅผ PROTECTED๋กœ ์ œํ•œํ•ฉ๋‹ˆ๋‹ค.

### Enum
- Enum ๊ฐ’์€ import static ํ˜ธ์ถœ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

### DTO
- Controller์—์„œ ์š”์ฒญ/์‘๋‹ตํ•˜๋Š” DTO์™€ Service์—์„œ ์‚ฌ์šฉํ•˜๋Š” DTO๋ฅผ ๋ถ„๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
- Layered Architecture๋ฅผ ์—„๊ฒฉํ•˜๊ฒŒ ์ค€์ˆ˜ํ•ฉ๋‹ˆ๋‹ค.
- ํ™•์žฅ/๋ฒˆ๊ฒฝ์— ์šฉ์ดํ•˜๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.
- ๋„ค์ด๋ฐ์€ ์•„๋ž˜์™€ ๊ฐ™์ด ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
- Controller DTO: `${Entity๋ช…}${๋ณต์ˆ˜ํ˜•์ผ ๊ฒฝ์šฐ List ์ถ”๊ฐ€}${ํ–‰์œ„ ๋˜๋Š” ์ƒํƒœ}${Request/Response}`
- Service DTO: `${Entity๋ช…}${๋ณต์ˆ˜ํ˜•์ผ ๊ฒฝ์šฐ List ์ถ”๊ฐ€}${ํ–‰์œ„ ๋˜๋Š” ์ƒํƒœ}Service${Request/Response}`

### Response
- ์š”์ฒญ ์„ฑ๊ณต ์‹œ, BaseResponse<T>์™€ SuccessCode(์ธํ„ฐํŽ˜์ด์Šค)์˜ ๊ตฌํ˜„์ฒด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
- ์˜ˆ์™ธ ๋ฐœ์ƒ ์‹œ, Exception๊ณผ FailureCode(์ธํ„ฐํŽ˜์ด์Šค)์˜ ๊ตฌํ˜„์ฒด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

### Service, Repository
- DB๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ฒฝ์šฐ ๋ฉ”์„œ๋“œ๋ช…์— save, find, update, delete ์šฉ์–ด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
- ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์ผ ๊ฒฝ์šฐ ๋ฉ”์„œ๋“œ๋ช…์— create, get, update, delete, ๊ทธ ์™ธ ์šฉ์–ด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
- ๋ณต์ˆ˜ํ˜•์€ ${Entity๋ช…}s๋กœ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค.
- Service ํŒŒ์ผ์ด ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง 5๊ฐœ ์ด์ƒ์œผ๋กœ ์ปค์ง€๋ฉด ์กฐํšŒ, ๋น„์กฐํšŒ(Transactional)๋กœ ํด๋ž˜์Šค๋ฅผ ๋ถ„๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

<br/>

## ๐Ÿ“Œ ์ปค๋ฐ‹ ์ปจ๋ฒค์…˜ (Commit Convention)

> **[ํƒœ๊ทธ] ์ œ๋ชฉ์˜ ํ˜•ํƒœ**
### Commit

| ํƒœ๊ทธ ์ด๋ฆ„ | ์„ค๋ช… |
| --- | --- |
Expand All @@ -115,7 +71,7 @@ Smeem ํ”„๋กœ์ ํŠธ๋Š” ๋‹จ์ผ ๋ชจ๋“ˆ ๊ตฌ์กฐ์—์„œ ์‹œ์ž‘ํ•˜์—ฌ, ์ฝ”๋“œ ๊ฐ„์˜ ์˜

<br/>

## ๐ŸŽ‹ ๋ธŒ๋žœ์น˜ ์ „๋žต (Branch Strategy)
### Branch

<img width="500" alt="image" src="https://github.com/Team-Smeme/Smeme-server-renewal/assets/55437339/1699ec13-babc-48f7-a914-d5f1fc1d51dd" />

Expand Down
Loading