Code Monkey home page Code Monkey logo

musicshop's Introduction

MusicShop

회사에서 주 언어가 타입스크립트와 고랭이다.

최근 프로젝트는 모두 타입스크립트와 nest.js를 이용해 구축해 왔는데 문득 코틀린이 하고 싶어졌다.

비동기 서버를 구축한다는 마인드로 다시 WebFlux를 꺼내들었다.

간만에 작업하다보니 시간가는줄 모르고 즐겁게 작업했는데 이 저장소는 다음과 같은 형식으로 진행될 것이다.

use Controller > use Functional Endpoint로 진행한다.

하지만 이 저장소는 이것이 최종 목표는 아니다.

코틀린으로 WebFlux를 사용할 때 스프링 공식 사이트에 보면 코루틴을 이용한 suspend 함수를 통해 구현하는게 최종 목표이다.

Going Reactive with Spring, Coroutines and Kotlin Flow

하지만 어떤 상황에서도 다룰 수 있어야 하기 때문에 이런 방식으로 빌드업을 할 생각이다.

Prerequisites

  • macOS M1
  • Kotlin 1.8.21 on Java 17
  • IDE: IntelliJ
  • Spring Boot 3.1.0 WebFlux
  • RDBMS: mySql v8.0.33
  • build: gradle v8.1.1

Spring Initializr를 통해서 필요한 라이브러리를 먼저 설정한다.

최종적으로 이 프로젝트에서 사용하는 것은 build.gradle.kts를 통해서 확인하면 된다.

Reactive Programming

먼저 우리가 하고자 하는 WebFlux를 다루고자 하기 전에 먼저 리액티브 프로그래밍에 대한 이해가 있어야 한다.

이 저장소에서 이것을 전부 커버하기에는 일단 나 자신이 명확하게 설명하기엔 능력 부족임을 먼저 인정할 수 밖에 없다.

다만 개인적으로 몇 년전부터 RxJavareactor project에 대해 관심을 가지면서 자연스럽게 접하게 된 경우이다.

이것을 이해하기 위해서는 디자인 패턴 중 The Observer Pattern, The Iterator Pattern애 대해 어느 정도 알면 좋다.

특히 The Observer Pattern은 에릭 마이어(Erik Meijer)에 정의된 리액티브 프로그래맹에 많은 영향을 줬다.

이와 관련 여러분에게 도움이 될 만한 사이트를 소개하고자 한다.

baeldung reactive programming

projectreactor official docs

우리가 먼저 인지해야 하는 것은 Publisher이다.

발행자에 대한 개념은 reactor project에서 Reactive StreamPublisher인터페이스를 구현하는 MonoFlux를 마주하게 된다.

여러분이 WebFlux를 간지나게 사용하고 싶다면 최소한 위 링크에서 projectreactor official docs는 필독하길 권장한다.

어쩌면 이것인 스프링 MVC 패턴에 비해서 러닝커브가 상당히 높아지는 이유가 되지 않을까?

Agenda

01-using-controller-musician

02-using-controller-record

03-using-functional-endpoints

04-using-controller-with-coroutine

05-using-functional-endpoints-with-coroutine

06-using-jooq-with-coroutine

07-using-querydsl-with-coroutine

08-webflux-with-jwt

09-webflux-with-security

스프링 시큐리티와 필터를 이용한 번외편

musicshop's People

Contributors

basquiat78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

revfactory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.