κ°μΈμΌλ‘ μ§νν νλ‘μ νΈμ
λλ€π
νλ‘μ νΈ λͺ
μΈ
2022/07/18 ~ 2022/07/26
- λ³Έ μλΉμ€λ SNS(Social Networking Service) μ
λλ€.
- μ¬μ©μλ λ³Έ μλΉμ€μ μ μνμ¬, κ²μλ¬Όμ μ
λ‘λ νκ±°λ λ€λ₯Έ μ¬λμ κ²μλ¬Όμ νμΈνκ³ , μ’μμλ₯Ό λλ₯Ό μ μμ΅λλ€.
i. JWTλ₯Ό μ΄μ©ν λ‘κ·ΈμΈ & μΈμ¦
ii. REST API ꡬν(κ²μκΈ CRUD)
iii. μ½λ© 컨벀μ
iv. λΉμ¦λμ€ λ‘μ§ κ΅¬μ‘°
v. λ°μ΄ν°λ² μ΄μ€ λͺ¨λΈλ§
- Docker(mysql8) νμ©
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=? |