minkimhere / BE_miniproject_devel-rope

[ํ”„๋กœ์ ํŠธ] Devel-rope : ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ์ง€์‹ ๊ณต์œ  ์ปค๋ฎค๋‹ˆํ‹ฐ
0 stars 1 forks source link

๐Ÿ˜Ž Devel-rope

์ฝ”๋“œ์™€ ๋งค์ผ ๊ฐ™์ด ์‹ธ์›€ํ•˜๋Š” ๊ฐœ๋ฐœ์ž๋“ค(Developers)์„ ์œ„ํ•œ ํ•˜๋Š˜์—์„œ ๋‚ด๋ ค์˜จ ๋™์•„์ค„(rope) ๊ฐ™์€ ์•ฑ! ๊ฐœ๋ฐœ์ž๋“ค๋ผ๋ฆฌ ๋‹ค์–‘ํ•œ ์งˆ๋ฌธ์„ ์˜ฌ๋ฆฌ๊ณ , ํŠธ๋Ÿฌ๋ธ”์ŠˆํŒ…๋„ ํ•˜๊ณ , ๊ฐ์ข… ์ง€์‹์„ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๋Š” ์ปค๋ฎค๋‹ˆํ‹ฐ ์ž…๋‹ˆ๋‹ค. ๐Ÿ˜Š

ํ…์ŠคํŠธ



ํ…์ŠคํŠธ

๐Ÿ“†์ œ์ž‘ ๊ธฐ๊ฐ„ ๋ฐ ํŒ€์› ์†Œ๊ฐœ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป

2021-02-11 ~ 2021-02-17

๐ŸŒŽWebsite

์‚ฌ์ดํŠธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐ŸŽฌ๋ฐ๋ชจ ์˜์ƒ ๋งํฌ

๋ฐ๋ชจ์˜์ƒ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ“๋…ธ์…˜ ์„ค๊ณ„ ํŽ˜์ด์ง€

๋…ธ์…˜ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ“‹์™€์ด์–ด ํ”„๋ ˆ์ž„

ํ…์ŠคํŠธ

๐Ÿ› Back-end ๊ธฐ์ˆ  ์Šคํƒ ๋ฐ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๐Ÿ”จ

DBMS

Deploy

Method URL REQ RES
ํšŒ์›๊ฐ€์ž… POST /api/join { email: password: nickname: git: blog: blogtype: } { โ€˜okโ€™: true, message: โ€˜ํšŒ์›๊ฐ€์ž… ์„ฑ๊ณตโ€™ } OR { โ€˜okโ€™: false, errorMessage:โ€™ํšŒ์›๊ฐ€์ž… ์‹คํŒจโ€™ }
์ด๋ฉ”์ผ ์ค‘๋ณต๊ฒ€์‚ฌ POST /api/join/check { email: } { โ€˜okโ€™: true, message: โ€˜์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ์ด๋ฉ”์ผ์ž…๋‹ˆ๋‹ค.โ€™ } OR { โ€˜okโ€™: false, errorMessage:โ€™์ด๋ฏธ ์‚ฌ์šฉ์ค‘์ธ ์ด๋ฉ”์ผ์ž…๋‹ˆ๋‹ค.โ€™ }
๋‹‰๋„ค์ž„ ์ค‘๋ณต๊ฒ€์‚ฌ POST /api/join/check { nickname: } { โ€˜okโ€™: true, message: โ€˜์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ๋‹‰๋„ค์ž„์ž…๋‹ˆ๋‹ค.โ€™ } OR { โ€˜okโ€™: false, errorMessage:โ€™์ด๋ฏธ ์‚ฌ์šฉ์ค‘์ธ ๋‹‰๋„ค์ž„์ž…๋‹ˆ๋‹ค.โ€™ }
๋กœ๊ทธ์ธ POST /api/login { email: password: } token: nickname: userId: userIcon: { 'ok':true, message:โ€™๋กœ๊ทธ์ธ ์„ฑ๊ณตโ€™ } OR { โ€˜okโ€™: false, errorMessage:โ€™๋กœ๊ทธ์ธ ์‹คํŒจโ€™ }
์ „์ฒด ํฌ์ŠคํŠธ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ GET /api/post { 'ok': true, result: [{ //imgUrl: userId: userIcon: postId: nickname: content: //replyNumber: //like_cnt: date: }] }
๋‹ค๋ฅธ ์ผ๋ถ€ ์œ ์ € ๊ด€๋ จ ์ •๋ณด ๋ถˆ๋Ÿฌ์˜ค๊ธฐ GET /api/user { headers:{ authorization:token } headers: { "Authorization": Bearer ${localStorage.getItem("token")}, } { 'ok': true, result: [{ userIcon: nickname: email: git: blog: }] }
๋‹ค๋ฅธ ๋ชจ๋“  ์œ ์ € ๊ด€๋ จ ์ •๋ณด ๋ถˆ๋Ÿฌ์˜ค๊ธฐ GET /api/users { headers:{ authorization:token } headers: { "Authorization": Bearer ${localStorage.getItem("token")}, } { 'ok': true, result: [{ userIcon: nickname: email: git: blog: }] }
๋‚ด ๋กœ๊ทธ์ธ ์ •๋ณด ๋ถˆ๋Ÿฌ์˜ค๊ธฐ GET /api/auth { headers:{ authorization:token } headers: { "Authorization": Bearer ${localStorage.getItem("token")}, } { 'ok': true, result: [{ email: userId: userIcon: nickname: }] }
post ์ƒ์„ฑ POST /api/post { userId: nickname: content: userIcon: imgUrl: date: //comment_cnt: } { โ€˜okโ€™: true, message: โ€˜์ƒ์„ฑ ์„ฑ๊ณตโ€™ } OR { โ€˜okโ€™: false, message:โ€™์ƒ์„ฑ ์‹คํŒจโ€™ }
post ๋ถˆ๋Ÿฌ์˜ค๊ธฐ GET /api/detail:/:postId { postId: } { โ€˜okโ€™: true, result: [{ content: nickname: userId: userIcon: imgUrl: date: postId: //comment_cnt: }] }
post ์ˆ˜์ •ํ•˜๊ธฐ PUT /api/item/:postId { content: userId: imgUrl: postId } { โ€˜okโ€™: true, message: โ€˜์ˆ˜์ • ์„ฑ๊ณตโ€™, } OR { โ€˜okโ€™: false, message:โ€™์ˆ˜์ • ์‹คํŒจโ€™ }
post ์‚ญ์ œํ•˜๊ธฐ DELETE api/item/:postId { postId: } { โ€˜okโ€™: true, message: โ€˜์‚ญ์ œ ์„ฑ๊ณตโ€™ } OR { โ€˜okโ€™: false, message:โ€™์‚ญ์ œ ์‹คํŒจโ€™ }
comment ๋ถˆ๋Ÿฌ์˜ค๊ธฐ GET /api/comment/:postId { postId: } { โ€˜okโ€™: true, result: [{ comment: userId: nickname: postId: commentId: userIcon: date: }] }
comment ์ˆ˜์ •ํ•˜๊ธฐ PUT /api/comment/:commentId { comment: } { โ€˜okโ€™: true, message: โ€˜์ˆ˜์ • ์„ฑ๊ณตโ€™ } OR { โ€˜okโ€™: false, message:โ€™์ˆ˜์ • ์‹คํŒจโ€™ }




๐Ÿ’ฌ Back-end

โ“ Why? JWT + Bearer ์ธ์ฆ ์œ ํ˜•

๋ฐœ๊ธ‰ํ•œ JWT ํ† ํฐ์€ OAuth 2.0 ์ธ์ฆ์œผ๋กœ ๋ฐœ๊ธ‰ํ•œ ์•ก์„ธ์Šค ํ† ํฐ์ด ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— ๊ณต์‹์ ์œผ๋กœ ์ด ๋ฐฉ๋ฒ•์€ "๋น„ํ‘œ์ค€" ๋ฐฉ์‹์œผ๋กœ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€๋งŒ ํ† ํฐ์„ ํ—ค๋”๋กœ ๊ตํ™˜ ํ•  ๋ชฉ์ ์œผ๋กœ ์‚ฌ์šฉํ•  ์ธ์ฆ ์œ ํ˜•์ด Bearer๊ฐ€ ์ œ์ผ ์ ์ ˆํ•˜๋‹ค ์ƒ๊ฐํ•˜์—ฌ HTTP ์ธ์ฆ ์œ ํ˜•์ค‘, Bearer ํƒ€์ž…์„ ์‚ฌ์šฉํ•˜์—ฌ ํ† ํฐ์„ ์ „๋‹ฌ ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•˜์˜€์Šต๋‹ˆ๋‹ค.

โ“ Why? mongoDB

1์ฐจ ๋ชฉํ‘œ๋ฅผ ๊ธฐ๋ณธ CRUD ๊ธฐ๋Šฅ ๊ตฌํ˜„๊ณผ ํ”„๋ก ํŠธ์—”๋“œ์™€ ๋ฐฑ์—”๋“œ์˜ ์•„๋ฆ„๋‹ค์šด ํ˜‘์—…์œผ๋กœ ํ•˜์˜€๊ณ  ์ถ”ํ›„์— ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•  ๊ณ„ํš์„ ์„ธ์› ๋˜ ์ €ํฌ ํ”„๋กœ์ ํŠธ์—์„œ RDBMS์™€ ๋‹ค๋ฅด๊ฒŒ ์ž์œ ๋กœ์ด ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋ฅผ ์žก์„ ์ˆ˜ ์žˆ๋‹ค๋Š” ํŠน์ง•์ด ์žˆ๋Š” Document ๊ธฐ๋ฐ˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์ธ mongoDB๊ฐ€ ๊ฐ€์žฅ ์ ํ•ฉํ•˜๋‹ค ํŒ๋‹จํ•˜์˜€์Šต๋‹ˆ๋‹ค.

โ“ Why? dotenv

๋…ธ์ถœ๋˜๋ฉด ๋ณด์•ˆ์— ์œ„ํ˜‘์ ์ธ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋“ค์„ ํ•œ๊ณณ์— ๋ชจ์•„ ๊ด€๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค.