๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Project

[ํ”„๋กœ์ ํŠธ ๊ธฐ๋ณธ ์„ธํŒ…] ๋ฐฑ์—”๋“œ&ํ”„๋ก ํŠธ ๊ธฐ๋ณธ ํ™˜๊ฒฝ ์„ธํŒ…

ํ”„๋กœ์ ํŠธ ๊ธฐ๋ณธ ์„ธํŒ…

1. ๊ธฐ๋ณธ ํ™˜๊ฒฝ ์„ธํŒ…


Portfolio-For-Developers

ํ”„๋กœ์ ํŠธ ๋ฐฑ์—”๋“œ&ํ”„๋ก ํŠธ ๊ธฐ๋ณธ ํ™˜๊ฒฝ ์„ธํŒ…์„ ํฌ์ŠคํŒ… ํ•œ๋‹ค.

front๋Š” vuetify๋ฅผ ์ด์šฉํ•œ vue.js, api๋Š” ์Šคํ”„๋ง ๋ถ€ํŠธ๋ฅผ ์ด์šฉํ•˜์—ฌ ๋งŒ๋“ ๋‹ค.

์šฐ์„  ๋กœ๊ทธ์ธ ๊ตฌํ˜„์„ ๋จผ์ € ํ•˜๊ณ  ๊ทธ ์ดํ›„ ํฌํŠธํด๋ฆฌ์˜ค๋ฅผ ๋งŒ๋“ค์–ด์ฃผ๋Š” ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„, ๊ทธ ๋’ค์— ๊ฐœ๋ฐœ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์˜ฌ๋ฆด ์ˆ˜ ์žˆ๋Š” ๊ฒŒ์‹œํŒ์„ ๋งŒ๋“ค๋ ค๊ณ  ํ•œ๋‹ค.

๋ฐฑ์—”๋“œ ์ดˆ๊ธฐ ์„ธํŒ…


spring initializr๋ฅผ ์ด์šฉํ•˜์—ฌ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค์–ด์ค€๋‹ค.

JPA, Spring Security, Spring Web, Lombok, Devtools, MySql์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ๋‹ค.

build.gradle

    implementation 'io.springfox:springfox-swagger2:2.6.1'
    implementation 'io.springfox:springfox-swagger-ui:2.6.1'
    implementation 'io.jsonwebtoken:jjwt:0.9.1'
    compile group: 'javax.validation', name: 'validation-api'
    compile group: 'org.hibernate', name: 'hibernate-validator', version: '6.1.0.Final'
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.2.0.RELEASE'

build.gradle์— ์ถ”๊ฐ€๋กœ Swagger, jjwt, validation-api, spring-boot-starter-mail๋„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ถ”๊ฐ€ํ•ด ์ฃผ์—ˆ๋‹ค.

application.yml

server:
  port: 5000
  servlet:
    context-path: /
    encoding:
      charset: UTF-8
      enabled: true
      force: true

spring:
  profiles:
    include: key
    active: local
  devtools:
    livereload:
      enabled: true
  jpa:
    hibernate:
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    show-sql: true

application.yml์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋งŒ๋“ค๊ณ  DB์— ๋Œ€ํ•œ ์ •๋ณด์™€ jwt key์— ๋Œ€ํ•œ ์ •๋ณด๋Š” application-key.yml, application-local.yml๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“  ๋’ค ์ด๊ทธ๋…ธ์–ด ํ•˜์˜€๋‹ค.

์ ‘์†


5000๋ฒˆ ํฌํŠธ๋กœ ์ ‘์† ๊ฒฐ๊ณผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰๋จ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

ํ”„๋ก ํŠธ์—”๋“œ ์ดˆ๊ธฐ ์„ธํŒ…

vue create front-end

๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด front-end๋ฅผ ๋งŒ๋“ค๊ณ  ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์ •ํ•˜์—ฌ ์ง„ํ–‰ํ•œ๋‹ค.


๋””ํดํŠธ ์„ค์ •์—์„œ Vuex์™€ Router๋„ ์ถ”๊ฐ€ํ•˜์˜€๊ณ , Prettier์™€ Lint on save๋ฅผ ์ ์šฉํ–ˆ๋‹ค.

cd front-end

vue add vuetify

๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ช…๋ น์–ด๋กœ ํ”„๋ก ํŠธ์—”๋“œ ํŒŒ์ผ๋กœ ๋“ค์–ด๊ฐ„ ๋’ค vuetify๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.


vuetify ์ถ”๊ฐ€๋Š” ๋””ํดํŠธ๋กœ ์ง„ํ–‰ํ•˜์˜€๋‹ค.

.eslintrc

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
  parserOptions: {
    parser: "babel-eslint"
  },
  rules: {
    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
    "prettier/prettier":[
      "warn",
      {
        "semi": false,
        "trailingComma":"none",
      }
    ]
  }
};

.eslintrc๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜์˜€๋‹ค.

semi, trailingComma์— ๋Œ€ํ•œ ์˜ต์…˜์„ ์ˆ˜์ •ํ•œ ๊ฒƒ์ด๋‹ค.

vue.config.js

module.exports = {
  transpileDependencies: ["vuetify"],
  devServer: {
    port: process.env.VUE_APP_PORT || 3000
  }
}

vue.config.js๋„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜์—ฌ ํฌํŠธ ๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ–ˆ๋‹ค.

์ ‘์†


3000๋ฒˆ ํฌํŠธ๋กœ ์ ‘์† ๊ฒฐ๊ณผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰๋จ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.