๐Ÿฅ Web

    [FCM] Firebase Cloud Messaging Vanilla JS + FastAPI์— ์ ์šฉํ•˜๊ธฐ

    FCM ์„ค์ •๊ณต์‹ ์˜ˆ์ œ์—์„œ๋Š” Node JS ๊ธฐ์ค€์œผ๋กœ ์„ค๋ช…๋˜์–ด ์žˆ์Œhttps://firebase.google.com/docs/cloud-messaging/js/client?hl=ko&_gl=1*16582yh*_up*MQ..*_ga*MTk1Nzk3ODc5Mi4xNzEzMjI3MTcy*_ga_CW55HF8NVT*MTcxMzIyNzE3Mi4xLjAuMTcxMzIyNzE3Mi4wLjAuMA..#web-modular-apiVanilla JS ํ™˜๊ฒฝ์—์„œ ํ•˜๋Š” ๋ฒ• ์ •๋ฆฌ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ Firebase ํด๋ผ์šฐ๋“œ ๋ฉ”์‹œ์ง• ํด๋ผ์ด์–ธํŠธ ์•ฑ ์„ค์ •Google I/O 2023์—์„œ Firebase์˜ ์ฃผ์š” ์†Œ์‹์„ ํ™•์ธํ•˜์„ธ์š”. ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ ์˜๊ฒฌ ๋ณด๋‚ด๊ธฐ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ Firebase ํด๋ผ์šฐ๋“œ ๋ฉ”์‹œ์ง• ํด๋ผ์ด์–ธํŠธ ์•ฑ ์„ค์ • ์ปฌ๋ ‰์…˜์„ ์‚ฌ์šฉํ•ด ์ •๋ฆฌํ•˜๊ธฐ ..

    [etc] Logout ํ›„ ๋’ค๋กœ ๊ฐ€๊ธฐ ๋ฐฉ์ง€ - BF Cache

    ๋ฌธ์ œ logout์„ ํ•œ ๋’ค์— ๋กœ๊ทธ์ธ ๊ถŒํ•œ์ด ํ•„์š”ํ•œ ํŽ˜์ด์ง€๋กœ ๋’ค๋กœ ๊ฐ€๊ธฐ๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ, ๋ฐ์ดํ„ฐ๊ฐ€ ๊ทธ๋Œ€๋กœ ๋…ธ์ถœ๋˜๋Š” ๋ฌธ์ œ ๋ณด์•ˆ์ƒ์˜ ๊ฒฐํ•จ์œผ๋กœ ์ˆ˜์ •ํ•ด์•ผํ•˜๋Š” ๊ฒฝ์šฐ ์›์ธ ๋ธŒ๋ผ์šฐ์ €์—์„œ ๊ด€๋ฆฌํ•˜๋Š” BF Cache(Back-Forward Cache) ์›น ํŽ˜์ด์ง€๋ฅผ ๋ฐฉ๋ฌธํ•˜๋ฉด ํ•ด๋‹น ํŽ˜์ด์ง€์˜ css/html/javascript/image ๋“ฑ ๋ชจ๋“  ๋ฆฌ์†Œ์Šค๋ฅผ ์บ์‹œ์— ์ €์žฅ ๋’ค๋กœ๊ฐ€๊ธฐ / ์•ž์œผ๋กœ ๊ฐ€๊ธฐ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ์„œ๋ฒ„์— ๋‹ค์‹œ ์š”์ฒญํ•˜์ง€ ์•Š๊ณ  ์บ์‹œ ๋ฆฌ์†Œ์Šค ํ™œ์šฉํ•ด์„œ ๋กœ๋”ฉ ๋กœ๊ทธ์•„์›ƒ ์ดํ›„์—๋„ BF Cache๊ฐ€ ๋‚จ์•„์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค์‹œ ํŽ˜์ด์ง€๊ฐ€ ๋ณด์ผ ์ˆ˜ ์žˆ์Œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•(Fast API ๊ธฐ์ค€) Jinja Template response ์‚ฌ์šฉ ๋กœ๊ทธ์ธ ํ•ด์•ผ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํŽ˜์ด์ง€์— ์ ‘์† ์š”์ฒญ์„ ๋ณด๋‚ด๋ฉด ๋ผ์šฐํ„ฐ์—์„œ access token ํ™•์ธ ๊ถŒํ•œ์ด ์žˆ๋Š” ๊ฒฝ์šฐ ..

    [SciChart] Vanilla Javascript์—์„œ SciChart ์‚ฌ์šฉํ•˜๊ธฐ

    Javascript์—์„œ SciChart ์‚ฌ์šฉํ•˜๊ธฐ script๋ฅผ ๊ฐ€์ ธ์˜ค๊ณ  ๋ฏธ๋ฆฌ ํ•„์š”ํ•œ ๊ฒƒ๋“ค ์ •์˜ํ•˜๊ธฐ ... const { SciChartSurface, NumericAxis, DateTimeNumericAxis, FastLineRenderableSeries, XyDataSeries, XyScatterRenderableSeries, EllipsePointMarker, EZoomState, SweepAnimation, SciChartJsNavyTheme, RolloverModifier, RubberBandXyZoomModifier, NumberRange, LegendModifier, MouseWheelZoomModifier, ZoomPanModifier, ZoomExtentsModifier } = SciCha..

    [PostgreSQL] Windows ์™ธ๋ถ€ ์ ‘์† ํ—ˆ์šฉ ์„ค์ • ๋ฐ ์™ธ๋ถ€ ์ ‘์† ๋ฐฉ๋ฒ•

    postgresql.conf ์ˆ˜์ • C:\Program Files\PostgreSQL\15\data_ ๊ฒฝ๋กœ์— postgresql.conf listen_addresses = '*' ๋กœ ์„ค์ • - ๋ชจ๋“  ip ์ฃผ์†Œ์—์„œ ์ ‘์† ํ—ˆ์šฉ white list ip ์„ค์ •ํ•˜๊ณ  ์‹ถ์œผ๋ฉด ip ์ฃผ์†Œ ์“ฐ๊ธฐ ps_hba.conf ์ˆ˜์ • C:\Program Files\PostgreSQL\15\data ๊ฒฝ๋กœ์— pg_hba.conf # IPv4 local connections: host all all 0.0.0.0/0 scram-sha-256 IPv4 local connection address 0.0.0.0/0 ์œผ๋กœ ์ˆ˜์ •(์›๋ž˜๋Š” 127.0.0.1) ๋ฐฉํ™”๋ฒฝ ์„ค์ • ๊ณ ๊ธ‰ ๋ณด์•ˆ์ด ํฌํ•จ๋œ windows defender ๋ฐฉํ™”๋ฒฝ ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ - ์ƒˆ ๊ทœ..

    [Spring ์ž…๋ฌธ] 5. ํšŒ์› ๊ด€๋ฆฌ ์˜ˆ์ œ - ์›น MVC ๊ฐœ๋ฐœ

    1. ํšŒ์› ์›น ๊ธฐ๋Šฅ - ํ™ˆ ํ™”๋ฉด ์ถ”๊ฐ€ localhost:8080 ์œผ๋กœ ํ˜ธ์ถœ container์—์„œ ๋’ค์ง localhost:8080/ < ์ปจํŠธ๋กค๋Ÿฌ ์žˆ์Œ ์—ฐ๊ฒฐ! package hello.hellospring.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class HomeController { @GetMapping("/") public String Home() { return "home"; } } 2. ํšŒ์› ์›น ๊ธฐ๋Šฅ - ๋“ฑ๋ก package hello.hellospring.controller; import he..

    [Spring ์ž…๋ฌธ] 4. ์Šคํ”„๋ง ๋นˆ๊ณผ ์˜์กด๊ด€๊ณ„

    1. ์ปดํฌ๋„ŒํŠธ ์Šค์บ”๊ณผ ์ž๋™ ์˜์กด๊ด€๊ณ„ ์„ค์ • ํšŒ์› ์ปจํŠธ๋กค๋Ÿฌ๊ฐ€ ์„œ๋น„์Šค์™€ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•˜๋„๋ก ํ•˜๊ธฐ → ์˜์กด๊ด€๊ณ„ ์ƒ์„ฑ package hello.hellospring.controller; import org.springframework.stereotype.Controller; @Controller public class MemberController { } @Controller ๋กœ annotation์„ ํ•˜๊ฒŒ๋˜๋ฉด ์Šคํ”„๋ง ๋นˆ์—์„œ ์–˜๋ฅผ ๊ด€๋ฆฌํ•˜๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Œ. private final MemberService memberService; ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ์— ๋“ฑ๋กํ•ด์„œ ํ•˜๋‚˜๋ฅผ ์—ฌ๋Ÿฌ ๊ฐœ๊ฐ€ ๊ณต์œ  @Controller public class MemberController { private final MemberService m..

    [Spring ์ž…๋ฌธ] 3. ํšŒ์› ๊ด€๋ฆฌ ์˜ˆ์ œ - ๋ฐฑ์—”๋“œ ๊ฐœ๋ฐœ

    1. ๋น„์ฆˆ๋‹ˆ์Šค ์š”๊ตฌ์‚ฌํ•ญ ์ •๋ฆฌ ๋ฐ์ดํ„ฐ ํšŒ์› ID ์ด๋ฆ„ ๊ธฐ๋Šฅ ํšŒ์› ๋“ฑ๋ก ์กฐํšŒ ์•„์ง DB ์„ ์ •ํ•˜์ง€ ์•Š์€ ์ƒํ™ฉ ← ์ด๋ผ๋Š” ์„ค์ • ์ปจํŠธ๋กค๋Ÿฌ : ์›น MVC์˜ ์ปจํŠธ๋กค๋Ÿฌ (API ์ƒ์„ฑ ๋“ฑ) ์„œ๋น„์Šค : ํ•ต์‹ฌ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ๋„๋ฉ”์ธ : ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์ €์žฅ / ๊ด€๋ฆฌ๋˜๋Š” ๊ฒƒ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ : ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค ์ ‘๊ทผ / ๋„๋ฉ”์ธ ๊ฐ์ฒด๋ฅผ DB์— ์ €์žฅ ๋ฐ ๊ด€๋ฆฌ ์ธํ„ฐํŽ˜์ด์Šค๋กœ ๊ตฌํ˜„ ํด๋ž˜์Šค ๋ณ€๊ฒฝ ๊ฐ€๋Šฅํ•˜๊ฒŒ ์„ค๊ณ„(DB ์„ ์ • ์•ˆ ํ•จ) ๊ตฌํ˜„์ฒด๋กœ ๋ฉ”๋ชจ๋ฆฌ ๊ธฐ๋ฐ˜์˜ ๊ฐ€๋ฒผ์šด ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ๋กœ ๊ฐœ๋ฐœ ์ง„ํ–‰ 2. ํšŒ์› ๋„๋ฉ”์ธ๊ณผ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ๋งŒ๋“ค๊ธฐ 1. Member ํด๋ž˜์Šค ์ƒ์„ฑ package hello.hellospring.domain; public class Member { private Long id; // database index์— ๊ฐ€๊นŒ์›€ private String ..

    [Elasticsearch] Index Template ๊ตฌ์„ฑํ•˜๊ธฐ with Kibana & Logstash (2) - Mapping ๊ธฐ์ดˆ

    2023.07.06 - [Web/Back-end \ etc.] - [Elasticsearch] Index Template ๊ตฌ์„ฑํ•˜๊ธฐ with Kibana & Logstash (1) - Setting [Elasticsearch] Index Template ๊ตฌ์„ฑํ•˜๊ธฐ with Kibana & Logstash (1) - Setting Elasticsearch์— ๋ฐ์ดํ„ฐ๋ฅผ ์ ์žฌํ•  ๋•Œ, ์–ด๋–ค ๋ฐฉ์‹์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ ์žฌํ• ์ง€์— ๋Œ€ํ•œ ์„ธํŒ…์„ ํ•ด์ค„ ์ˆ˜ ์žˆ๋‹ค. Elasticsearch๋Š” ์—ญ์ƒ‰์ธ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ธ๋ฑ์‹ฑํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ์—ญ์ƒ‰์ธ์˜ ๊ธฐ์ค€์ด ๋˜๋Š” ๋‹จ์–ด(token) dnai-deny.tistory.com ์ด์ „ ํฌ์ŠคํŒ…์— ์ด์–ด ์ด๋ฒˆ์—๋Š” Index Template์˜ ๋‘ ๋ฒˆ์งธ ์ฃผ์š” ๊ตฌ์„ฑ์ธ Mapping ์˜์—ญ์„ ์‚ดํŽด๋ณด๋„๋ก ํ•˜๊ฒ ๋‹ค. M..

    [Elasticsearch] Index Template ๊ตฌ์„ฑํ•˜๊ธฐ with Kibana & Logstash (1) - Setting

    Elasticsearch์— ๋ฐ์ดํ„ฐ๋ฅผ ์ ์žฌํ•  ๋•Œ, ์–ด๋–ค ๋ฐฉ์‹์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ ์žฌํ• ์ง€์— ๋Œ€ํ•œ ์„ธํŒ…์„ ํ•ด์ค„ ์ˆ˜ ์žˆ๋‹ค. Elasticsearch๋Š” ์—ญ์ƒ‰์ธ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ธ๋ฑ์‹ฑํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ์—ญ์ƒ‰์ธ์˜ ๊ธฐ์ค€์ด ๋˜๋Š” ๋‹จ์–ด(token)๋“ค์„ ์–ด๋–ป๊ฒŒ ํ† ํฐํ™”ํ•˜๋Š”์ง€์— ๋”ฐ๋ผ์„œ ๊ฒ€์ƒ‰์˜ ๊ฒฐ๊ณผ๋„ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ๋‹ค. ์ด๋ ‡๊ฒŒ Token์„ ์ƒ์„ฑํ•˜๋Š” ๊ทœ์น™์„ ๋‹ด์€ ์„ค์ •์„ Index Template๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค. Elasticsearch์˜ Index Template์€ ํฌ๊ฒŒ Setting์˜ ์˜์—ญ๊ณผ Mapping์˜ ์˜์—ญ์œผ๋กœ ๋‚˜๋ˆ„์–ด์ง„๋‹ค. ์˜ค๋Š˜์€ Setting์˜ ๊ตฌ์„ฑ์š”์†Œ์ธ Analyzer, Tokenizer, Filter์— ๋Œ€ํ•ด ์ด์•ผ๊ธฐํ•ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค! logstash์—์„œ elasticsearch๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋‚ด์ค„ ๋•Œ json ํ˜•ํƒœ๋กœ ๋ฏธ๋ฆฌ setting ..

    [Spring ์ž…๋ฌธ] 2. ์Šคํ”„๋ง ์›น ๊ฐœ๋ฐœ ๊ธฐ์ดˆ

    ์ •์  ์ปจํ…์ธ  = ํŒŒ์ผ์„ ๊ทธ๋Œ€๋กœ ๊ณ ๊ฐ์—๊ฒŒ ์ „๋‹ฌ MVC & ํ…œํ”Œ๋ฆฟ ์—”์ง„ = html์„ ์„œ๋ฒ„์—์„œ ๊ฐ€๊ณตํ•ด์„œ ๋™์  ์ปจํ…์ธ ๋กœ ์ „๋‹ฌ API = json ๋ฐ์ดํ„ฐ ํฌ๋งท์œผ๋กœ ํด๋ผ์ด์–ธํŠธ์— ๋ฐ์ดํ„ฐ ์ „๋‹ฌ Vue.js, React ๋“ฑ์—์„œ ์‚ฌ์šฉ ์„œ๋ฒ„๋ผ๋ฆฌ ํ†ต์‹ ํ•  ๋•Œ 1. ์ •์  ์ปจํ…์ธ  Spring boot๋Š” static/ ํด๋”์—์„œ ์ •์  ์ปจํ…์ธ ๋ฅผ ์ฐพ์•„์„œ ์‚ฌ์šฉํ•œ๋‹ค. ex) resources/static/hello-static.html ์ •์  ์ปจํ…์ธ  ์ž…๋‹ˆ๋‹ค. ํ๋ฆ„๋„ ์ฃผ์†Œ ์š”์ฒญ ๋ณด๋ƒ„ ํ†ฐ์บฃ ์„œ๋ฒ„์—์„œ ์ ‘์ˆ˜ ๋จผ์ € ์Šคํ”„๋ง ์ปจํ…Œ์ดํ„ฐ์—์„œ ์ปจํŠธ๋กค๋Ÿฌ ์žˆ๋Š”์ง€ ํ™•์ธ ์—†์œผ๋ฉด static ํ•˜์œ„์˜ ํŒŒ์ผ ์ฐพ์Œ ์žˆ์œผ๋ฉด ์›น ๋ธŒ๋ผ์šฐ์ €๋กœ ๋ฆฌํ„ดํ•ด์คŒ 2. MVC์™€ ํ…œํ”Œ๋ฆฟ ์—”์ง„ MVC = Model View Controller ๊ณผ๊ฑฐ view์™€ controller๊ฐ€ ๋‚˜๋ˆ„์–ด์ง€์ง€ ์•Š์•˜..