본문 바로가기

(14)
Spring + Kotlin API Server 만들기 (6) : AWS EB + github action으로 CI/CD 구축 CI/CD 만들어진 API Server를 배포하기 위해 aws의 elastic beanstalk 서비스와 git action을 이용할 계획이다. GitHub Action github에서 push, merge 등을 할때 수행하는 workflow를 정의할 수 있다. 1. github repository에서 action 선택 2. set up a workflow yourself 선택 3. 다지우고 커밋 4. local에서 git pull 이제 git action을 위한 파일은 다 만들어졌다. study.yml을 다음과 같이 수정한다. name: Deploy Device API Server on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps..
Spring + Kotlin API Server 만들기 (4) : Service , TDD Service 설계 Device API가 제공해야 할 Service를 분석하면 다음과 같다. Device list를 조회 할 수 있어야 한다. 특정 Device를 조회 할 수 있어야 한다. 특정 Device의 value를 수정 할 수 있어야 한다. 특정 Device의 command를 수정 할 수 있어야 한다. 이를 토대로 Service를 작성하면 다음과 같다. package com.studuy.study.device import org.springframework.data.repository.findByIdOrNull import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transacti..
Spring + Kotlin API Server 만들기 (3) : Entity , Repository Entity 설계 Entity란? 간단히 말해선 DB에 저장될 객체라고 생각하면 될거 같다. 각각이 별도로 구분이 가능 해야 하고, 안에 들어가 있을 data들을 기술해 놓은 것이다. 이번 프로젝트 & 포스팅은 전체적인 흐름을 소개하는 포스팅이니 Table mapping같은 건 하지 않고 목표로 했던 Device Entity를 설계하는 걸로 한다. Device 분석 Entity를 설계하기 위해 Device를 살펴보면 다음과 같다. 각각의 Device는 구분 가능해야 한다. Device는 Sensor에서 나온 데이터인 value를 가지고 있다. Device는 command를 가지고 있다. 이를 토대로 Entity를 만들어 보자. Device Entity 작성 Spring에서는 @Entity를 통해 해당 c..
Spring + Kotlin API Server 만들기 (2) : project setting Project Setting 각종 설계에 들어가기 전에, project setting을 진행한다. JVM + Spring Setting 2021.12.20 - [Spring] - Spring + Kotlin 환경 세팅 (Ubuntu 20.04 + VScode) Spring + Kotlin 환경 세팅 (Ubuntu 20.04 + VScode) Ubuntu 20.04에서 Spring + Kotlin 환경 세팅 1. JVM 설치 sudo apt install default-jre sudo apt install default-jre java -version javac -version 2. Gradle 설치 VERSION=7.3.2 wget https://services.gradl.. coding-robot.ti..
Spring + Kotlin API Server 만들기 (1) : 프로젝트 시작, MVC 패턴 API Server + React Project 프로젝트 목표 : API server 구현 및 이해 + react 구현 및 이해 프로젝트 github: https://github.com/ladianchad/spring_kotlin_api_study GitHub - ladianchad/spring_kotlin_api_study Contribute to ladianchad/spring_kotlin_api_study development by creating an account on GitHub. github.com MVC 패턴이란? Model - View - Control의 약자로, web application을 구성 할 때 역할에 따라 책임 영역을 구분하여 개발하는 방식을 의미한다. Model : Data..
Spring + Kotlin 환경 세팅 (Ubuntu 20.04 + VScode) Ubuntu 20.04에서 Spring + Kotlin 환경 세팅 1. JVM 설치 sudo apt install default-jre sudo apt install default-jre java -version javac -version 2. Gradle 설치 VERSION=7.3.2 wget https://services.gradle.org/distributions/gradle-${VERSION}-bin.zip -P /tmp sudo unzip -d /opt/gradle /tmp/gradle-${VERSION}-bin.zip sudo unzip -d /opt/gradle /tmp/gradle-${VERSION}-bin.zip echo "export GRADLE_HOME=/opt/gradle/lates..