gamenome-project / gamenome-project-server

gamenome-project-server
0 stars 1 forks source link

gamenome-project-server

소개

목차

1. 사전 작업

2. 기능 설명

2-1. Review

2-2. Comment

2-3. User

2-4. reaction, star

2-5. report

2-6. report

2-7. 기타 추가 기능

2-8. 버그 및 이슈 사항

3. 환경 변수

1-사전-작업

1-1. 이벤트 스토밍

이벤트 스토밍 보기

1-2. 와이어 프레임

와이어 프레임 보기

1-3. API 명세서

API 명세서 보기

1-4. ERD

erDiagram
    review }|--|| app_user : user_id
    review ||--o| star : review_id
    review ||--o{ comment : review_id
    comment ||--o| star : comment_id
    comment ||--|{ app_user : user_id
    comment ||--|{ reaction : comment_id
    app_user ||--o{ follow : user_id
    app_user ||--o{ report : user_id
    app_user ||--o| star : user_id
    app_user ||--o| reaction : user_id

    review{
         id BIGINT PK
         game_name TEXT
         title TEXT
         description TEXT
         is_deleted BOOLEAN
         created_at TIMESTAMP
         updated_at TIMESTAMP
         deleted_at TIMESTAMP 
    }

    comment{
         id BIGINT PK
         user_id BIGINT FK
         review_id BIGINT FK
         content TEXT
         is_deleted BOOLEAN
         created_at TIMESTAMP
         updated_at TIMESTAMP
         deleted_at TIMESTAMP 
    }

     app_user{
         id BIGINT PK
         email VARCHAR(255)
         password VARCHAR(255)
         nickname VARCHAR(255)
         about_summary VARCHAR(255)
         profile_user_image TEXT
         created_at TIMESTAMP
         updated_at TIMESTAMP
         last_signin_at TIMESTAMP 
    }

    report{
         id BIGINT PK
         user_id BIGINT FK
         entity_id BIGINT 
         entity_type ENUM
         description TEXT
         created_at TIMESTAMP
    }

    star{
         user_id BIGINT FK
         review_id BIGINT FK
         comment_id BIGINT FK
         score FLOAT
    }

    follow{
         user_id BIGINT FK
         following_user_id BIGINT
    }

    reaction{
         user_id BIGINT FK
         comment_id BIGINT FK
         reaction ENUM
    }

자세한 ERD 상세 정보 보기

1-5. gamenome-project-conventions

1-6. 역할 분담

전체

노재원

기능 설명

패키지 구조

1-Review

classDiagram

    ReviewDto <--> ReviewController
    ReviewServiceImpl <.. ReviewService
    ReviewServiceImpl <--> ReviewDto
    ReviewRepository <-- ReviewServiceImpl
    ReviewRepository ..> ReviewRepositoryImpl
    ReviewServiceImpl <-- ReviewRepositoryImpl
    ReviewJpaRepository <--> ReviewRepository

2-Comment

classDiagram

    CommentDto <--> CommentController
    CommentService <--> CommentDto
    CommentRepository <-- CommentService
    CommentRepository ..> CommentRepositoryImpl
    CommentService <-- CommentRepositoryImpl
    CommentJpaRepository <--> CommentRepository

3-User

classDiagram

    UserDto <--> UserController
    UserServiceImpl <.. UserService
    UserServiceImpl <--> UserDto
    UserRepository <-- UserServiceImpl
    UserRepository ..> UserRepositoryImpl
    UserServiceImpl <-- UserRepositoryImpl
    UserJpaRepository <--> UserRepository

4-reaction_star

classDiagram
    ReactionDto <--> commentController
    ReactionService <--> ReactionDto
    ReactionRepository <-- ReactionService
    ReactionRepository ..> ReactionRepositoryImpl
    ReactionService <-- ReactionRepositoryImpl
    ReactionJpaRepository <--> ReactionRepository

    StarScoreDto <--> commentController
    StarScoreService <--> StarScoreDto
    StarScoreRepository <--> StarScoreService
    StarScoreJpaRepository <--> StarScoreRepository

5-report

classDiagram
    ReportDto <--> commentController
    ReportDto <--> ReviewController
    ReportService <--> ReportDto
    ReportRepository <-- ReportService
    ReportRepository ..> ReportRepositoryImpl
    ReportService <-- ReportRepositoryImpl
    ReportJpaRepository <--> ReportRepository

6-follow

classDiagram
    FollowDto <--> FollowController
    FollowServiceImpl <.. FollowService
    FollowServiceImpl <--> FollowDto
    FollowRepository <-- FollowServiceImpl
    FollowRepository ..> FollowRepositoryImpl
    FollowServiceImpl <-- FollowRepositoryImpl
    FollowJpaRepository <--> FollowRepository

7-기타-추가-기능

HTTP -> HTTPS 업데이트

KAKAO OAuth 인증

JWT 토큰 인증

이메일 인증

8-버그-및-이슈-사항

1. FATAL: Max client connections reached 애러 발생

AS-IS

2. JWT Token userId 캐스팅 실패

AS-IS

return jwtPlugin.validateToken(token).getOrNull()?.payload?.get("userId") as? Long ?: throw RuntimeException("User id is invalid")

TO-BE

return (jwtPlugin.validateToken(token).getOrNull()?.payload?.get("userId") as Int).toLong()

3. StarScore 복합키 데이터 베이스 생성시에 null one-to-one property 발생 현상

1. Comment -> EntityNotFoundException unable to find with id 0 애러 발생

AS-IS

TO-BE

2. user -> duplicated primary key 애러 발생

AS-IS

TO-BE

3. comment -> attempted to assign id from null one-to-one property 애러 발생

AS-IS

3-환경-변수

개발 언어 : Kotlin 1.9.23, JDK 21

IDE : IntelliJ IDEA 2024.2

Build tool : Gradle.kts

FrameWork : Spring Boot 3.3.0

Library : Springdoc 2.5.0

DataBase : PostgresQL 14.1 with Supabase

JWT : jjwt 0.12.5