Skip to content

๐ŸŽ [SOPKATHON] ํ‘ธ๋ฆ‡ํ‘ธ๋ฆ‡ ์„œ๋น„์Šค ์„œ๋ฒ„

Notifications You must be signed in to change notification settings

SOPKATHON-GROUP11/Nangman-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

55 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Nangman-Server

ํ‘ธ๋ฆ‡ํ‘ธ๋ฆ‡

p5

์ผ์ƒ ์† ๊ณ ๋ง™๊ณ  ๋ฏธ์•ˆํ•œ ์‚ฌ๋žŒ๋“ค์€ ๋งŽ์ง€๋งŒ ๊ทธ ๋งˆ์Œ์„ ์ „ํ•˜๊ธฐ๋Š” ์‰ฝ์ง€ ์•Š๋‹ค.
์ „ํ•˜์ง€ ๋ชปํ–ˆ๋˜ ์†๋งˆ์Œ์„ ํ‘ธ๋ฆ‡ ํ‘ธ๋ฆ‡์„ ํ†ตํ•ด ๋‚จ๊ฒจ๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ?


๊ฐ์ž ๊ฐœ๋ฐœ ๋‹ด๋‹น ๋ถ€๋ถ„

๋ฐ•์ •ํ›ˆ ๊ณตํ˜์ค€
PUT ํŠน์ • ๊ฒŒ์‹œ๋ฌผ ๋ฌผ๋ฟŒ๋ฆฌ๊ธฐ GET ์ „์ฒด ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ
GET ํŠน์ • ๊ฒŒ์‹œ๊ธ€ ์ƒ์„ธ ์กฐํšŒ POST ๊ฒŒ์‹œ๊ธ€ ์ž‘์„ฑ
GET ํŠธ๋ฆฌ์— ๋‹ฌ๋ ค์žˆ๋Š” ๋ณธ์ธ ๊ฒŒ์‹œ๊ธ€ ์ „์ฒด ์กฐํšŒ GET ๋ณธ์ธ ๊ฒŒ์‹œ๊ธ€ ์ „์ฒด ์กฐํšŒ
PUT ๋‚ด ๋‚˜๋ฌด์— ๋‹ฌ๋ฆฐ ๊ณผ์ผ๋“ค ์ˆ˜ํ™• GET ํŠธ๋ฆฌ์— ๋‹ฌ๋ ค์žˆ๋Š” ๊ฒŒ์‹œ๋ฌผ์ด 10๊ฐœ ๋„˜๋Š”์ง€ ํ™•์ธ

Code Convention

prettier ์‚ฌ์šฉ


Commit Message Convention

  - INIT : ์ดˆ๊ธฐํ™”
  - FEAT : ๊ธฐ๋Šฅ ์ถ”๊ฐ€
  - UPDATE : ๊ธฐ๋Šฅ ๋ณด์™„ (์—…๊ทธ๋ ˆ์ด๋“œ)
  - FIX : ๋ฒ„๊ทธ ์ˆ˜์ •
  - REFACTOR : ๋ฆฌํŒฉํ† ๋ง
  - STYLE : ์Šคํƒ€์ผ (์ฝ”๋“œ ํ˜•์‹, ์„ธ๋ฏธ์ฝœ๋ก  ์ถ”๊ฐ€: ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์— ๋ณ€๊ฒฝ ์—†์Œ)
  - DOCS : ๋ฌธ์„œ (๋ฌธ์„œ ์ถ”๊ฐ€(Add), ์ˆ˜์ •, ์‚ญ์ œ)
  - TEST : ํ…Œ์ŠคํŠธ (ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€, ์ˆ˜์ •, ์‚ญ์ œ: ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์— ๋ณ€๊ฒฝ ์—†์Œ)
  - CHORE : ๊ธฐํƒ€ ๋ณ€๊ฒฝ์‚ฌํ•ญ (๋นŒ๋“œ ์Šคํฌ๋ฆฝํŠธ ์ˆ˜์ •, ์—์…‹ ์ถ”๊ฐ€ ๋“ฑ)


Git Branch

  • main ๋ธŒ๋žœ์น˜ - ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐ ์…‹ํŒ…, default branch
  • PRย โžก๏ธย ์ฝ”๋“œ๋ฆฌ๋ทฐย โžก๏ธย ๋จธ์ง€( โ†’ main)
  • ๋จธ์ง€ ํ›„ feature ๋ธŒ๋žœ์น˜ ์‚ญ์ œ
  • ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ ์ „ main ์ตœ์‹ ํ™”
- main
- feature
   โ”œโ”€โ”€ /์ด์Šˆ๋ฒˆํ˜ธ

Directory Structure

Nangman-Server
|
|- .gitignore
|- .env
|- nodemon.json
|- package-lock.json
|- package.json
|- README.md
|- tsconfig.json
|- yarn.lock
|- node_modules
|
|- src
	|- config
		|- index.ts
	|- controllers
		|- FruitController.ts
		|- index.ts
		|- MyController.ts
	|- interfaces
		|- common
			|- PostBaseResponseDto.ts
		|- fruit
			|- FruitCreateDto.ts
			|- FruitInfo.ts
			|- FruitMyResponseDto.ts
			|- FruitResponseDto.ts
				
		|- my
			|- MyCheckResponseDto.ts
		|- user
			|- UserInfo.ts
	|- loaders
		|- db.ts
	|- models
		|- Fruit.ts
		|- User.ts
	|- modules
		|- ResponseMessage.ts
		|- statusCode.ts
		|- util.ts
	|- routes
		|- FruitRouter.ts
		|- index.ts
		|- MyRouter.ts
	|- services
		|- FruitService.ts
		|- index.ts
		|- MyService.ts
	|- index.ts

์„ค๊ณ„ํ•œ Collection

User Collection

{
    _id: ObjectId,
    userNickname: String,
    userProfileImageUrl: String
}

Fruit Collection

{
    _id: ObjectId,
    type: Number,
    contents: String,
    wateringCount: Number,
    userId: ObjectId,
    onTree: Boolean,
    createdAt: Date,
    updatedAt: Date
}

package.json

{
    "name": "node-typescript-init",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
        "dev": "nodemon",
        "build": "tsc && node dist"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
        "@types/express": "^4.17.13",
        "@types/mongoose": "^5.11.97",
        "@types/node": "^17.0.25",
        "nodemon": "^2.0.15",
        "ts-node": "^10.7.0",
        "typescript": "^4.6.3"
    },
    "dependencies": {
        "dotenv": "^16.0.0",
        "express": "^4.17.3",
        "express-validator": "^6.14.0",
        "mongoose": "^6.3.1"
    }
}

๐ŸŒฏ Server Architecture

Untitled Diagram drawio

About

๐ŸŽ [SOPKATHON] ํ‘ธ๋ฆ‡ํ‘ธ๋ฆ‡ ์„œ๋น„์Šค ์„œ๋ฒ„

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published