Skip to content

FortuneBara/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

113 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

์•ฑ ์ด๋ฆ„

์˜ค๋Š˜์˜ ์šด์„ธ๋ฐ”๋ผ (FortuneBara)


์•ฑ ์„ค๋ช…

โ€œ์˜ค๋Š˜์˜ ์šด์„ธ๋ฐ”๋ผโ€ ์„œ๋น„์Šค๋Š” ๊ท€์—ฝ๊ณ  ์นœํ™”๋ ฅ ์ข‹์€ ์นดํ”ผ๋ฐ”๋ผ ๋™์ž๊ฐ€ ๋งค์ผ๋งค์ผ ๋‹น์‹ ์˜ ์šด์„ธ๋ฅผ ์ ์ณ์ฃผ๋Š” ์˜จ๋ผ์ธ ํƒ€๋กœ ์šด์„ธ ํ”Œ๋žซํผ์ž…๋‹ˆ๋‹ค. ๋‹จ์ˆœํ•œ ์žฌ๋ฏธ๋ฅผ ๋„˜์–ด, ์ •๊ตํ•œ ํƒ€๋กœ ๋ถ„์„์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ณด๋‹ค ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” ์šด์„ธ ํ•ด์„๊ณผ ์‹ฌ์ธต์ ์ธ ์ƒ๋‹ด ๊ฒฝํ—˜์„ ์ œ๊ณตํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.


์ฃผ์š” ํŠน์ง•

์นดํ”ผ๋ฐ”๋ผ ๋™์ž์˜ ํ†ต์ฐฐ๋ ฅ์œผ๋กœ ๋‹น์‹ ์˜ ํ•˜๋ฃจ ์šด์„ธ์™€ ํ–‰์šด์„ ํฌ์ฐฉํ•ด๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๊ฐ„๋‹จํžˆ ์ด๋ฆ„, ์ƒ๋…„์›”์ผ๋งŒ ์ž…๋ ฅํ•˜๋ฉด, ๊ท€์—ฝ๊ณ ๋„ ์ •ํ™•ํ•œ ์šด์„ธ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›์•„๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.


๋ฒ„์ „ ์ •๋ณด

  • JDK: 17
  • Spring Boot: 3.4.1
  • Spring Boot ๊ด€๋ จ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „:
    • Spring Security 6.4.2
    • Spring Web 6.2.1
    • Spring Data JPA 3.4.1
  • Database ๊ด€๋ จ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „:
    • Jakarta Persistence 3.1.0
    • MySQL Connector 9.1.0
    • H2 Database: 2.3.232
  • Jackson ๊ด€๋ จ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „:
    • Jackson Core: 2.18.2
    • Jackson Datatype Hibernate5: 2.18.2
  • ํ…Œ์ŠคํŠธ ๊ด€๋ จ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „:
    • JUnit Jupiter: 5.11.4
    • Mockito Core: 5.14.2

์‚ฌ์šฉ๋œ Third-Party ๋ฐ ๊ธฐ์ˆ  ์Šคํƒ

  • Spring Data JPA
  • Spring Security
  • Google OAuth2
  • MySQL
  • Redis
  • Docker
  • AWS EC2
  • GitHub Actions

API ์ •์˜์„œ์™€ ์ƒํƒœ ์ฝ”๋“œ

๐Ÿ“Œ User API ๋ฌธ์„œ

[POST] ํšŒ์›๊ฐ€์ž…

  • Endpoint: /user/sign-up
  • Request Body:
    {
      "userId": 123,
      "name": "ํ™๊ธธ๋™",
      "email": "test@example.com",
      "nickname": "testuser",
      "birth": "1995-07-30",
      "provider": "google",
      "providerUid": "google-12345",
      "accessToken": "access-token-example",
      "refreshToken": "refresh-token-example"
    }
  • Response:
    {
      "userId": 123,
      "name": "ํ™๊ธธ๋™",
      "email": "test@example.com",
      "nickname": "testuser",
      "birth": "1995-07-30",
      "provider": "google",
      "providerUid": "google-12345",
      "accessToken": "access-token-example",
      "refreshToken": "refresh-token-example",
      "isRegistered": true,
      "createdAt": "2025-01-28 12:00:00",
      "updatedAt": "2025-01-28 12:00:00",
      "createdBy": 101,
      "updatedBy": 101
    }
  • Status Codes:
    • 201 Created : ํšŒ์›๊ฐ€์ž… ์„ฑ๊ณต
    • 400 Bad Request : ์š”์ฒญ ๋ฐ์ดํ„ฐ ์˜ค๋ฅ˜

** [GET] ํŠน์ • ์‚ฌ์šฉ์ž ์ •๋ณด ์กฐํšŒ**

  • Endpoint: /user/{userId}
  • Path Parameter:
    • userId (Long) : ์กฐํšŒํ•  ์‚ฌ์šฉ์ž ID
  • Response:
    {
      "userId": 123,
      "name": "ํ™๊ธธ๋™",
      "email": "test@example.com",
      "nickname": "testuser",
      "birth": "1995-07-30",
      "provider": "google",
      "providerUid": "google-12345",
      "accessToken": "access-token-example",
      "refreshToken": "refresh-token-example",
      "isRegistered": true,
      "createdAt": "2025-01-28 12:00:00",
      "updatedAt": "2025-01-28 12:00:00",
      "createdBy": 101,
      "updatedBy": 101
    }
  • Status Codes:
    • 200 OK : ์กฐํšŒ ์„ฑ๊ณต
    • 404 Not Found : ํ•ด๋‹น ์‚ฌ์šฉ์ž๊ฐ€ ์—†์Œ

** [PUT] ์‚ฌ์šฉ์ž ์ •๋ณด ์ˆ˜์ •**

  • Endpoint: /user/{userId}
  • Path Parameter:
    • userId (Long) : ์ˆ˜์ •ํ•  ์‚ฌ์šฉ์ž ID
  • Request Body:
    {
      "name": "๊น€์ฒ ์ˆ˜",
      "nickname": "newnickname",
      "birth": "2000-01-01"
    }
  • Response:
    {
      "userId": 123,
      "name": "๊น€์ฒ ์ˆ˜",
      "email": "test@example.com",
      "nickname": "newnickname",
      "birth": "2000-01-01",
      "provider": "google",
      "providerUid": "google-12345",
      "accessToken": "access-token-example",
      "refreshToken": "refresh-token-example",
      "isRegistered": true,
      "createdAt": "2025-01-28 12:00:00",
      "updatedAt": "2025-01-28 13:00:00",
      "createdBy": 101,
      "updatedBy": 103
    }
  • Status Codes:
    • 200 OK : ์ˆ˜์ • ์„ฑ๊ณต
    • 400 Bad Request : ์š”์ฒญ ๋ฐ์ดํ„ฐ ์˜ค๋ฅ˜
    • 404 Not Found : ํ•ด๋‹น ์‚ฌ์šฉ์ž๊ฐ€ ์—†์Œ

** [DELETE] ์‚ฌ์šฉ์ž ์‚ญ์ œ**

  • Endpoint: /user/{userId}
  • Path Parameter:
    • userId (Long) : ์‚ญ์ œํ•  ์‚ฌ์šฉ์ž ID
  • Response:
    • Status Code: 204 No Content (์‚ญ์ œ ์„ฑ๊ณต)
    • Status Code: 404 Not Found (ํ•ด๋‹น ์‚ฌ์šฉ์ž๊ฐ€ ์—†์Œ)

** [GET] ๋ชจ๋“  ์‚ฌ์šฉ์ž ์กฐํšŒ**

  • Endpoint: /user
  • Response:
    [
      {
        "userId": 123,
        "name": "ํ™๊ธธ๋™",
        "email": "test@example.com",
        "nickname": "testuser",
        "birth": "1995-07-30",
        "provider": "google",
        "providerUid": "google-12345",
        "accessToken": "access-token-example",
        "refreshToken": "refresh-token-example",
        "isRegistered": true,
        "createdAt": "2025-01-28 12:00:00",
        "updatedAt": "2025-01-28 12:00:00",
        "createdBy": 101,
        "updatedBy": 101
      },
      {
        "userId": 456,
        "name": "์ด์˜ํฌ",
        "email": "another@example.com",
        "nickname": "anotheruser",
        "birth": "2000-12-15",
        "provider": "kakao",
        "providerUid": "kakao-67890",
        "accessToken": "access-token-example-2",
        "refreshToken": "refresh-token-example-2",
        "isRegistered": false,
        "createdAt": "2025-01-28 12:30:00",
        "updatedAt": "2025-01-28 12:45:00",
        "createdBy": 102,
        "updatedBy": 103
      }
    ]
  • Status Codes:
    • 200 OK : ์กฐํšŒ ์„ฑ๊ณต

๐Ÿ“Œ Card API ๋ฌธ์„œ

[POST] ์นด๋“œ ์ƒ์„ฑ

  • Endpoint: /card
  • Request Body:
    {
      "name": "The Fool",
      "orientation": "UPRIGHT"
    }
  • Response:
    {
      "cardId": 1,
      "name": "The Fool",
      "orientation": "UPRIGHT",
      "createdAt": "2025-01-28T12:00:00",
      "updatedAt": "2025-01-28T12:00:00",
      "createdBy": 101,
      "updatedBy": 101
    }
  • Status Codes:
    • 201 Created : ์นด๋“œ ์ƒ์„ฑ ์„ฑ๊ณต
    • 400 Bad Request : ์š”์ฒญ ๋ฐ์ดํ„ฐ ์˜ค๋ฅ˜

[GET] ํŠน์ • ์นด๋“œ ์กฐํšŒ

  • Endpoint: /card/{cardId}
  • Path Parameter:
    • cardId (Long) : ์กฐํšŒํ•  ์นด๋“œ ID
  • Response:
    {
      "cardId": 1,
      "name": "The Magician",
      "orientation": "REVERSED",
      "createdAt": "2025-01-28T12:00:00",
      "updatedAt": "2025-01-28T12:30:00",
      "createdBy": 101,
      "updatedBy": 102
    }
  • Status Codes:
    • 200 OK : ์กฐํšŒ ์„ฑ๊ณต
    • 404 Not Found : ํ•ด๋‹น ์นด๋“œ๊ฐ€ ์—†์Œ

[PUT] ์นด๋“œ ์ •๋ณด ์ˆ˜์ •

  • Endpoint: /card/{cardId}
  • Path Parameter:
    • cardId (Long) : ์ˆ˜์ •ํ•  ์นด๋“œ ID
  • Request Body:
    {
      "name": "The High Priestess",
      "orientation": "UPRIGHT"
    }
  • Response:
    {
      "cardId": 1,
      "name": "The High Priestess",
      "orientation": "UPRIGHT",
      "createdAt": "2025-01-28T12:00:00",
      "updatedAt": "2025-01-28T13:00:00",
      "createdBy": 101,
      "updatedBy": 103
    }
  • Status Codes:
    • 200 OK : ์ˆ˜์ • ์„ฑ๊ณต
    • 400 Bad Request : ์š”์ฒญ ๋ฐ์ดํ„ฐ ์˜ค๋ฅ˜
    • 404 Not Found : ํ•ด๋‹น ์นด๋“œ๊ฐ€ ์—†์Œ

[DELETE] ์นด๋“œ ์‚ญ์ œ

  • Endpoint: /card/{cardId}
  • Path Parameter:
    • cardId (Long) : ์‚ญ์ œํ•  ์นด๋“œ ID
  • Response:
    • Status Code: 204 No Content (์‚ญ์ œ ์„ฑ๊ณต)
    • Status Code: 404 Not Found (ํ•ด๋‹น ์นด๋“œ๊ฐ€ ์—†์Œ)

[GET] ๋ชจ๋“  ์นด๋“œ ์กฐํšŒ

  • Endpoint: /card
  • Response:
    [
      {
        "cardId": 1,
        "name": "The Fool",
        "orientation": "UPRIGHT",
        "createdAt": "2025-01-28T12:00:00",
        "updatedAt": "2025-01-28T12:00:00",
        "createdBy": 101,
        "updatedBy": 101
      },
      {
        "cardId": 2,
        "name": "The Magician",
        "orientation": "REVERSED",
        "createdAt": "2025-01-28T12:15:00",
        "updatedAt": "2025-01-28T12:45:00",
        "createdBy": 102,
        "updatedBy": 103
      }
    ]
  • Status Codes:
    • 200 OK : ์กฐํšŒ ์„ฑ๊ณต

ERD (Entity Relationship Diagram)

ERD.png


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors