[32st SOPT APPJAM] Server team repository of Runnect
์ฝ์ค ๊ทธ๋ฆฌ๊ธฐ๋ก ๋ฌ๋ฆฌ๊ธฐ ์ ๋ชฉํ๋ฅผ ์ค์ ํ๊ณ ์ค์๊ฐ ํธ๋ํน์ผ๋ก ์ฝ์ค๋ฅด ๋ฐ๋ผ ์ ๋ฌ๋ฆฌ๊ณ ์๋์ง ํ์ธํฉ๋๋ค.
์ฝ์ค ๋ฐ๊ฒฌ์ ํตํด ๋์๊ฒ ๋ง๋ ์ฝ์ค๋ฅผ ์ถ์ฒ ๋ฐ๊ฑฐ๋ ๋ค๋ฅธ ์ ์ ๊ฐ ๊ณต์ ํ ์ฝ์ค๋ฅผ ๊ฒ์ํ๊ณ ์คํฌ๋ฉํฉ๋๋ค. ์ฝ์ค๋ฅผ ์ง์ ์ ๋ก๋ํ ์ ๋ ์์ต๋๋ค.
์ฝ์ค ๋ณด๊ดํจ์์ ๋ด๊ฐ ๊ทธ๋ฆฐ ์ฝ์ค์ ์คํฌ๋ฉ ์ฝ์ค๋ฅผ ๊ด๋ฆฌํฉ๋๋ค.
๋ง์ดํ์ด์ง์์ ํ๋กํ๊ณผ ํ๋ ๊ธฐ๋ก, ์ ๋ก๋ํ ์ฝ์ค๋ฅผ ํ์ธํ๊ณ ๋ชฉํ ๋ณด์์ผ๋ก ๋๊ธฐ๋ฅผ ๊ฐํํฉ๋๋ค.
{
"name": "Runnect_Server",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/Runnect/Runnect_Server.git",
"author": "YuSuhwa-ve <dhfhfkzjxms@sookmyung.ac.kr>",
"license": "MIT",
"scripts": {
"dev": "nodemon",
"build": "tsc && node dist",
"db:pull": "npx prisma db pull",
"db:push": "npx prisma db push",
"generate": "npx prisma generate",
"prepare": "chmod ug+x .husky/* && husky install",
"greet": "hello husky!",
"test": "mocha ./test/ -r ts-node/register"
},
"dependencies": {
"@prisma/client": "^4.8.0",
"aws-sdk": "^2.1281.0",
"bcryptjs": "^2.4.3",
"dayjs": "^1.11.7",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"express-validator": "^6.14.2",
"jsonwebtoken": "^9.0.0",
"multer": "^1.4.5-lts.1",
"multer-s3": "^3.0.1",
"prisma": "^4.8.0"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.2",
"@types/chai": "^4.3.4",
"@types/express": "^4.17.15",
"@types/express-validator": "^3.0.0",
"@types/jsonwebtoken": "^8.5.9",
"@types/mocha": "^10.0.1",
"@types/multer": "^1.4.7",
"@types/multer-s3": "^3.0.0",
"@types/node": "^18.11.17",
"@types/supertest": "^2.0.12",
"chai": "^4.3.7",
"commitizen": "^4.2.6",
"cz-conventional-changelog": "3.3.0",
"cz-emoji-conventional": "^1.0.1",
"husky": "^8.0.0",
"mocha": "^10.2.0",
"nodemon": "^2.0.20",
"supertest": "^6.3.3",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-emoji-conventional"
}
}
}
๐ src
|_ ๐ config
|_ ๐ constant
|_ ๐ controller
|_ ๐ interface
|_ ๐ middleware
|_ ๐ module
|_ ๐ prisma
|_ ๐ router
|_ ๐ service
|_ index.ts
๐ test| ๋ด๋น์ | ๋ด๋น ๋ด์ฉ | ๊ตฌํ ์ง์ฒ๋ |
|---|---|---|
| ์ ์ํ | EC2, publicCourse & stamp ๊ด๋ จ api | 100% |
| ์ ์ ํฌ | RDS, course & user ๊ด๋ จ api | 100% |
| ๋ฐ์๋ฆฐ | S3, record & scrap ๊ด๋ จ api | 100% |
๐ก ๋๋ฃ๋ค๊ณผ ๋งํฌ๋ฅผ ํต์ผํ๊ธฐ ์ํด ์ปจ๋ฒค์ ์ ์ง์ ํฉ๋๋ค. ์คํฉ์ง์กธ์ ์ฝ๋๊ฐ ์๋, ํ ์ฌ๋์ด ์ง ๊ฒ๊ฐ์ ์ฝ๋๋ฅผ ์์ฑํ๋ ๊ฒ์ด ์ถํ ์ ์ง๋ณด์๋ ํ์ ์์ ๋์์ด ๋ฉ๋๋ค. ๋ด๊ฐ ์ฝ๋๋ฅผ ์๊ฐํ๋ฉด์ ์งค ์ ์๋๋ก ํด์ฃผ๋ ๋ฃฐ์ด๋ผ๊ณ ์๊ฐํด๋ ์ข์ต๋๋ค!
๋ช ๋ช ๊ท์น(Naming Conventions)
- ์ด๋ฆ์ผ๋ก๋ถํฐ ์๋๊ฐ ์ฝํ์ง ์ ์๊ฒ ์ด๋ค.
-
ex)
// bad function q() { // ...stuff... } // good function query() { // ..stuff.. }
- ์ค๋ธ์ ํธ, ํจ์, ๊ทธ๋ฆฌ๊ณ ์ธ์คํด์ค์๋
camelCase๋ฅผ ์ฌ์ฉํ๋ค.
-
ex)
// bad const OBJEcttsssss = {}; const this_is_my_object = {}; function c() {} // good const thisIsMyObject = {}; function thisIsMyFunction() {}
- ํด๋์ค๋ constructor์๋
PascalCase๋ฅผ ์ฌ์ฉํ๋ค.
-
ex)
// bad function user(options) { this.name = options.name; } const bad = new user({ name: "nope", }); // good class User { constructor(options) { this.name = options.name; } } const good = new User({ name: "yup", });
- ํจ์ ์ด๋ฆ์ ๋์ฌ + ๋ช
์ฌ ํํ๋ก ์์ฑํ๋ค.
ex)
postUserInformation( ) - ์ฝ์ด ์ฌ์ฉ์ ์ต๋ํ ์ง์ํ๋ค.
- ์ด๋ฆ์ ๋ค ๋จ์ด ์ด์์ด ๋ค์ด๊ฐ๋ฉด ํ์๊ณผ ์์๋ฅผ ๊ฑฐ์น ํ ์ฌ์ฉํ๋ค
๋ธ๋ก(Blocks)
- ๋ณต์ํ์ ๋ธ๋ก์๋ ์ค๊ดํธ({})๋ฅผ ์ฌ์ฉํ๋ค.
-
ex)
// bad if (test) return false; // good if (test) return false; // good if (test) { return false; } // bad function() { return false; } // good function() { return false; }
- ๋ณต์ํ ๋ธ๋ก์
if์else๋ฅผ ์ด์ฉํ๋ ๊ฒฝ์ฐelse๋if๋ธ๋ก ๋์ ์ค๊ดํธ( } )์ ๊ฐ์ ํ์ ์์น์ํจ๋ค.
- ex)
java // bad if (test) { thing1(); thing2(); } else { thing3(); } // good if (test) { thing1(); thing2(); } else { thing3(); }
์ฝ๋ฉํธ(Comments)
- ๋ณต์ํ์ ์ฝ๋ฉํธ๋
/** ... */๋ฅผ ์ฌ์ฉํ๋ค.
-
ex)
// good /** * @param {String} tag * @return {Element} element */ function make(tag) { // ...stuff... return element; }
- ๋จ์ผ ํ์ ์ฝ๋ฉํธ์๋
//์ ์ฌ์ฉํ๊ณ ์ฝ๋ฉํธ๋ฅผ ์ถ๊ฐํ๊ณ ์ถ์ ์ฝ๋์ ์๋ถ์ ๋ฐฐ์นํ๋ค. ๊ทธ๋ฆฌ๊ณ ์ฝ๋ฉํธ์ ์์ ๋น ํ์ ๋ฃ๋๋ค.
- ex)
jsx // bad const active = true; // is current tab // good // is current tab const active = true; // good function getType() { console.log('fetching type...'); // set the default type to 'no type' const type = this._type || 'no type'; return type; }
๋ฌธ์์ด(Strings)
- ๋ฌธ์์ด์๋ ์ฑํฌ์ฟผํธ
''๋ฅผ ์ฌ์ฉํ๋ค.
-
ex)
// bad const name = "Capt. Janeway"; // good const name = "Capt. Janeway";
- ํ๋ก๊ทธ๋จ์์ ๋ฌธ์์ด์ ์์ฑํ๋ ๊ฒฝ์ฐ๋ ๋ฌธ์์ด ์ฐ๊ฒฐ์ด ์๋
template strings๋ฅผ ์ด์ฉํ๋ค.
- ex)
jsx // bad function sayHi(name) { return 'How are you, ' + name + '?'; } // bad function sayHi(name) { return ['How are you, ', name, '?'].join(); } // good function sayHi(name) { return `How are you, ${name}?`; }
ํจ์(Functions)
- ํ์ดํ ํจ์๋ฅผ ์ฌ์ฉํ๋ค.
-
ex)
var arr1 = [1, 2, 3]; var pow1 = arr.map(function(x) { // ES5 Not Good return x * x; }); const arr2 = [1, 2, 3]; const pow2 = arr.map((x) => x * x); // ES6 Good
์กฐ๊ฑด์๊ณผ ๋ฑ๊ฐ์(Comparison Operators & Equality)
==์ด๋!=๋ณด๋ค===์!==์ ์ฌ์ฉํ๋ค.- ๋จ์ถํ์ ์ฌ์ฉํ๋ค.
-
ex)
// bad if (name !== "") { // ...stuff... } // good if (name) { // ...stuff... }
- ๋น๋๊ธฐ ํจ์๋ฅผ ์ฌ์ฉํ ๋
Promiseํจ์์ ์ฌ์ฉ์ ์ง์ํ๊ณasync,await๋ฅผ ์ฐ๋๋ก ํ๋ค
๐ฑ git branch ์ ๋ต
main branch : ๋ฐฐํฌ ๋จ์ branch
dev branch : ์ฃผ์ ๊ฐ๋ฐ branch, main merge ์ ๊ฑฐ์น๋ branch
feat branch: ๊ฐ์ ๊ฐ๋ฐ branch
- ํ ์ผ issue ๋ฑ๋ก ํ issue ๋ฒํธ์ isuue ์ด๋ฆ์ผ๋ก branch ์์ฑ ํ ์์
- ex) feat/#
issue num-isuue name(๊ธฐ๋ฅ์์ฝ)
- ex) feat/#
- ํด๋น branch ์์
์๋ฃ ํ PR ๋ณด๋ด๊ธฐ
- ํญ์ local์์ ์ถฉ๋ ํด๊ฒฐ ํ โ remote์ ์ฌ๋ฆฌ๊ธฐ
- reviewer์ ์๋ก tagํ code-review
- comment ์ merge ๋ถ๊ฐ!
- review๋ฐ์ ํ, ๋ณธ์ธ์ด merge.
- main
- dev
- feat
โโโ #1-isuue name1
โโโ #2-isuue name2๐ git commit message convention
ex) feat(๋ณ๊ฒฝํ ํ์ผ) : ๋ณ๊ฒฝ ๋ด์ฉ (/#issue num)
- โจ feat: ์๋ก์ด ๊ธฐ๋ฅ ๊ตฌํ
- ๐ fix: ๋ฒ๊ทธ, ์ค๋ฅ ํด๊ฒฐ
- ๐งน chore: src ๋๋ test ํ์ผ์ ์์ ํ์ง ์๋ ๊ธฐํ ๋ณ๊ฒฝ ์ฌํญ ( ์๋ก์ด ํ์ผ ์์ฑ, ํ์ผ ์ด๋, ์ด๋ฆ ๋ณ๊ฒฝ ๋ฑ )
- โป๏ธ refactor: ๋ฒ๊ทธ ์์ ์ด๋ ๊ธฐ๋ฅ ์ถ๊ฐ๊ฐ ์๋ ์ฝ๋ ๋ณ๊ฒฝ ( ์ฝ๋ ๊ตฌ์กฐ ๋ณ๊ฒฝ ๋ฑ์ ๋ฆฌํฉํ ๋ง )
- ๐ style: ์ฝ๋์ ์๋ฏธ์ ์ํฅ์ ๋ฏธ์น์ง ์๋ ๋ณ๊ฒฝ ์ฌํญ ( ์ฝ๋ ํ์, ์ธ๋ฏธ์ฝ๋ก ์ถ๊ฐ: ๋น์ฆ๋์ค ๋ก์ง์ ๋ณ๊ฒฝ ์์ )
- ๐๏ธ build: ๋น๋ ์์คํ
๋๋ ์ธ๋ถ์ ์ํฅ์ ๋ฏธ์น๋ ๋ณ๊ฒฝ ์ฌํญ ์ข
์์ฑ ( ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ถ๊ฐ ๋ฑ )
- ๐ perf: ์ฑ๋ฅ์ ํฅ์ ์ํค๊ธฐ ์ํ ์ฝ๋ ๋ณ๊ฒฝ
- ๐งช test: ํ
์คํธ ์ถ๊ฐ ๋๋ ์ด์ ํ
์คํธ ์์
- ๐ docs: README๋ WIKI ๋ฑ์ ๋ฌธ์ ๊ฐ์
- โช๏ธ revert: ์ด์ ์ปค๋ฐ์ ๋๋๋ฆฌ๋ ๊ฒฝ์ฐ
- ๐ฆ ci: CI ๊ตฌ์ฑ ํ์ผ ๋ฐ ์คํฌ๋ฆฝํธ ๋ณ๊ฒฝ
- Merge: ๋ค๋ฅธ๋ธ๋ ์น๋ฅผ mergeํ๋ ๊ฒฝ์ฐ
- Init : Initial commit์ ํ๋ ๊ฒฝ์ฐ




