Skip to content

๐ŸŒˆ MOTI ! Make Own True Identity โญ๏ธ ์œ ๋‹ˆํ์™€ ์œ ์ดˆ์ฝ”ํŒŒ์ด ๋…ธ๋“œ๋กœ ํƒˆ์ฃผํ•˜๋‹ค๐Ÿ˜Ž

Notifications You must be signed in to change notification settings

mash-up-kr/ahobsu-node-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Ahobsu-Node-Backend

์œ ๋‹ˆํ์™€ ์œ ์ดˆ์ฝ”ํŒŒ์ด ๋…ธ๋“œ๋กœ ํƒˆ์ฃผํ•˜๋‹ค๐Ÿ˜Ž

MashUp Node JS Project

๐Ÿ’ป API

moti

๋งค์ผ๋งค์ผ ๋ฏธ์…˜์„ ์ˆ˜ํ–‰ํ•˜๋ฉฐ ์นด๋“œ๋ฅผ ์ˆ˜์ง‘ํ•ด ๋ณด์ž

์†Œ๊ฐœ๊ธ€

๋งค์ผ ํ•˜๋ฃจ์— ํ•œ ๋ฒˆ ๋ฐ›์„ ์งˆ๋ฌธ์— ๋‹ตํ•˜๋ฉด์„œ ์ž์‹ ์„ ๊ธฐ๋กํ•ด๋ณด์„ธ์š”.

  • ์งˆ๋ฌธ์— ๋‹ต์„ ํ•˜๊ณ  ๊ธฐ๋กํ•˜๋Š” ๊ณผ์ •์—์„œ
  • ๋‹น์‹ ์ด ๋ฌด์—‡์„ ์ข‹์•„ํ•˜๋Š”์ง€
  • ๋‹น์‹ ์ด ์–ด๋–ค ์ถ”์–ต์„ ๊ฐ€์ง€๊ณ  ์žˆ์—ˆ๋Š”์ง€
  • ์•ž์œผ๋กœ ๋‹น์‹ ์ด ์–ด๋–ค ์‚ถ์„ ์‚ด๊ณ  ์‹ถ์€์ง€
  • ์•Œ์•„๊ฐ€ ๋ณด์„ธ์š”.

๋‹จ์ˆœํžˆ ๊ธฐ๋ก์—์„œ ๊ทธ์น˜์ง€ ์•Š๊ณ  ๋‹น์‹ ์ด ๊ธฐ๋กํ•œ ์ผ์ฃผ์ผ์€ ํ•œ ์žฅ์˜ ๊ฟˆ์„ ๋‹ด์€ ์นด๋“œ๋กœ ์™„์„ฑ๋ฉ๋‹ˆ๋‹ค.

๊พธ์ค€ํžˆ ํ•˜๋ฃจํ•˜๋ฃจ๋ฅผ ๊ธฐ๋กํ•˜๋ฉด์„œ ์นด๋“œ๋ฅผ ์ˆ˜์ง‘ํ•ด๋ณด์„ธ์š”.

MOTI ์‚ฌ์šฉ๋ฒ•

  1. ํ•˜๋ฃจ์— ๋ฐ›๋Š” ์งˆ๋ฌธ์€ ์ด 3๊ฐœ! ๊ทธ์ค‘ ๋งˆ์Œ์— ๋“œ๋Š” ์งˆ๋ฌธ์„ ์„ ํƒํ•˜์„ธ์š”(๋งˆ์Œ์— ๋“œ๋Š” ์งˆ๋ฌธ์ด ์—†๋‹ค๋ฉด 3๋ฒˆ๊นŒ์ง€ ์ƒˆ๋กœ ์งˆ๋ฌธ์„ ๋ฐ›์•„๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค)
  2. ์‚ฌ์ง„๊ณผ ๊ธ€์„ ์ด์šฉํ•ด์„œ ์งˆ๋ฌธ์— ๊ฐ„๋‹จํ•œ ๋‹ต์„ ํ•˜๋ฉด ๋!
  3. ๋‹ต๋ณ€์„ ์™„๋ฃŒํ•œ ๋‚ ์€ ์นด๋“œ ๊ทธ๋ฆผ์˜ ํ•œ ๋ถ€๋ถ„์ด ์ฑ„์›Œ์ง‘๋‹ˆ๋‹ค.
  4. ์ผ์ฃผ์ผ ๋™์•ˆ ๊พธ์ค€ํ•œ ๊ธฐ๋ก์„ ํ†ตํ•ด ์™„์„ฑ๋œ ์นด๋“œ๋ฅผ ์ˆ˜์ง‘ํ•ด๋ณด์„ธ์š”!
  5. ์•จ๋ฒ”์„ ํ†ตํ•ด์„œ ๊ธฐ๋ก๋œ ๋‚ด์šฉ์„ ๋˜๋Œ์•„๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

  • ๋กœ๊ทธ์ธ ํšŒ์›๊ฐ€์ž…
    • ๊ตฌ๊ธ€ ๋กœ๊ทธ์ธ
    • ์• ํ”Œ ๋กœ๊ทธ์ธ
    • ํšŒ์› ํƒˆํ‡ด
  • ๋งค์ผ ์ƒˆ๋กœ์šด ๋ฏธ์…˜ 3๊ฐ€์ง€ ์ œ๊ณต
    • ๋ฏธ์…˜ ์žฌ๋ฐœ๊ธ‰ ๊ธฐ๋Šฅ(์ œํ•œ์ ์œผ๋กœ ์ œ๊ณต)
  • ์ฃผ๋ณ„๋กœ ์ƒˆ๋กœ์šด ์นด๋“œ ์„ธํŠธ ์ œ๊ณต
  • ๋‹ต๋ณ€์ž‘์„ฑ
    • ๋‹น์ผ ๋‹ต๋ณ€ ์ˆ˜์ •
    • ์ผ์ฃผ์ผ์น˜ ๋‹ต๋ณ€ ์กฐํšŒ
    • ํŠน์ •๋‚ ์งœ ๋‹ต๋ณ€ ์กฐํšŒ
  • ํŒŒ์ผ
    • ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ
    • ์ผ์ฃผ์ผ์น˜ ์ด๋ฏธ์ง€ ์ œ๊ณต

ํด๋” ๊ตฌ์กฐ

  • __test__ : ํ…Œ์ŠคํŠธ ์ฝ”๋“œ
  • bin : ์„œ๋ฒ„์— ๋Œ€ํ•œ ๋ถ€๊ฐ€์„ค๋ช…
  • config : ์„ค์ •ํŒŒ์ผ
  • lib : ๊ณตํ†ตํ•จ์ˆ˜ (helper)
  • middleware : ๋ฏธ๋“ค์›จ์–ด ๋ชจ์•„๋‘” ๊ณณ
  • models : data model
  • public : ์ •์ ํŒŒ์ผ
  • routes : ๋ผ์šฐํ„ฐ
  • swagger : api docs and testing

Quick Start

  • node : v11.13.0

  • npm : 6.7.0

  • ์˜์กด์„ฑ ์„ค์น˜

git clone https://github.com/mash-up-kr/Ahobsu-Node-Backend.git
cd Ahobsu-Node-Backend
npm install
  • .env.default๋ฅผ .env๋กœ ๋ณ€๊ฒฝ ํ›„ ํ‚ค ์„ค์ •
AWSAccessKeyId=YOUR_AWSAccessKeyId
AWSSecretKey=YOUR_AWSSecretKey
buket=YOUR_buket
privateKey=YOUR_privateKey
TZ=Asia/Seoul
DB_USERNAME=YOUR_DB_USERNAME
DB_HOST=YOUR_DB_HOST
DB_PASSWORD=YOUR_DB_PASSWORD
  • ๊ฐœ๋ฐœ ์„œ๋ฒ„ ์‹œ์ž‘
  npm start:test
  • ๋ฐฐํฌ ์‹œ์ž‘(pm2๋กœ ์‹œ์ž‘)
  npm run depoly

์จ๋“œํŒŒํ‹ฐ ํŒจํ‚ค์ง€

๋ชจ๋“ˆ ์—ญํ•  ์‚ฌ์šฉํ•œ ๋ถ€๋ถ„
aws-sdk Amazon Web Services and build scalable solutions with Amazon S3, Amazon DynamoDB, Amazon Glacier
cookie-parser ์ฟ ํ‚คํŒŒ์„œ
cors CORS๋Š” CORS ๋ฅผ ๋‹ค์–‘ํ•œ ์˜ต์…˜ ์œผ๋กœ ํ™œ์„ฑํ™”ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Connect / Express ๋ฏธ๋“ค์›จ์–ด ๋ฅผ ์ œ๊ณตํ•˜๊ธฐ์œ„ํ•œ node.js ํŒจํ‚ค์ง€์ž…๋‹ˆ๋‹ค
debug ๋…ธ๋“œ ์ฝ”์–ด์˜ ๋””๋ฒ„๊น… ๊ธฐ์ˆ ์„ ๋ชจ๋ธ๋กœ ํ•œ ์ž‘์€ node.js ๋””๋ฒ„๊น… ์œ ํ‹ธ๋ฆฌํ‹ฐ
dotenv nodejs ํ”„๋กœ์ ํŠธ๋ฅผ ์œ„ํ•ด .env์—์„œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ๋กœ๋“œ
express ๋ฏธ๋‹ˆ๋ฉ€๋ฆฌ์ŠคํŠธ ์›น ํ”„๋ ˆ์ž„ ์›Œํฌ
formidable ํŒŒ์ผ ์—…๋กœ๋“œ๋ฅผ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜๊ธฐ์œ„ํ•œ node.js ๋ชจ๋“ˆ
greenlock-express ์›น ์„œ๋ฒ„ , ์›น ๋ธŒ๋ผ์šฐ์ € ๋ฐ node.js ๋ฏธ๋“ค์›จ์–ด ์‹œ์Šคํ…œ์„์œ„ํ•œ ์ธ์ฆ์„œ
http-errors Express, Koa, Connect ๋“ฑ์— ๋Œ€ํ•œ HTTP ์˜ค๋ฅ˜๋ฅผ ์‰ฝ๊ฒŒ ์ƒ์„ฑ
husky git hook์„ ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋„์™€์ฃผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
jsonwebtoken JSON ํ˜•ํƒœ๋กœ ์ธ์ฆํ† ํฐ์„ ๋งŒ๋“ค์–ด ํ†ต์‹ ํ• ๋•Œ์“ฐ๋Š” ์ธ์ฆ๋ฐฉ์‹
moment ๋‚ ์งœ๊ด€๋ จ ์ž‘์—…์„ ์œ„ํ•œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
morgan node.js ์šฉ HTTP ์š”์ฒญ ๋กœ๊ฑฐ ๋ฏธ๋“ค์›จ์–ด
mysql2 ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค
nodemon ๋””๋ ‰ํ† ๋ฆฌ์˜ ํŒŒ์ผ ๋ณ€๊ฒฝ์ด ๊ฐ์ง€๋˜๋ฉด ๋…ธ๋“œ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ์ž๋™์œผ๋กœ ๋‹ค์‹œ ์‹œ์ž‘
pm2 JavaScript ๋Ÿฐํƒ€์ž„ Node.js์˜ ํ”„๋กœ์„ธ์Šค ๊ด€๋ฆฌ์ž
redirect-https
sequelize Node.js๋ฅผ์œ„ํ•œ ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฌ์šด ๋‹ค์ค‘ SQL ์–ธ์–ด ORM
sequelize-cli Sequelize ๋ช…๋ น ์ค„ ์ธํ„ฐํŽ˜์ด์Šค (CLI)
sqlite3 Node.js์— ๋Œ€ํ•œ ๋น„๋™๊ธฐ ๋น„ ์ฐจ๋‹จ SQLite3 ๋ฐ”์ธ๋”ฉ
swagger-ui-express ์ผ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ž๋™ ์ƒ์„ฑ swagger-ui ์ƒ์„ฑ API ๋ฌธ์„œ๋ฅผ ๋ช…์‹œ ์ ์œผ๋กœ ์ œ๊ณต
ts-loader ์›น ํŒฉ์šฉ TypeScript ๋กœ๋” ์ œ๊ณต
typescript TypeScript๋Š” JavaScript ์ถœ๋ ฅ์„ ์ •๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์ปดํŒŒ์ผ๋˜๋Š” JavaScript์˜ ์ƒ์œ„ ์ง‘ํ•ฉ์ž…๋‹ˆ๋‹ค.
webpack ์ž๋ฐ” ์Šคํฌ๋ฆฝํŠธ ๋ฐ ์นœ๊ตฌ๋ฅผ ์œ„ํ•œ ๋ฒˆ๋“ค๋Ÿฌ์ž…๋‹ˆ๋‹ค. ๋งŽ์€ ๋ชจ๋“ˆ์„ ๋ฌถ์Œ ์ž์‚ฐ์œผ๋กœ ๋ฌถ์Šต๋‹ˆ๋‹ค. ์ฝ”๋“œ ๋ถ„ํ• ์„ ํ†ตํ•ด ํ•„์š”์— ๋”ฐ๋ผ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์˜ ์ผ๋ถ€๋ฅผ ๋กœ๋“œ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
webpack-node-externals Webpack์—์„œ ๋…ธ๋“œ ๋ชจ๋“ˆ์„ ์‰ฝ๊ฒŒ ์ œ์™ธ
@types/npm ๊ณ ํ’ˆ์งˆ TypeScript ์œ ํ˜• ์ •์˜๋ฅผ์œ„ํ•œ ์ €์žฅ์†Œ์ž…๋‹ˆ๋‹ค.
jest ํฌ๊ด„์ ์ธ JavaScript ํ…Œ์ŠคํŠธ ์†”๋ฃจ์…˜
supertest ์œ ์ฐฝํ•œ API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ node.js HTTP ์„œ๋ฒ„๋ฅผ ํ…Œ์ŠคํŠธํ•˜๊ธฐ์œ„ํ•œ ์ˆ˜ํผ ์—์ด์ „ํŠธ ์ค‘์‹ฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ.

Error Code

status ์ƒํ™ฉ
1100 ํ† ํฐ์ด ์œ ํšจํ•˜์ง€ ์•Š์„ ๊ฒฝ์šฐ

Author

๐Ÿ‘ค YuChocopie

Github: @YuChocopie

๐Ÿ‘ค Yuni-Q

Github: @Yuni-Q

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!


This README was generated with โค๏ธ by readme-md-generator

About

๐ŸŒˆ MOTI ! Make Own True Identity โญ๏ธ ์œ ๋‹ˆํ์™€ ์œ ์ดˆ์ฝ”ํŒŒ์ด ๋…ธ๋“œ๋กœ ํƒˆ์ฃผํ•˜๋‹ค๐Ÿ˜Ž

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •