/social-media-integration-feed-project

소셜미디어 통합 서비스(로그인, 조회, 통계)

Primary LanguageJava

logo

소셜 미디어 통합 Feed 서비스 MOA

Table of Contents

개요

소셜 미디어 Feed 여기 다 MOA! 본 서비스는 유저 계정의 해시태그(”#dani”) 를 기반으로 인스타그램, 스레드, 페이스북, 트위터 등 복수의 SNS에 게시된 게시물 중 유저의 해시태그가 포함된 게시물들을 하나의 서비스에서 확인할 수 있는 통합 Feed 어플리케이션 입니다.

Skils

언어 및 프레임워크: Static Badge Static Badge
데이터베이스 및 테스트: Static Badge Static Badge
배포 : Static Badge
ETC: Static Badge

Installation

Install MOA project with gradle

./gradlew bootjar
./gradlew bootrun

Running Tests

To run tests, run the following command

  ./gradlew test

Static Badge
coverage

API Reference

User

회원가입 - click

Request

  GET /users/sign-up
Content-Type: application/json

{
  "username":"test1234",
  "email":"yoojinlee.dev@gmail.com",
  "password":"1q2w3e4r!",
  "hashtag":"test"
}

Response

HTTP/1.1 201
Content-Type: application/json

{
  "id": 1,
  "username": "test1234",
  "email": "yoojinlee.dev@gmail.com",
  "hashtag": "test"
}
로그인 - click

Request

  GET /users/sign-in
Content-Type: application/json

{
    "username": "tester1234",
    "password": "1q2w3e4r!",
}

Response

    HTTP/1.1 200
    Content-Type: application/json

{
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0MTIzNCIsImV4cCI6MTY5ODc3MjE5OSwiaWF0IjoxNjk4Njg1Nzk5LCJlbWFpbCI6Inlvb2ppbmxlZS5kZXZAZ21haWwuY29tIiwidXNlcklkIjoxLCJhdXRoIjoiUk9MRV9NRU1CRVIifQ.EFjPkcgIjepNwh0qel9H9ZQMbcJ2dZ-fBl9sRuUG5tU"
}
유저 회원가입 승인 - click

Request

  GET /users/{id}/approval
Path Type Description
id Long Required. User's ID

Response

    HTTP/1.1 204
    Content-Type: application/json

Post

게시물 불러오기 - click

Request

  GET /posts
Parameter Type Description
hashtag String
page int
page_count int
createdAt String
desc String

Response

    HTTP/1.1 200
    Content-Type: application/json
    
    {
    "content": [
        {
            "id": 1,
            "contentId": "fb1",
            "type": "FACEBOOK",
            "title": "페북 피드_1",
            "content": "good #dev #java",
            "viewCount": 2,
            "likeCount": 0,
            "shareCount": 3,
            "createdAt": "2023-10-31T02:00:30.682465",
            "updatedAt": "2023-10-31T02:00:30.682465"
        },
        //...
    ],
    "pageable": {
        "pageNumber": 0,
        "pageSize": 5,
        "sort": {
            "empty": false,
            "sorted": true,
            "unsorted": false
        },
        "offset": 0,
        "unpaged": false,
        "paged": true
    },
    "last": false,
    "totalElements": 20,
    "totalPages": 4,
    "size": 5,
    "number": 0,
    "sort": {
        "empty": false,
        "sorted": true,
        "unsorted": false
    },
    "first": true,
    "numberOfElements": 5,
    "empty": false
}
게시물 상세 - click

Request

  GET /posts/{postId}
Path Type Description
id Long Required. User's ID

Response

HTTP/1.1 200
Content-Type: application/json

{
  "id": 0,
  "contentId": "string",
  "type": "FACEBOOK",
  "title": "string",
  "content": "string",
  "viewCount": 0,
  "likeCount": 0,
  "shareCount": 0,
  "createdAt": "2023-11-02T03:02:34.687Z",
  "updatedAt": "2023-11-02T03:02:34.687Z"
}
게시물 좋아요 - click

Request

  GET /posts/{postId}/likes
Path Type Description
id Long Required. User's ID

Response

    HTTP/1.1 200
    Content-Type: application/json
게시물 공유 - click

Request

  GET /posts/{postId}/shares
Path Type Description
id Long Required. User's ID

Response

    HTTP/1.1 200
    Content-Type: application/json

Hashtag

Hot Hashtag 찾기 - click

Request

  GET /hashtags/hot

Response

    HTTP/1.1 200
    Content-Type: application/json

    {
        "hashtagName": "#test",
        "count": 15
    }

Statisitcs

통계 - click

Request

  GET /statistics
Parameter Type Description
hashtag String
type String Required.date, hour
start date 2023-10-01 과 같이 데이트 형식이며 조회 기준 시작일을 의미합니다.
end date 2023-10-25 과 같이 데이트 형식이며 조회 기준 시작일을 의미합니다.
value String count, view_count, like_count, share_count

Response

    HTTP/1.1 200
    Content-Type: application/json

    {
        "time": "#test",
        "count": 15
    }

프로젝트 진행 및 이슈 관리

Notion
img.png

ERD

coverage

  • 유저는 ID(#HashtagId)를 가지고 있고 자신의 ID와 연관된 SNS 게시글을 조회할 수 있습니다
  • 게시글과 해시태그는 N:M의 관계를 가지고 있습니다.

구현과정(설계 및 의도)

JWT 유저인증 - click - JWT를 활용한 유저 인증을 구현했습니다.
- SMTP를 활용해 유저의 이메일에 유저의 인증키를 전송하는 기능을 구현했습니다.
게시물 확인 - click - 게시물 확인 및 상세, 좋아요, 공유 기능을 구현했습니다.
통계 - click - 유저, 또는 브랜드 해시태그의 통계를 확인할 수 있습니다.
HOT Hashtag - click - 최근 3시간 이내에 게시물에서 가장 많이 사용된 해시태그를 조회할 수 있습니다.
RESTful API 설계 - click - Open API를 활용한 Self-descriptive Message 충족
- "/swagger-ui"에서 해당 내용 확인 가능

이슈관리

TIL 및 회고

Authors

이유진 윤준영 김가영 김성은
@U-jinLee @upqnu @gabang2 @chickencoc