ToyProject - Togerun

조대훈·2024년 5월 15일
post-thumbnail

Togerun

1. 프로젝트 개요

  • Tomato : [게시판 기반 채팅 웹 앱 서비스]
  • 프로젝트 기간 : 2024.06.11~
  • 프로젝트 인원 : 1명.
  • 개발언어 : JAVA 17, React.
  • 개발 환경 :
    - 백엔드: SpringBoot, SpringSecurity, Oauth2.0, JPA, Redis, nginX, gradle.
    - 프론트엔드: react, tail-wind, react-query,recoil.
  • 데이터 베이스: MariaDB.
  • 관리 툴: github.
  • 배포: githubactions, Docker, EC2, RDS, S3, Vercel.
  • 간단 소개: 게시판 기반의 운동 모임 매칭 웹 앱 서비스.

1-2아키텍처

1-3 화면 흐름

2. 기능 설계

  • 2.1. 유저 기능
    • 소셜 로그인 : Google, Kakao, Naver 를 이용해 로그인.
    • 마이페이지,정보 수정 : 닉네임, 성별, 연령대, 연락처 수정.
  • 2.2. 게시판 기능
    • 글 작성
      • 제목, 내용, 집결 시간, 활동 유형, 모집 정원, 집결 장소, 이미지를 첨부하여 작성.
      • 카카오맵 API 를 이용하여 집결 장소 태그.
    • 글 조회
      • 제목, 내용, 이미지, 작성자, 작성일, 좋아요, 댓글, 활동 유형, 마감 유무, 주소확인.
      • 로그인한 유저만 댓글 추가 가능.
    • 글 수정
      • 제목, 내용, 이미지 수정 가능.
      • 해당 글의 작성자, 관리자만 삭제 가능.
    • 글 삭제
      • 작성자, 관리자만 삭제 가능.
      • 해당 글의 댓글, 좋아요 모두 삭제.
    • 댓글 기능
      • 로그인한 유저만 댓글 작성 가능.
      • 작성자와 관리자, 해당 댓글 작성자만 댓글 수정, 삭제 가능.
      • 무한 대댓글.
    • 즐겨찾기
      • CRUD.
      • 즐겨찾기 탭에서 별도로 확인 가능.
      • 좋아요
      • CURD.
  • 2.3.등급기능
    • BRONZE, SILVER, ADMIN, SYSTEM
      • 최초 가입시 BRONZE 등급 설정
        • 서비스 이용 불가.
        • 메뉴 클릭시 회원 정보 수정 페이지로 redriect 처리
      • 추가 정보 기입시 SIVLER 등급 상승
        • 서비스 이용 가능.
      • 관리자 계정
        • 모든 글, 댓글 수정 삭제.
          • 회원 탈퇴 처리.
  • 2.4 채팅 기능
    • 로그인한 유저만 채팅 가능.
    • 게시물에서 설정한 정원만큼 입장 가능.
    • 사이드바에서 참여한 채팅방 일괄 확인.
    • WebStomp와 Redis 를 활용한 실시간 메시지 전송 가능.
  • 2.5 알림 기능
    • SSE를 활용한 실시간 알림 기능.
    • 채팅 메세지, 댓글, 좋아요 알람 기능.
  • 2.6 관리자 기능
    • 유저삭제, 댓글, 글 삭제

API 기능 명세

엔드포인트메소드설명요청 파라미터응답필요 권한
/api/member/refreshPOST토큰 갱신Header: AuthorizationMap\<String, Object> (accessToken, refreshToken)없음
/api/user/check/{nickname}GET닉네임 중복 확인PathVariable: nickname(String)Map\<String, Boolean> (available)없음
/api/user/infoGET사용자 정보 조회-UserDTO인증
/api/user/modifyPUT사용자 정보 수정UserModifyDTOMap\<String, Object>인증
/api/user/joinedGET참여 채팅방 조회-List\인증
/api/user/favoritesGET즐겨찾기 목록 조회-List\인증
/api/notifications/subscribeGETSSE 알림 구독Header: Last-Event-IDSseEmitter인증
/api/notifications/allGET전체 알림 조회RequestParam: page(int), size(int)NotifyDto.PageResponse인증
/api/notifications/{notificationId}/readPOST알림 읽음 처리PathVariable: notificationId(Long)void인증
/api/notifications/unread/countGET읽지 않은 알림 수 조회-Long인증
/api/notifications/clearPOST전체 알림 읽음 처리-void인증
/api/commentPOST댓글 생성CommentRequestDtoCommentResponseDto인증
/api/commentPUT댓글 수정CommentRequestDtoCommentResponseDto인증
/api/comment/{postId}GET게시물의 댓글 조회PathVariable: postId(Long)List\인증
/api/comment/{commentId}DELETE댓글 삭제PathVariable: commentId(Long)Long인증
/chat/{postId}/sendMESSAGE채팅 메시지 전송DestinationVariable: postId(Long), Payload: ChatMessageDTOChatMessageDTO인증
/api/post/{postId}/chat/joinPOST채팅방 입장PathVariable: postId(Long)ChatRoomDTO인증
/api/post/{postId}/chat/leavePOST채팅방 퇴장PathVariable: postId(Long)String(성공 메시지)인증
/api/post/{postId}/chatGET채팅 메시지 조회PathVariable: postId(Long)List\인증
/api/post/{postId}/chat/statusGET채팅방 상태 조회PathVariable: postId(Long)ChatRoomDTO인증
/api/postGET전체 게시물 조회-List\SILVER
/api/postPOST게시물 생성MultipartFile: uploadFiles(선택), PostDTOMap\<String, Long> (id)SILVER
/api/post/{id}GET특정 게시물 조회PathVariable: id(Long)PostSILVER
/api/post/listGET게시물 페이징 조회PageRequestDTOPageResponseDTO\SILVER
/api/post/{id}PUT게시물 수정PathVariable: id(Long), MultipartFile: uploadFiles(선택), PostDTOMap\<String, String>SILVER
/api/post/{id}DELETE게시물 삭제PathVariable: id(Long)Map\<String, Object>SILVER
/api/post/{id}/favoritePOST게시물 즐겨찾기 토글PathVariable: id(Long)FavoriteDTOSILVER
/api/post/{id}/likePOST게시물 좋아요 토글PathVariable: id(Long)LikeDTOSILVER
/api/admin/usersGET전체 사용자 조회-List\ADMIN
/api/admin/users/{userId}/deletePUT사용자 소프트 삭제PathVariable: userId(Long)voidADMIN
/api/admin/users/{userId}/restorePUT삭제된 사용자 복구PathVariable: userId(Long)UserDTOADMIN

DB설계

user 테이블

컬럼명데이터타입조건설명
idbigint(20)PK사용자 식별자
is_deletedbit(1)삭제 여부
socialbit(1)소셜 로그인 여부
deleted_atdatetime(6)삭제 일시
agevarchar(255)나이
emailvarchar(255)이메일
gendervarchar(255)성별
imgvarchar(255)프로필 이미지
mobilevarchar(255)휴대폰 번호
namevarchar(255)이름
nicknamevarchar(255)닉네임
passwordvarchar(255)비밀번호

post 테이블

컬럼명데이터타입조건설명
idbigint(20)PK게시글 식별자
capacityint(11)참여 가능 인원
del_flagbit(1)삭제 플래그
latitudedouble위도
longitudedouble경도
local_datedate로컬 날짜
participate_flagtinyint(1)참여 플래그
chat_room_idbigint(20)FK채팅방 ID
meeting_timedatetime(6)미팅 시간
user_idbigint(20)FK작성자 ID
view_countbigint(20)조회수
titlevarchar(100)제목
contentvarchar(255)내용
place_namevarchar(255)장소명
road_namevarchar(255)도로명
activity_typeenum활동 유형(climbing, cycling, hiking, pilates, running, surfing, weight_training, yoga)

chat_rooms 테이블

컬럼명데이터타입조건설명
idbigint(20)PK채팅방 식별자
activity_typetinyint(4)활동 유형
can_joinbit(1)참여 가능 여부
participantbit(1)참여자 여부
participant_countint(11)참여자 수

chat_messages 테이블

컬럼명데이터타입조건설명
idbigint(20)PK메시지 식별자
chat_room_idbigint(20)FK채팅방 ID
created_atdatetime(6)생성 일시
user_idbigint(20)FK작성자 ID
contentvarchar(500)메시지 내용
chat_message_typeenum메시지 타입(normal, system)

comment 테이블

컬럼명데이터타입조건설명
comment_idbigint(20)PK댓글 식별자
del_flagbit(1)삭제 플래그
created_atdatetime(6)생성 일시
parent_idbigint(20)FK부모 댓글 ID
post_idbigint(20)FK게시글 ID
created_byvarchar(255)작성자
imgvarchar(255)이미지
nick_namevarchar(255)닉네임
contenttinytext댓글 내용

notify 테이블

컬럼명데이터타입조건설명
notification_idbigint(20)PK알림 식별자
is_readbit(1)읽음 여부
created_atdatetime(6)생성 일시
post_idbigint(20)FK게시글 ID
user_idbigint(20)FK사용자 ID
contentvarchar(255)알림 내용
urlvarchar(255)알림 URL
notification_typeenum알림 타입(chat, comment, like, system)

post_like 테이블

컬럼명데이터타입조건설명
idbigint(20)PK좋아요 식별자
is_activebit(1)활성화 여부
created_atdatetime(6)생성 일시
post_idbigint(20)FK게시글 ID
user_idbigint(20)FK사용자 ID

post_favorite 테이블

컬럼명데이터타입조건설명
idbigint(20)PK즐겨찾기 식별자
is_activebit(1)활성화 여부
created_atdatetime(6)생성 일시
post_idbigint(20)FK게시글 ID
user_idbigint(20)FK사용자 ID

post_images 테이블

컬럼명데이터타입조건설명
post_idbigint(20)PK, FK게시글 ID
file_namevarchar(255)파일명
ordint(11)정렬 순서

user_user_role_list 테이블

컬럼명데이터타입조건설명
user_idbigint(20)PK, FK사용자 ID
user_role_listenum사용자 권한(role_admin, role_bronze, role_silver, role_system)

chat_room_participants 테이블

컬럼명데이터타입조건설명
chat_room_idbigint(20)PK, FK채팅방 ID
user_idbigint(20)PK, FK사용자 ID
profile
백엔드 개발자를 꿈꾸고 있습니다.

0개의 댓글