simple-boot

A powerful and flexible framework for backend and service development

백엔드와 서비스 개발을 위한 강력하고 유연한 프레임워크

GitHubNPM

Installation

Install the package with your preferred package manager

선호하는 패키지 매니저로 패키지를 설치하세요

Demo example

DEMO EXAMPLE

데모 예제

Architecture Overview

Understanding simple-boot's enterprise-ready backend framework architecture

simple-boot의 엔터프라이즈급 백엔드 프레임워크 아키텍처 이해하기

Core Architecture

simple-boot provides DI container, AOP, routing, and event-driven architecture

simple-boot는 DI 컨테이너, AOP, 라우팅, 이벤트 기반 아키텍처를 제공합니다

graph TB
    A[SimpleApplication] -->|Initialize| B[SimstanceManager]
    A -->|Initialize| C[RouterManager]
    A -->|Initialize| D[IntentManager]
    
    B -->|Manage| E[Singleton Instances]
    B -->|Manage| F[Transient Instances]
    B -->|Inject| G[Dependencies]
    
    C -->|Register| H[Router Classes]
    C -->|Map| I[Route Methods]
    
    D -->|Publish| J[Intent Events]
    D -->|Subscribe| K[Event Handlers]
    
    L[Sim Decorator] -->|Register| B
    M[Cache Decorator] -->|Cache Results| N[CacheManager]
    O[ExceptionHandler] -->|Handle Errors| P[Global Error Handler]
    
    style A fill:#e1f5ff
    style B fill:#fff4e6
    style C fill:#f3e8ff
    style D fill:#dcfce7
    style L fill:#fef3c7
    linkStyle default stroke:#aaaaaa,stroke-width:2px

Dependency Injection Flow

How @Sim decorator manages object lifecycles and dependencies

@Sim 데코레이터가 객체 생명주기와 의존성을 관리하는 방식

sequenceDiagram
    participant App as SimpleApplication
    participant SM as SimstanceManager
    participant Class as @Sim Class
    participant Deps as Dependencies

    App->>SM: run()
    SM->>SM: Scan @Sim decorators
    SM->>Class: Check metadata
    Class->>SM: Return config (scope, symbols)
    
    alt Singleton
        SM->>Class: Create instance (once)
        SM->>SM: Store in container
    else Transient
        Note over SM: Create on each request
    end
    
    SM->>Deps: Resolve dependencies
    Deps->>SM: Inject into constructor
    SM->>Class: Initialize with deps
    Class-->>App: Ready to use

Routing System

Request routing with @Router and @Route decorators

@Router와 @Route 데코레이터를 통한 요청 라우팅

sequenceDiagram
    participant Client
    participant RM as RouterManager
    participant Controller as @Router Class
    participant Method as @Route Method
    participant Service as Injected Service

    Client->>RM: Request /api/users/123
    RM->>RM: Parse path & params
    RM->>Controller: Find matching @Router
    Controller->>Method: Find matching @Route
    Method->>Service: Call business logic
    Service->>Service: Process data
    Service-->>Method: Return result
    Method-->>Controller: Format response
    Controller-->>RM: Return response
    RM-->>Client: Send response

Intent Event System

Decoupled component communication via publish-subscribe pattern

발행-구독 패턴을 통한 컴포넌트 간 분리된 통신

graph LR
    A[Publisher Service] -->|Intent.publish| B[IntentManager]
    B -->|Route by URI| C[Subscriber 1]
    B -->|Route by Symbol| D[Subscriber 2]
    B -->|Route by Scheme| E[Subscriber 3]
    
    F[UserService] -->|user:created| B
    B -->|Notify| G[EmailService]
    B -->|Notify| H[AnalyticsService]
    B -->|Notify| I[NotificationService]
    
    style A fill:#dbeafe
    style B fill:#fef3c7
    style C fill:#dcfce7
    style D fill:#dcfce7
    style E fill:#dcfce7
    linkStyle default stroke:#aaaaaa,stroke-width:2px

Getting Started

Quick start with basic examples

기본 예제로 빠르게 시작하기

Basic Application Setup

Create a SimpleApplication and register services

SimpleApplication 생성 및 서비스 등록

Dependency Injection

Manage object lifecycles with powerful DI container

강력한 DI 컨테이너로 객체 생명주기 관리

@Sim Decorator - Singleton Pattern

@Sim creates singleton instances by default - same instance returned every time

@Sim은 기본적으로 싱글톤 인스턴스를 생성 - 항상 동일한 인스턴스 반환

Transient Lifecycle

Create new instance on each request with Lifecycle.Transient

Lifecycle.Transient로 각 요청마다 새 인스턴스 생성

Constructor Injection

Automatically inject dependencies via constructor parameters

생성자 매개변수를 통해 자동으로 의존성 주입

Symbol-based Registration

Register services with symbols for interface-based programming

인터페이스 기반 프로그래밍을 위한 심볼로 서비스 등록

Routing System

Map URL paths to controller classes and methods

URL 경로를 컨트롤러 클래스와 메서드에 매핑

@Router & @Route Decorators

Create RESTful routes with path parameters

경로 매개변수로 RESTful 라우트 생성

Method Caching

Cache expensive operations with @Cache decorator

@Cache 데코레이터로 비용이 큰 작업 캐싱

@Cache Decorator

Automatically cache method results with custom keys and TTL

커스텀 키와 TTL로 자동으로 메서드 결과 캐싱

Intent Event System

Decouple components with publish-subscribe pattern

발행-구독 패턴으로 컴포넌트 분리

Publishing and Subscribing to Events

Event-based communication between services

서비스 간 이벤트 기반 통신

Real-world Use Case

Decoupled microservices communication example

분리된 마이크로서비스 통신 예제

Alert System

Manage alerts with AlertService and AlertFactory

AlertService와 AlertFactory로 알림 관리

Alert Types & Architecture

Built-in alert system for notifications and messages

알림 및 메시지를 위한 내장 알림 시스템