Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Latest commit

ย 

History

History
92 lines (58 loc) ยท 4.21 KB

README.md

File metadata and controls

92 lines (58 loc) ยท 4.21 KB

yesaladin_gateway

YesAladin Gateway๋Š” ๊ฐ ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค ๋˜๋Š” ๋ฐ์ดํ„ฐ์™€ ์ ‘์†ํ•˜๊ณ  API ํ˜ธ์ถœ์„ ์œ„ํ•œ ๊ด€๋ฆฌ, ๋ชจ๋‹ˆํ„ฐ๋ง์„ ๋‹ด๋‹นํ•˜๋Š” API ๊ด€๋ฆฌ ์‹œ์Šคํ…œ ์ž…๋‹ˆ๋‹ค.

Getting Started

./mvnw spring-boot:run

Features

  • NGINX ์—ฐ๋™
    • ๋„๋ฉ”์ธ ์„ค์ • ๋ฐ ์„œ๋ธŒ ๋„๋ฉ”์ธ ์ถ”๊ฐ€
    • Reverse Proxy ์„ค์ •
  • YAML์„ ์ด์šฉํ•˜์—ฌ ๊ฐ ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค์— ๋Œ€ํ•œ URL Rewriting ๋ฐ ์š”์ฒญ ๋ผ์šฐํŒ… ์„ค์ •
  • Custom Filter๋ฅผ ์ ์šฉํ•˜์—ฌ ๊ฐ ์š”์ฒญ์— ๋Œ€ํ•œ ์ •๋ณด์™€ ์‘๋‹ต ๊ฒฐ๊ณผ Logging
  • NHN Cloud Log & Crash๋ฅผ ์—ฐ๋™ํ•˜์—ฌ ๋ชจ๋‹ˆํ„ฐ๋ง ํ™˜๊ฒฝ ๊ตฌ์ถ•
  • Spring Cloud Config๋ฅผ ์—ฐ๋™ํ•˜์—ฌ ์„ค์ • ์ •๋ณด ์™ธ๋ถ€ํ™”

Project Architecture

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2023-02-22 แ„‹แ…ฉแ„Œแ…ฅแ†ซ 10 15 46

CI/CD

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2023-02-22 แ„‹แ…ฉแ„’แ…ฎ 7 24 08

Technical Issue

์ธ์ฆ/์ธ๊ฐ€ ์ฒ˜๋ฆฌ

๊ฐ ์„œ๋ฒ„ ์„œ๋น„์Šค์— ์ ‘๊ทผํ•  ๋•Œ ํ•„์š”ํ•œ ์ธ์ฆ ๋ฐ ์ผ๋ฐ˜ ์—‘์„ธ์Šค ์ œ์–ด๋ฅผ Gateway Service์—์„œ ์ฒ˜๋ฆฌ ํ•œ ๋’ค, ์ธ๊ฐ€๋œ ๊ฒฝ์šฐ ์ถ”๊ฐ€์ ์ธ HTTP Custom Header์— ์‚ฌ์šฉ์ž์˜ ๊ถŒํ•œ ์ •๋ณด ๋“ฑ์„ ๋‹ด์•„ API Server์—์„œ ์ฒดํฌ ํ›„ ํ•ด๋‹น API์— ์ ‘๊ทผ ํ•˜๋Š” flow๊ฐ€ ์ข‹์€ ๋ฐฉ๋ฒ•์ธ์ง€์— ๋Œ€ํ•ด ๊ณ ๋ฏผํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๊ทธ ๊ฒฐ๊ณผ Gateway Server์—์„  ๊ตฌํ˜„ํ•˜๋˜ Custom Authentication Filter๋ฅผ ๋น„๋กฏํ•œ ์ธ์ฆ/์ธ๊ฐ€ ์ฒ˜๋ฆฌ๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ๊ฐ ์š”์ฒญ์— ๋Œ€ํ•œ ๋ผ์šฐํŒ… ๋ฐ ๋ชจ๋‹ˆํ„ฐ๋ง์˜ ์—ญํ• ๋งŒ ๋ถ€์—ฌํ•˜๋„๋ก ๋ณ€๊ฒฝํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๋ณ€๊ฒฝ๋œ flow๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Shop API Server๋Š” Front Server๋กœ๋ถ€ํ„ฐ Authorization Header์— ๋‹ด๊ธด JWT ํ† ํฐ ์ •๋ณด๋ฅผ ๋ฐ›์•„ ์ด์— ๋Œ€ํ•œ ์ธ๊ฐ€ ์ฒ˜๋ฆฌ๋ฅผ ์‚ฌ์ „์— Auth Server๋กœ ์œ„์ž„ํ•ฉ๋‹ˆ๋‹ค. Auth Server์—์„œ ํ•ด๋‹น JWT ํ† ํฐ์˜ ์œ ํšจ์„ฑ ๊ฒ€์ฆ์ด ์™„๋ฃŒ๋˜์–ด ์ธ๊ฐ€ ๋œ ๊ฒฝ์šฐ, payload์— ๋“ค์–ด์žˆ๋Š” ์‚ฌ์šฉ์ž ์‹๋ณ„ ์ •๋ณด์™€ ๊ถŒํ•œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜์—ฌ Shop API Server์— ๋Œ๋ ค์ค๋‹ˆ๋‹ค. ์ด ์ •๋ณด๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ Shop API Server ๋‚ด์—์„œ Spring Security๋ฅผ ํ†ตํ•ด ์ž์ฒด์ ์œผ๋กœ Authentication ์„ ์ƒ์„ฑํ•˜๋„๋ก ์ฒ˜๋ฆฌํ•˜์˜€์œผ๋ฉฐ, FilterSecurityInterceptor ๋ฐ method security๋ฅผ ์ ์šฉํ•˜์—ฌ API ๋ณด์•ˆ์„ ๊ฐ•ํ™”ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

Tech Stack

Languages

Java

Frameworks

SpringBoot SpringCloud

Build Tool

ApacheMaven

DevOps

NHN Cloud Jenkins SonarQube Grafana

Web Server

NGINX

ํ˜•์ƒ ๊ด€๋ฆฌ ์ „๋žต

Git GitHub

  • Git Flow ์ „๋žต์„ ์‚ฌ์šฉํ•˜์—ฌ Branch๋ฅผ ๊ด€๋ฆฌํ•˜๋ฉฐ Main/Develop Branch๋กœ Pull Request ์‹œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ ์ง„ํ–‰ ํ›„ merge ํ•ฉ๋‹ˆ๋‹ค. image
  • Main: ๋ฐฐํฌ์‹œ ์‚ฌ์šฉ
  • Develop: ๊ฐœ๋ฐœ ๋‹จ๊ณ„๊ฐ€ ๋๋‚œ ๋ถ€๋ถ„์— ๋Œ€ํ•ด Merge ๋‚ด์šฉ ํฌํ•จ
  • Feature: ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ๋‹จ๊ณ„
  • Hot-Fix: Merge ํ›„ ๋ฐœ์ƒํ•œ ๋ฒ„๊ทธ ๋ฐ ์ˆ˜์ • ์‚ฌํ•ญ ๋ฐ˜์˜ ์‹œ ์‚ฌ์šฉ

Contributors