Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

アーキテクチャ

システム全体像

graph TB
    subgraph Client["📱 モバイルアプリ"]
        RN["React Native + Expo"]
    end

    subgraph Backend["🖥️ バックエンド"]
        API["REST API<br/>Spring Boot"]
        DB[(PostgreSQL)]
    end

    subgraph External["🌐 外部サービス"]
        ASR["Google Cloud<br/>Speech-to-Text"]
        AI["AI サービス<br/>Claude/GPT"]
        OAuth["Google OAuth"]
    end

    RN -->|HTTPS| API
    API --> DB
    API --> ASR
    API --> AI
    RN --> OAuth
    API --> OAuth

backend オニオンアーキテクチャ × DDD

バックエンドはオニオンアーキテクチャと**ドメイン駆動設計(DDD)**を採用しています。

graph TB
    subgraph Presentation["🎨 Presentation Layer"]
        Controller["Controller<br/>REST API"]
    end

    subgraph UseCase["⚙️ UseCase Layer"]
        UC["UseCase<br/>ビジネスロジック"]
    end

    subgraph Domain["💎 Domain Layer"]
        Entity["Entity"]
        Repo["Repository<br/>Interface"]
    end

    subgraph Infrastructure["🔧 Infrastructure Layer"]
        JPA["JPA Repository<br/>実装"]
        Client["外部API<br/>クライアント"]
    end

    Controller --> UC
    UC --> Entity
    UC --> Repo
    JPA -.->|implements| Repo
    Client --> ASR["Speech-to-Text"]

    style Domain fill:#ffd,stroke:#333

レイヤー責務

レイヤー責務依存
Domainエンティティ・ビジネスルールなし(純粋Kotlin)
UseCaseアプリケーション固有ロジックDomain のみ
PresentationREST API・DTO変換UseCase のみ
InfrastructureDB実装・外部APIDomain IF を実装

技術スタック

Backend

カテゴリ技術
言語Kotlin 2.0.21
フレームワークSpring Boot 3.4.12
ランタイムJDK 21 LTS
データベースPostgreSQL 16