๐Ÿ”จ ํ”„๋กœ์ ํŠธ ์ผ์ง€

์ •๋ณด ์ „๋‹ฌ๋ณด๋‹จ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉฐ ๊ฒช์€ ์ ๋“ค, ๋Š๋‚€ ์ ๋“ค์„ ๊ธฐ๋กํ•œ ์ผ์ง€

Project: Yestoday(account book)

๊ธฐํš๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด๋ณด๋Š” ํ”„๋กœ์ ํŠธ!!! ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ๋Š” ๊ฐ€๊ณ„๋ถ€ ์›น์•ฑ์„ ๋งŒ๋“ค๊ธฐ๋กœ ๊ฒฐ์ •ํ–ˆ๋‹ค.
๋‹ค๋งŒ, ์ด๋ฏธ ์€ํ–‰ ์–ดํ”Œ์„ ํ†ตํ•ด ์–ด๋Š์ •๋„ ๊ฐ€๊ณ„๋ถ€ ์—ญํ• ์„ ํ•˜๋Š” ์ƒ์„ธํ•œ ๊ธฐ๋Šฅ๋“ค์ด ์ œ๊ณต๋˜๊ธฐ์— ์ƒˆ๋กœ์šด ๊ธฐํš์„ ์ƒ๊ฐํ•ด๋ณด์•˜๋‹ค.
๊ฐ„๋žตํ•œ ์ปจ์…‰์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • ์œ ์ €๋Š” ์˜ค๋Š˜ ๋„์ „ํ•  ์†Œ๋น„ ๊ธˆ์•ก์„ ์„ค์ •ํ•œ๋‹ค. ์†Œ๋น„ ์‹œ ํ•ด๋‹น ๊ธˆ์•ก๊ณผ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•œ๋‹ค.
  • ๋ฉ”์ธ ํ™”๋ฉด์—๋Š” ์–ด์ œ์™€ ์˜ค๋Š˜์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ๋‚˜์˜จ๋‹ค.
  • ์–ด์ œ๋ฅผ ํด๋ฆญํ•˜๋ฉด ์ตœ๊ทผ 1๋…„ ๊ฐ„์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์บ˜๋ฆฐ๋” ๋ทฐ๋กœ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

์ฒ˜์Œ ํ”ผ๊ทธ๋งˆ๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋””์ž์ธ์„ ๋งŒ๋“ค์–ด๋ณด์•˜๋‹ค.

yestoday

๐Ÿฆพ ํ”„๋กœ์ ํŠธ ๋ชฉํ‘œ

  • MVC ํŒจํ„ด ๋ฐ ์˜ต์ €๋ฒ„ ํŒจํ„ด
  • ๋ผ์šฐํ„ฐ ๊ตฌํ˜„
  • ๊ผญ๊ผญ๊ผญ ์™œ ์ด๋ ‡๊ฒŒ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด์•ผํ•˜๊ณ  ์–ด๋–ป๊ฒŒ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ตฌ์„ฑํ• ์ง€ ๋ฏธ๋ฆฌ ์ƒ๊ฐํ•˜๊ณ  ์ž‘์„ฑํ•˜๋„๋ก ํ•˜์ž
  • ๊ฐ€๋Šฅํ•˜๋ฉด ๋‹ค์–‘ํ•œ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์„ ์‹œ๋„ํ•ด๋ณด์ž
  • ์š•์‹ฌ ๋” ๋ถ€๋ ค์„œ Jest๋ฅผ ์ด์šฉํ•˜์—ฌ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๊นŒ์ง€ ์ž‘์„ฑํ•ด๋ณด๊ธฐ
  • ์š•์‹ฌ ๋ถ€๋ฆด ์ˆ˜ ์žˆ๋Š” ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค์–ด๋ณด์ž

๐Ÿคฉ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ธํŒ…

์ด๋ฒˆ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ธํŒ…์—์„œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์›นํŒฉ, ๋ฐ”๋ฒจ์„ ์„ค์ •ํ•˜๊ณ  git add ๋ฐ commit ์‹œ lint ์ž‘์—…์„ ํ•ด์ฃผ๋Š” eslint ์„ค์ •๊นŒ์ง€ ํ•ด๋ณด์•˜๋‹ค.
์š•์‹ฌ๊ฐ™์•„์„œ๋Š” Jest๊นŒ์ง€ ๊ตฌ์„ฑํ•˜๊ณ  ์‹ถ์€๋ฐ, ๋‹น์žฅ TDD๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•  ๊ฒƒ๋„ ์•„๋‹ˆ๋ผ์„œ ์ผ๋‹จ์€ ๊ณต๋ถ€๋งŒ ํ•˜๊ณ  ์ œ์™ธํ–ˆ๋‹ค.
eslint์™€ prettier๋„ ๊ฐ™์ด ์ ์šฉํ•˜๋ คํ–ˆ๋Š”๋ฐ, ์ด๋ฏธ vscode extension์œผ๋กœ prettier๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋˜ํ„ฐ๋ผ ๊ฐœ๋ฐœํ™˜๊ฒฝ์—๋Š” ๋”ฐ๋กœ ๊ตฌ์„ฑํ•  ํ•„์š”๋ฅผ ๋ชป๋Š๊ผˆ๋‹ค.

Webpack config
const path = require('path');

module.exports = {
  mode: 'development',
  entry: './src/app.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist'),
  },
  module: {
    rules: [
      {
        test: /\.m?js$/,
        loader: 'babel-loader',
        exclude: /(node_modules|bower_components)/,
      },
      {
        test: /\.s[ac]ss$/i,
        use: ['style-loader', 'css-loader', 'sass-loader'],
      },
    ],
  },
};
Babel config
{
  "presets": [
    [
      "@babel/preset-env",
      {
        "modules": "auto",
        "useBuiltIns": "entry",
        "corejs": "3"
      }
    ]
  ]
}
Eslint config
module.exports = {
  env: {
    browser: true,
    es2021: true,
    node: true,
  },
  extends: 'eslint:recommended',
  overrides: [],
  parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
  },
  rules: {},
};

์‚ฌ์‹ค ๊ทธ๋™์•ˆ ๋Œ€์ถฉ ๋„˜์–ด๊ฐ”๋˜ Babel config์—์„œ ๋‹ค์–‘ํ•œ ์„ค์ •๊ฐ’๋“ค์— ๋Œ€ํ•ด์„œ ์ดํ•ดํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.