μΌμμ΄λͺ½ - ν¨κ» κ²½νν νλμ μΌμμ μλ‘ λ€λ₯Έ μκ°μΌλ‘ νμνλ μλΉμ€
μ£Όν¨μ | κΉμν |
---|---|
HYOSITIVE | thguss |
κΈ°λ₯λͺ | μλν¬μΈνΈ | λ΄λΉμ |
---|---|---|
ν μμ± | [POST] /team | μ£Όν¨μ |
ν μ‘΄μ¬ μ 무 νμΈ | [GET] /team/:inviteCode | κΉμν |
μ½λ©νΈ ν μ€ μμ± | [PUT] /comment | κΉμν |
μ½λ©νΈκ²°κ³Ό νμΈ | [GET] /comment/:inviteCode | μ£Όν¨μ |
λ³μλͺ
- Camel Case μ¬μ©
- lower Camel Case
- ν¨μμ κ²½μ° λμ¬+λͺ μ¬ μ¬μ©
- ex) getInformation()
- flagλ‘ μ¬μ© λλ λ³μλ μ‘°λμ¬ + flag μ’ λ₯λ‘ κ΅¬μ±
- ex) isNum
- μ½μ΄λ λλλ‘ μ¬μ©νμ§ μλλ€.
- λΆλμ΄νκ² μ½μ΄κ° νμνλ€κ³ νλ¨λλ κ²½μ° νμκ³Ό μμλ₯Ό κ±°μΉλ€.
μ£Όμ
- νμ€ μ£Όμμ // λ₯Ό μ¬μ©νλ€.
// νμ€ μ£ΌμμΌ λ
/**
* μ¬λ¬μ€
* μ£ΌμμΌ λ
*/
- ν¨μμ λν μ£Όμ
/**
* @route Method /Route
* @desc Function Description
* @access Public
*/
- Bracket μ¬μ© μ λ΄λΆμ μ£Όμμ μμ±νλ€.
if (a == 5) {
// μ£Όμ
}
Bracket
- νμ€ if λ¬Έμ μ¬λ¬ μ€λ‘ μμ±νλ€.
// νμ€ if λ¬Έ - μ¬λ¬ μ€λ‘ μμ±
if(trigger) {
return;
}
- κ΄νΈλ νμΉΈ λμ°κ³ μ¬μ©νλ€.
// κ΄νΈ μ¬μ© νμΉΈ λμ°κ³ μ¬μ©νλ€.
if (left == true) {
return;
}
- Bracket μμͺ½ μ¬μ΄λ₯Ό λμ΄μ μ¬μ©νλ€.
const { userId } = request.user;
λΉλκΈ° ν¨μμ μ¬μ©
- async, await ν¨μ μ¬μ©μ μ§ν₯νλ€.
- Promise μ¬μ©μ μ§μνλ€.
- λ€λ§ λ‘μ§μ μ§λ λ° μμ΄ promiseλ₯Ό λΆκ°νΌνκ² μ¬μ©ν κ²½μ°, μ£ΌμμΌλ‘ νμνκ³ commitμ κ·Έ μ΄μ λ₯Ό μμ±νλ€.
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 | μ΄μ λ³ κΈ°λ₯ ꡬν λΈλμΉ |
νκ·Έ μ΄λ¦ | μ€λͺ |
---|---|
[CHORE] | μ½λ μμ , λ΄λΆ νμΌ μμ |
[FEAT] | μλ‘μ΄ κΈ°λ₯ ꡬν |
[ADD] | FEAT μ΄μΈμ λΆμμ μΈ μ½λ μΆκ°, λΌμ΄λΈλ¬λ¦¬ μΆκ°, μλ‘μ΄ νμΌ μμ± |
[HOTFIX] | issueλ QAμμ κΈν λ²κ·Έ μμ μ μ¬μ© |
[FIX] | λ²κ·Έ, μ€λ₯ ν΄κ²° |
[DEL] | μΈλͺ¨ μλ μ½λ μμ |
[DOCS] | READMEλ WIKI λ±μ λ¬Έμ κ°μ |
[CORRECT] | μ£Όλ‘ λ¬Έλ²μ μ€λ₯λ νμ μ λ³κ²½, μ΄λ¦ λ³κ²½μ μ¬μ© |
[MOVE] | νλ‘μ νΈ λ΄ νμΌμ΄λ μ½λμ μ΄λ |
[RENAME] | νμΌ μ΄λ¦ λ³κ²½μ΄ μμ λ μ¬μ© |
[IMPROVE] | ν₯μμ΄ μμ λ μ¬μ© |
[REFACTOR] | μ λ©΄ μμ μ΄ μμ λ μ¬μ© |
ποΈ 3-Layer Architecture μ μ©
π src _
|_ π config _
|_ π controllers _
|_ π interfaces _
|_ π loaders _
|_ π models _
|_ π modules _
|_ π routess _
|_ π services _
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,
},
});
{
"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"
}
}
- κ°λ° νκ²½ : Typescript, Node
- λ°μ΄ν°λ² μ΄μ€ : MongoDB
- μλ² νκ²½ : AWS EC2, PM2