Skip to content

πŸ–•μƒβœŒοΈλͺ½μ˜ 상콀함 λ‹΄λ‹Ή ✨ νš¨λ κΈ°β€οΈβ€πŸ”₯와 λ˜ν˜€λ‹ˆπŸ’—

Notifications You must be signed in to change notification settings

ILsangEmong/ILsangEmong-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

64 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Team ILsangEmong

일상이λͺ½ - ν•¨κ»˜ κ²½ν—˜ν•œ ν•˜λ‚˜μ˜ 일상을 μ„œλ‘œ λ‹€λ₯Έ μ‹œκ°μœΌλ‘œ νšŒμƒν•˜λŠ” μ„œλΉ„μŠ€

THE SOPT Sopkathon - Group 4

πŸ›  Used Stacks

Typescript NodeJS Express MongoDB AWS

πŸ§‘β€πŸ’» Developers

μ£Όνš¨μ‹ κΉ€μ†Œν˜„
HYOSITIVE thguss

πŸ’Ό Roles

κΈ°λŠ₯λͺ… μ—”λ“œν¬μΈνŠΈ λ‹΄λ‹Ήμž
νŒ€ 생성 [POST] /team μ£Όνš¨μ‹
νŒ€ 쑴재 유무 확인 [GET] /team/:inviteCode κΉ€μ†Œν˜„
μ½”λ©˜νŠΈ ν•œ 쀄 μž‘μ„± [PUT] /comment κΉ€μ†Œν˜„
μ½”λ©˜νŠΈκ²°κ³Ό 확인 [GET] /comment/:inviteCode μ£Όνš¨μ‹

πŸ“ Code Convention

λ³€μˆ˜λͺ…
  1. Camel Case μ‚¬μš©
  • lower Camel Case
  1. ν•¨μˆ˜μ˜ 경우 동사+λͺ…사 μ‚¬μš©
  • ex) getInformation()
  1. flag둜 μ‚¬μš© λ˜λŠ” λ³€μˆ˜λŠ” 쑰동사 + flag μ’…λ₯˜λ‘œ ꡬ성
  • ex) isNum
  1. μ•½μ–΄λŠ” λ˜λ„λ‘ μ‚¬μš©ν•˜μ§€ μ•ŠλŠ”λ‹€.
  • λΆ€λ“μ΄ν•˜κ²Œ μ•½μ–΄κ°€ ν•„μš”ν•˜λ‹€κ³  νŒλ‹¨λ˜λŠ” 경우 νŒ€μ›κ³Ό μƒμ˜λ₯Ό κ±°μΉœλ‹€.
주석
  1. ν•œμ€„ 주석은 // λ₯Ό μ‚¬μš©ν•œλ‹€.
  // ν•œμ€„ 주석일 λ•Œ
  /**
  * μ—¬λŸ¬μ€„
  * 주석일 λ•Œ
  */
  1. ν•¨μˆ˜μ— λŒ€ν•œ 주석
  /**
   * @route Method /Route
   * @desc Function Description
   * @access Public
 */
  1. Bracket μ‚¬μš© μ‹œ 내뢀에 주석을 μž‘μ„±ν•œλ‹€.
  if (a == 5) {
    // 주석
  }
Bracket
  1. ν•œμ€„ if 문은 μ—¬λŸ¬ μ€„λ‘œ μž‘μ„±ν•œλ‹€.
// ν•œμ€„ if λ¬Έ - μ—¬λŸ¬ μ€„λ‘œ μž‘μ„±
 if(trigger) {
   return;
 }
  1. κ΄„ν˜ΈλŠ” ν•œμΉΈ λ„μš°κ³  μ‚¬μš©ν•œλ‹€.
// κ΄„ν˜Έ μ‚¬μš© ν•œμΉΈ λ„μš°κ³  μ‚¬μš©ν•œλ‹€.
 if (left == true) {
    return;
 }
  1. Bracket μ–‘μͺ½ 사이λ₯Ό λ„μ–΄μ„œ μ‚¬μš©ν•œλ‹€.
 const { userId } = request.user;
비동기 ν•¨μˆ˜μ˜ μ‚¬μš©
  1. async, await ν•¨μˆ˜ μ‚¬μš©μ„ 지ν–₯ν•œλ‹€.
  2. Promise μ‚¬μš©μ€ μ§€μ–‘ν•œλ‹€.
  3. λ‹€λ§Œ λ‘œμ§μ„ μ§œλŠ” 데 μžˆμ–΄ promiseλ₯Ό λΆˆκ°€ν”Όν•˜κ²Œ μ‚¬μš©ν•  경우, μ£Όμ„μœΌλ‘œ ν‘œμ‹œν•˜κ³  commit에 κ·Έ 이유λ₯Ό μž‘μ„±ν•œλ‹€.

🌿 Branch Strategy

Git Workflow
main β†’ develop β†’ name β†’ name_#feature
feature λ²ˆν˜ΈλŠ” issue λ²ˆν˜Έμ— 맞게 생성 / nameμ—λŠ” 자기 이름

1. issue 생성
2. local - name_#featureμ—μ„œ 각자 κΈ°λŠ₯ μž‘μ—… (feature λ²ˆν˜ΈλŠ” issue λ²ˆν˜Έμ— 맞게 생성)
3. remote - name_#feature 에 Push
4. remote - name 으둜 PR
5. remote - develop 으둜 PR
6. μ½”λ“œ 리뷰 ν›„ Confirm λ°›κ³  remote - develop Merge
7. remote - develop 에 Merge 될 λ•Œ λ§ˆλ‹€ λͺ¨λ“  νŒ€μ› local - develop pull λ°›μ•„ μ΅œμ‹  μƒνƒœ μœ μ§€
Branch Name μ„€λͺ…
main 초기 μ„ΈνŒ… 쑴재
develop κ΅¬ν˜„ μ™„λ£Œ 브랜치
hyosik νš¨μ‹ 개인 브랜치
sohyeon μ†Œν˜„ 개인 브랜치
name_#issue 이슈 별 κΈ°λŠ₯ κ΅¬ν˜„ 브랜치

πŸ“Œ Commit Convention

[TAG] λ©”μ‹œμ§€
νƒœκ·Έ 이름 μ„€λͺ…
[CHORE] μ½”λ“œ μˆ˜μ •, λ‚΄λΆ€ 파일 μˆ˜μ •
[FEAT] μƒˆλ‘œμš΄ κΈ°λŠ₯ κ΅¬ν˜„
[ADD] FEAT μ΄μ™Έμ˜ λΆ€μˆ˜μ μΈ μ½”λ“œ μΆ”κ°€, 라이브러리 μΆ”κ°€, μƒˆλ‘œμš΄ 파일 생성
[HOTFIX] issueλ‚˜ QAμ—μ„œ κΈ‰ν•œ 버그 μˆ˜μ •μ— μ‚¬μš©
[FIX] 버그, 였λ₯˜ ν•΄κ²°
[DEL] μ“Έλͺ¨ μ—†λŠ” μ½”λ“œ μ‚­μ œ
[DOCS] READMEλ‚˜ WIKI λ“±μ˜ λ¬Έμ„œ κ°œμ •
[CORRECT] 주둜 λ¬Έλ²•μ˜ 였λ₯˜λ‚˜ νƒ€μž…μ˜ λ³€κ²½, 이름 변경에 μ‚¬μš©
[MOVE] ν”„λ‘œμ νŠΈ λ‚΄ νŒŒμΌμ΄λ‚˜ μ½”λ“œμ˜ 이동
[RENAME] 파일 이름 변경이 μžˆμ„ λ•Œ μ‚¬μš©
[IMPROVE] ν–₯상이 μžˆμ„ λ•Œ μ‚¬μš©
[REFACTOR] μ „λ©΄ μˆ˜μ •μ΄ μžˆμ„ λ•Œ μ‚¬μš©

πŸ“ Project Foldering

πŸ—ƒοΈ 3-Layer Architecture 적용

πŸ“ src _
|_ πŸ“ config _
|_ πŸ“ controllers _
|_ πŸ“ interfaces _
|_ πŸ“ loaders _
|_ πŸ“ models _
|_ πŸ“ modules _
|_ πŸ“ routess _
|_ πŸ“ services _

πŸ’Ύ Collection

const TeamSchema = new mongoose.Schema({
    name: {
        type: String,
        required: true,
    },
    inviteCode: {
        type: String,
        required: true,
        unique: true,
    },
    comments: {
        type: [String],
    },
    startTime: {
        type: Date,
        required: true,
    },
    endTime: {
        type: Date,
        required: true,
    },
});

πŸ“¦ 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",
    "eslint": "^8.16.0",
    "eslint-config-prettier": "^8.5.0",
    "express": "^4.17.3",
    "express-validator": "^6.14.0",
    "mongoose": "^6.3.1",
    "prettier": "^2.6.2"
  }
}

πŸ‘·β€β™‚οΈ Server Architecture

  • 개발 ν™˜κ²½ : Typescript, Node
  • λ°μ΄ν„°λ² μ΄μŠ€ : MongoDB
  • μ„œλ²„ ν™˜κ²½ : AWS EC2, PM2

About

πŸ–•μƒβœŒοΈλͺ½μ˜ 상콀함 λ‹΄λ‹Ή ✨ νš¨λ κΈ°β€οΈβ€πŸ”₯와 λ˜ν˜€λ‹ˆπŸ’—

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published