๐Ÿš€DB

user table

์ปฌ๋Ÿผ๋ช… ํƒ€์ž… ๋น„๊ณ 
user_id string PK
password string
name string
phone string
email string
profile_img_src string

feed table

์ปฌ๋Ÿผ๋ช… ํƒ€์ž… ๋น„๊ณ 
user_id string FK
content string
created_at datetime
feed_img_src string

comment table

์ปฌ๋Ÿผ๋ช… ํƒ€์ž… ๋น„๊ณ 
user_id string FK
feed_idx string(ObjectId) FK
content string
created_at datetime

follower table

์ปฌ๋Ÿผ๋ช… ํƒ€์ž… ๋น„๊ณ 
following string FK
follower string FK

like table

์ปฌ๋Ÿผ๋ช… ํƒ€์ž… ๋น„๊ณ 
user_id string FK
feed_idx string(ObjectId) FK
created_at datetime

ํšŒ์›

Method URL Request Response Etc
register POST /api/auth/register {
id: id,
password: password
} {
ok : true
}
{
ok : false
(ID์ค‘๋ณต)
} ํšŒ์›๊ฐ€์ž… /
id : 5~10์ž
Password:
8์ž - 20์ž
ํŠน์ˆ˜๋ฌธ์ž,์ˆซ์ž ํฌํ•จ
login POST /api/auth/login {
id: id,
password: password
} {
ok : true
}
{
ok : false
(PW ๋ถˆ์ผ์น˜, ID ์—†์Œ)
} ๋กœ๊ทธ์ธ
logout POST /api/auth/logout {
id: id
} {
ok : true
} ๋กœ๊ทธ์•„์›ƒ
update POST /api/auth/update {
id: id,
๋ณ€๊ฒฝํ•œ ํ•ญ๋ชฉ
} {
ok : true
} ํšŒ์› ์ •๋ณด ๋ณ€๊ฒฝ

๋งˆ์ด ํŽ˜์ด์ง€

Method URL Request Response Etc
get_profile GET /api/profile {
} {
profile_img_src,
following, follower,
feed_img_src
}
set_profile_img POST /api/profile/img {
profile_img_src : profile_img_src
} {
ok : true
}
set_following POST /api/profile/following {
following_id : user_id
} {
ok : true
}
set_follower POST /api/profile/follower {
follower_id : user_id
} {
ok : true
}
user_feed GET /api/profile/feed {
user_id : user_id
content
} {
ok : true
}

๋ฉ”์ธ ํŽ˜์ด์ง€

Method URL Request Response Etc
feed GET /api/feed {
์‚ฌ์ง„,
user_id,
profile_img_src,
creat_at
}
feed POST /api/feed {
์‚ฌ์ง„,
user_id, profile_img_src, creat_at
} {
ok : true
} ์ €์žฅ
comment GET /api/comment {
content,
write_id,
feed_idx,
creat_at,
profile_img_src
}
POST /api/comment {
content,
write_id, feed_idx, creat_at, profile_img_src
} {
ok : true
} ์ €์žฅ
comment_remove POST /api/comment/remove {
comment_id
} {
ok : true
}
liked GET /api/liked {
user_id, feed_idx
}
POST /api/liked {
user_id, feed_idx
} {
ok : true
} ์ €์žฅ
liked_cancel POST /api/liked/cancel {
user_id, feed_idx
} {
ok : true
} ์‚ญ์ œ

ํŒ”๋กœ์šฐ & ํŒ”๋กœ์ž‰

Method URL Request Response Etc
following
(ํŒ”๋กœ์ž‰ ์‹ ์ฒญ) GET {
user.id
user.follower
} {
user.id
user.follower + 1
}
follow Post user.following +1