IT/Live Coding49 [โฑ๏ธ 21๋ถ ๋ง์ ๊ตฌ์ถ] ๐ Spring Gateway + ๐ Redis + ๐ PostGreSQL ์ฐ๋ (โก๊ฐ๋จํ ์บ์ ์ฒ๋ฆฌ) ์กฐ๊ธ ๊ณผ์ฅ๋ ์ ๋ชฉ์ผ ์ ์์ง๋ง..๋น ๋ฅธ ๋ณต๋ถ์ผ๋ก ์ธํด ์ฌ์ค์ด๋ค.ํ์ฌ์์ ํ์ต์ฐจ์์์ ์๋ ์ํคํ ์ฒ๋ฅผ ๊ตฌ์ถํ ์ผ์ด ์์ด ๊ตฌ์ถํ ๋ค ์ญ์ ๊ธฐ์ตํ๊ธฐ ์ํด ๋์์ ์ดฌ์์ ํ๊ณ ๊ทธ ๊ณผ์ ์ ๊ธฐ๋กํ๋ค.๊ทธ๋ฆผ์ ์ฐธ ๋ชป๊ทธ๋ฆฐ๋ค.ํ์ตํด๋ณด๋, MSA ๊ตฌ์กฐ์์๋ API ์๋ฒ์ ์๋จ์ ๊ฒ์ดํธ์จ์ด ์๋ฒ๋ฅผ ๋๊ณ ,์ด ๊ฒ์ดํธ์จ์ด๊ฐ ๋ ผ๋ธ๋กํน ๋ฐฉ์์ผ๋ก ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋น ๋ฅด๊ฒ ๋ฐ์์ ์ ํ API ์๋ฒ๋ก ๋ผ์ฐํ ํ๋ ์ญํ ๋ง ์ํํ๋ค๊ณ ํ๋ค. ์ ๊ทธ๋ฆผ์์ ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๊ฒ์ดํธ์จ์ด๊ฐ ์ ์ผ ๋จผ์ ๋ฐ์,๊ฒฝ๋ก(Path)์ ๋ฐ๋ผ API 1๋ฒ, 2๋ฒ ์๋ฒ๋ก ๋ผ์ฐํ ์ ํด์ค๋ค. API 1๋ฒ์ DB Server์ Redis๋ฅผ ์ฐ๋ํด์ DB ์กฐํ์ ๊ฐ๋จํ ์บ์ ์์ ์ ์ํํ๋ค.API 2๋ฒ์ ๊ฐ๋จํ ๋ฌธ์์ด๋ง ๋ฐํํ๋ ์ญํ ์ด๋ค. ์ค์ ์ ๋ฌด์์๋ ๋ณ๋์ ์๋ฒ๋ก ๊ตฌ์ถ.. IT/Live Coding 2025. 4. 26. Spring Cloud ์ํท ๋ธ๋ ์ด์ปค ๊ฐ๋จ ์์ (ํ ์คํธ ์์ & ์์ค์ฝ๋ ํฌํจ) Spring Cloud์์ ์ํท ๋ธ๋ ์ด์ปค๋ฅผ ํ์ฉํ ๊ฐ๋จํ fallback ์์ ์ ๋๋ค.์ด๋ฒ์๋ small make ๋ฐฉ์์ผ๋ก ๊ตฌํํ์ต๋๋ค.api1๋ฒ์์ api2๋ฒ์ ํธ์ถ ํ ๋ 2๋ฒ์ด ๋ด๋ ค๊ฐ ๊ฒฝ์ฐ ํด๋ผ์ด์ธํธ์๊ฒ 500์๋ฌ๊ฐ ์๋ ๋ฏธ๋ฆฌ ์ ์๋ fallback์ ์คํํ๋๋ก ํฉ๋๋ค.๋์์ ๐ฌ ์์ค ๐ปapi 1๋ฒbuild.gradleplugins { id 'java' id 'org.springframework.boot' version '3.3.10' id 'io.spring.dependency-management' version '1.1.7'}group = 'com.test.lsy'version = '0.0.1-SNAPSHOT'java { toolchain { languageV.. IT/Live Coding 2025. 4. 8. RoboPOJOGenerator๋ก ์ธ๋ถ API JSON ์ฝ๊ฒ ์๋ฐ ๊ฐ์ฒด๋ก ๋ณํํ๊ธฐ (ํ ์คํธ ์์ & ์์ค์ฝ๋ ํฌํจ) ์ด๋ฒ ํฌ์คํ ์์๋ Spring Boot ํ๊ฒฝ์์ RoboPOJOGenerator ํ๋ฌ๊ทธ์ธ์ ํ์ฉํด, ์ธ๋ถ API์ JSON ์๋ต์ Java ๊ฐ์ฒด๋ก ๊ฐํธํ๊ฒ ๋งคํํ๋ ๋ฐฉ๋ฒ์ ์๊ฐํฉ๋๋ค.์ด๋ฒ์๋ ์๊ฒ ๋ง๋ค๋ฉฐ ํค์๊ฐ๋ small make ๋ฐฉ์์ผ๋ก ๊ตฌํํด๋ณด์์ต๋๋ค.์ด๊ฑฐ ์๋์ผ๋ก ๋ง๋ค๋ ค๋ฉด ์๊ทผํ ์๊ฐ ๊ฑธ๋ฆฝ๋๋ค.ํธ์์ ์ง์ ์ธ๋ถ API ํธ์ถํ์ง ์๊ณ JSON ๋ฌธ์์ด๋ก ํ์ฑ ํ์ต๋๋ค.๋์์ ๐ฌ์์ค ๐ปbuild.gradleplugins { id 'java' id 'org.springframework.boot' version '3.3.10' id 'io.spring.dependency-management' version '1.1.7'}group = 'com.test.lsy'version = '0.0... IT/Live Coding 2025. 4. 7. Spring Cloud Gateway + API ์๋ฒ ์ฐ๋ ์์ ๐ (ํ ์คํธ ์์ & ์์ค์ฝ๋ ํฌํจ) Spring Boot์์ Spring Cloud Gateway๋ฅผ ํ์ฉํด API ์๋ฒ์ ์ฐ๋ํ๋ ๊ฐ๋จํ ์์ ์ ๋๋ค.์ด๋ฒ์๋ small make ๋ฐฉ์์ผ๋ก ๊ตฌํํ์ต๋๋ค.์ด ์์ ์์๋ Gateway ์๋ฒ๊ฐ ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋ฐ์ ํน์ ๊ฒฝ๋ก์ ๋ฐ๋ผ API ์๋ฒ๋ก ๋ผ์ฐํ ํ๋ ๋ฐฉ๋ฒ์ ๋ค๋ฃน๋๋ค. ๐๋์์ ๐ฌ์์ค ๐ปgatewayapplication.ymlspring: cloud: gateway: routes: - id: user uri: http://localhost:8081 predicates: - Path=/user/** - id: product uri: http://localhost:8082 .. IT/Live Coding 2025. 4. 1. Spring Boot + Jasypt๋ฅผ ์ด์ฉํ ์ํธํ ํ ์คํธ ๐ (ํ ์คํธ ์์ & ์์ค์ฝ๋ ํฌํจ) Spring Boot์ Jasypt๋ฅผ ์ด์ฉํ ๊ฐ๋จํ ์ํธํ ์์ ์ ๋๋ค.์ ํ๋ฆฌ์ผ์ด์ ์ค์ ํ์ผ์ ํฌํจ๋ ๋ฏผ๊ฐํ ์ ๋ณด๋ฅผ ์ํธํํด์ ์์ ํ๊ฒ ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ค๋ค๋ด ๋๋ค.์ด ์์ ์์๋ Spring Boot์ Jasypt๋ฅผ ํ์ฉํด ์ํธํ๋ ๊ฐ์ ์ค์ ํ์ผ์ ์ ์ฅํ๊ณ , ์ด๋ฅผ ๋ณตํธํํ๋ ๊ฐ๋จํ ๋ฐฉ๋ฒ์ ์๊ฐํฉ๋๋ค.๋์์ ๐ฌ ์์ค ๐ป application.ymlserver: port: 9090 servlet: context-path: / encoding: charset: UTF-8 enabled: true force: truespring: thymeleaf: enabled: true cache: false devtools: livereload.enabled.. IT/Live Coding 2025. 3. 22. Spring Boot + JWT๋ก ์ธ์ฆ ์์คํ ๊ตฌํ (ํ ์คํธ ์์ & ์์ค ์ฝ๋ ํฌํจ) springBoot์ JWT๋ฅผ ์ด์ฉํ ์ธ์ฆ ์๋ฒ๋ฅผ ๊ฐ๋จํ ๊ตฌ์ถํด๋ดค๋ค.๋ฉํ์ฝ๋ฉ๋์ "์คํ๋ง๋ถํธ ์ํ๋ฆฌํฐ - JWT"๋ฅผ ๋ณด๊ณ , ์ด๋ฅผ ๋ฐํ์ผ๋ก ์ค์ค๋ก ๋ณต๊ธฐํ๋ฉฐ ํ์ตํ ๋ด์ฉ์ ๊ธฐ๋ก์ผ๋ก ๋จ๊ธด๋ค.๋์์ ๐ฌ JwtAuthorizationFilter๊ฐ JwtAuthenticationFilter๋ณด๋ค ๋จผ์ ์คํ๋๊ฒ ํด์ผ ํ๋ค.๋์์๋ง ๋ณด๋ฉด JwtAuthorizationFilter๋ณด๋ค JwtAuthenticationFilter์ด ๋จผ์ ์คํ๋์ด์ผ ํ๋ค๊ณ ์คํดํ ๋ฏ ํ๋ค.์ด์ ๋ JwtAuthorizationFilter์์ ์กด์ฌํ๋ ์ฌ์ฉ์๊ณ ์ ํจํ ํ ํฐ์ธ์ง ๊ฒ์ฆ ํ ๊ฒ์ฆ ์คํจ ์ ๋ค์ ํํฐ๋ก ๋์ด๊ฐ๊ฒ ํ๋ฉด ์๋๊ธฐ ๋๋ฌธ์ด๋ค. (์ฆ, ๋ก๊ทธ์ธ๊น์ง ๋ชป๊ฐ๊ฒ ํด์ผ ํจ) ์์ค ๐ปapplication.ymlserver: port: 9090.. IT/Live Coding 2025. 3. 22. [Android, Kotlin] Jetpack Compose์ Glance๋ก ๊ฐ๋จํ ์์ ฏ ๊ตฌํ(์์ & ์ฝ๋ ํฌํจ) ์ด ํฌ์คํ ์ Jetpack Compose์ Glance๋ฅผ ์ด์ฉํด ๊ฐ๋จํ ์ฑ ์์ ฏ์ ๋ง๋๋ ๋ฐฉ๋ฒ์ ๋ค๋ฃน๋๋ค ๐ฑโจ์ ๋ ๋ฐฑ์๋ ๊ฐ๋ฐ์๋ก, ์๋๋ก์ด๋ ๊ฐ๋ฐ์ ๋ํด์๋ ์ด์ ๋ง ๊ธฐ๊ณ ์๋ ๋ณ์๋ฆฌ ์์ค์ ๋๋ค ๐ฃ๐ป๋ง์ด ์ฐธ์กฐํ๋ฉฐ ํฌ์คํ ์ ์์ฑํ๊ณ ์์ง๋ง, ํ๋ฆฐ ์ ์ด ์์ ์ ์์์ ์ํด ๋ถํ๋๋ฆฝ๋๋ค ๐๐์ด ํฌ์คํ ์ ์ ๊ฐ ์์ง ์๊ธฐ ์ํด ๊ธฐ๋ก์ผ๋ก ๋จ๊ธฐ๋ ๊ฒ์ ๋๋ค.๋์์์์คlibs.versions.toml[versions]agp = "8.8.0"kotlin = "2.0.0"coreKtx = "1.15.0"junit = "4.13.2"junitVersion = "1.2.1"espressoCore = "3.6.1"lifecycleRuntimeKtx = "2.8.7"activityCompose = "1.10.1"com.. IT/Live Coding 2025. 3. 16. Spring Boot + Redis๋ก ์์ฒญ ์ ํ (ํ ์คํธ ์์ & ์์ค ์ฝ๋ ํฌํจ) Redis๋ฅผ ํ์ฉํด ์์ดํผ ๊ธฐ๋ฐ ์์ฒญ์ ํ ๊ธฐ๋ฅ ๊ตฌํ(์งง๊ณ ๊ฐ๋จํ ์์)์ญ์๋ ๋ ๋์ค ๊ณต๋ถํ ๊ฒ ๊น๋จน๊ธฐ ์ซ์ด ๊ธฐ๋ก์ผ๋ก ๋จ๊ธด๋ค.๋์์์์คapplication.ymlserver: port: 9090 servlet: context-path: / encoding: charset: UTF-8 enabled: true force: truespring: cache: type: redis devtools: livereload.enabled: true restart.enabled: true datasource: driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy url: jdbc:log4jdbc:my.. IT/Live Coding 2025. 3. 9. Spring Boot + Redis๋ก ์ค์๊ฐ ๋ญํน ๊ตฌํ (ํ ์คํธ ์์ & ์์ค ์ฝ๋ ํฌํจ) Redis๋ฅผ ํ์ฉํ ์ค์๊ฐ ๋ญํน ๊ตฌํ! (์งง๊ณ ๊ฐ๋จํ ์์)์ญ์๋ ๋ ๋์ค ๊ณต๋ถํ ๊ฒ ๊น๋จน๊ธฐ ์ซ์ด ๊ธฐ๋ก์ผ๋ก ๋จ๊ธด๋ค.๋์์์์คapplication.ymlserver: port: 8081 servlet: context-path: / encoding: charset: UTF-8 enabled: true force: truespring: cache: type: redis devtools: livereload.enabled: true restart.enabled: true datasource: driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy url: jdbc:log4jdbc:mysql://.. IT/Live Coding 2025. 3. 8. Spring Boot + Redis ์บ์ฑ ๊ตฌํํ๊ธฐ (ํ ์คํธ ์์ & ์์ค ์ฝ๋ ํฌํจ) Redis๋ฅผ ํ์ฉํ ์บ์ฑ ๊ตฌํ! (์งง๊ณ ๊ฐ๋จํ ์์)์ญ์๋ ๋ ๋์ค ๊ณต๋ถํ ๊ฒ ๊น๋จน๊ธฐ ์ซ์ด ๊ธฐ๋ก์ผ๋ก ๋จ๊ธด๋ค.๋์์์์คapplication.ymlserver: port: 9090 servlet: context-path: / encoding: charset: UTF-8 enabled: true force: truespring: cache: type: redis devtools: livereload.enabled: true restart.enabled: true datasource: driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy url: jdbc:log4jdbc:mysql://loca.. IT/Live Coding 2025. 3. 5. ์ด์ 1 2 3 4 5 ๋ค์