/sns-service

SNS(Social Networking Service) μ„œλ²„ κ΅¬ν˜„ πŸ’Œ

Primary LanguageJavaScript

SNS(Social Networking Service)
μ„œλ²„ κ΅¬ν˜„ πŸ’Œ

πŸ“’ Project

개인으둜 μ§„ν–‰ν•œ ν”„λ‘œμ νŠΈμž…λ‹ˆλ‹€πŸ˜Ž
ν”„λ‘œμ νŠΈ λͺ…μ„Έ

⏳ 개발 κΈ°κ°„

2022/07/18 ~ 2022/07/26

✍🏻 ν”„λ‘œμ νŠΈ μ„€λͺ…

- λ³Έ μ„œλΉ„μŠ€λŠ” SNS(Social Networking Service) μž…λ‹ˆλ‹€.
- μ‚¬μš©μžλŠ” λ³Έ μ„œλΉ„μŠ€μ— μ ‘μ†ν•˜μ—¬, κ²Œμ‹œλ¬Όμ„ μ—…λ‘œλ“œ ν•˜κ±°λ‚˜ λ‹€λ₯Έ μ‚¬λžŒμ˜ κ²Œμ‹œλ¬Όμ„ ν™•μΈν•˜κ³ , μ’‹μ•„μš”λ₯Ό λˆ„λ₯Ό 수 μžˆμŠ΅λ‹ˆλ‹€.

⭐ ν•„μˆ˜ κ΅¬ν˜„μ‚¬ν•­

i. JWTλ₯Ό μ΄μš©ν•œ 둜그인 & 인증
ii. REST API κ΅¬ν˜„(κ²Œμ‹œκΈ€ CRUD)
iii. μ½”λ”© μ»¨λ²€μ…˜
iv. λΉ„μ¦ˆλ‹ˆμŠ€ 둜직 ꡬ쑰
v. λ°μ΄ν„°λ² μ΄μŠ€ λͺ¨λΈλ§

πŸŒ™ μΆ”κ°€ κ΅¬ν˜„μ‚¬ν•­

- Docker(mysql8) ν™œμš©

✏️ ERD table image

Database structures(click!)
Table "user" {
  "user_id" integer [pk, increment]
  "email" varchar(45)
  "password" varchar(45) [not null]
  "user_name" varchar(10) [not null]

  Indexes {
    email [unique]
  }
}

Table "posting" {
  "post_id" integer [pk, increment]
  "user_id" integer [not null]
  "article" text [not null]
  "main_text" text [not null]
  "created_at" datetime [default: `now()`]
  "updated_at" datetime
  "likes" integer [default: 0]
  "watch" integer [default: 0]
  "deleted" boolean [default: false]
}

Table "likes" {
  "post_id" integer [not null]
  "user_id" integer [not null]
}

Table "hashtags" {
  "tag_id" integer [pk, increment]
  "post_id" integer [not null]
  "tag_name" varchar(10) [not null]
}

Ref "posting_fk":"user"."user_id" < "posting"."user_id" [update: cascade]
Ref "likes_fk1":"posting"."post_id" < "likes"."post_id" [update: cascade]
Ref "likes_fk2":"user"."user_id" < "likes"."user_id" [update: cascade]
Ref "hashtags_fk":"posting"."post_id" < "hashtags"."post_id" [update: cascade]

πŸ‰ RestAPI

METHOD URL
μœ μ € 생성 POST /user
둜그인(token λ°œκΈ‰) GET /user/login
둜그인 POST /user/login
κ²Œμ‹œκΈ€ μž‘μ„± POST /post
κ²Œμ‹œκΈ€ μ‚­μ œ(soft delete) POST /post/delete
κ²Œμ‹œκΈ€ 볡ꡬ(restore) POST /post/restore
검색 GET /post/search=?
μ •λ ¬ POST /post/order=?
νŽ˜μ΄μ§€λ„€μ΄μ…˜ GET /post/page=?