# team-tlog/tlog-was architecture

> Architecture diagram of the GitHub repository team-tlog/tlog-was, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/team-tlog/tlog-was
- Repository: https://github.com/team-tlog/tlog-was

## Overview

##### Project type and purpose
- Tlog-was is a Java Spring Boot backend monolith employing Domain-Driven Design (DDD). It exposes REST and WebSocket endpoints, integrates with multiple persistence stores, message broker, cache, and external services (SSO, FCM). There is no separate frontend in this repo.

##### File structure
- Top-level “tlog-was” directory is a single Spring Boot application.
- Inside “src/main/java/com/se/Tlog” you see:
- config (async, CORS, datasource, RabbitMQ, Redis, WebSocket, security, OpenAPI)
- domain (split into sub-packages: Admin, User, Travel, Course, Review, Notification, Search, Social, Team, Tbti, Reward, Wishlist)
- global (exception handling, response wrappers, security filters, JWT/Redis utilities)
- Persistence layers: JPA (relational DB) and Mongo (for travel, course, review, search, post, wishlist).
- Messaging: RabbitMQ for chat.
- Caching: Redis.
- External APIs: Google/Kakao SSO, FCM.

##### README
- Focuses on branch/commit conventions.

##### Detail and essential elements
- Persistence choices and external integrations.
- Inter-module service calls only where cross-module interactions exist (e.g., Wishlist → Travel, Review → Course).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Git Branches
    main["main"]:::external
    develop["develop"]:::external
    main --> SpringApp
    develop --> SpringApp

    %% Spring Boot Application
    subgraph "Spring Boot Application" 
        SpringApp["TlogApplication"]:::infra
        %% API Layer
        Controllers["API Layer\n(Controllers & WebSocket)"]:::infra
        %% Domain Modules
        subgraph "Domain Modules" 
            User["User"]:::domain
            Travel["Travel"]:::domain
            Course["Course"]:::domain
            Review["Review"]:::domain
            Notification["Notification"]:::domain
            Social["Social"]:::domain
            Team["Team"]:::domain
            Tbti["Tbti"]:::domain
            Reward["Reward"]:::domain
            Search["Search"]:::domain
            Wishlist["Wishlist"]:::domain
            Admin["Admin"]:::domain
        end
        %% Global Cross-Cutting
        Global["Global Services\n(JWT, Exception, RedisUtil)"]:::global
    end

    %% Infrastructure & External
    subgraph "Infrastructure"
        RDB["Relational DB (JPA)"]:::infra
        MongoDB["MongoDB"]:::infra
        RedisCache["Redis"]:::infra
        RabbitMQ["RabbitMQ"]:::infra
    end

    subgraph "External Services"
        SSO["SSO Providers\n(Google, Kakao)"]:::external
        FCM["FCM Push Notifications"]:::external
        ObjStorage["Object Storage"]:::external
        ChatClient["Chat Client\n(WebSocket)"]:::external
    end

    %% Core Flows
    Controllers -->|"REST/WebSocket"| User
    Controllers -->|"REST/WebSocket"| Travel
    Controllers -->|"REST/WebSocket"| Course
    Controllers -->|"REST/WebSocket"| Review
    Controllers -->|"REST/WebSocket"| Notification
    Controllers -->|"REST/WebSocket"| Social
    Controllers -->|"REST/WebSocket"| Team
    Controllers -->|"REST/WebSocket"| Tbti
    Controllers -->|"REST/WebSocket"| Reward
    Controllers -->|"REST/WebSocket"| Search
    Controllers -->|"REST/WebSocket"| Wishlist
    Controllers -->|"REST/WebSocket"| Admin

    %% Persistence Connections
    User -->|"JPA"| RDB
    Team -->|"JPA"| RDB
    Reward -->|"JPA"| RDB
    Admin -->|"JPA"| RDB
    Notification -->|"JPA"| RDB

    Travel -->|"Mongo"| MongoDB
    Course -->|"Mongo"| MongoDB
    Review -->|"Mongo"| MongoDB
    Search -->|"Mongo"| MongoDB
    Social -->|"Mongo"| MongoDB
    Wishlist -->|"Mongo"| MongoDB

    %% Messaging Chat Flow
    Social -->|"AMQP"| RabbitMQ
    RabbitMQ -->|"AMQP"| Social
    Social -->|"WebSocket/STOMP"| ChatClient

    %% Caching & Utils
    Global -->|"Redis"| RedisCache
    Global -->|"Thread Pools"| RedisCache

    %% External Integrations
    User -->|"OAuth2"| SSO
    Notification -->|"FCM API"| FCM
    Global -->|"Upload"| ObjStorage

    %% Inter-Module Interactions
    Wishlist -->|"calls"| Travel
    Review -->|"uses"| Course
    Search -->|"indexes"| Travel
    Search -->|"indexes"| Social
    Team -->|"shares"| User
    Reward -->|"links"| User
    Tbti -->|"links"| User
    Admin -->|"workflows"| Travel

    %% Click Events
    click SpringApp "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/TlogApplication.java"
    click Controllers "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/config/websocket/WebSocketConfig.java"
    click User "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/User"
    click Travel "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Travel"
    click Course "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Course"
    click Review "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Review"
    click Notification "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Notification"
    click Social "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Social"
    click Team "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Team"
    click Tbti "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Tbti"
    click Reward "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Reward"
    click Search "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Search"
    click Wishlist "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Wishlist"
    click Admin "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/domain/Admin"
    click RDB "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/config/datasource/DataSourceConfig.java"
    click MongoDB "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/config/datasource/DataSourceConfig.java"
    click RedisCache "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/config/redis/RedisConfig.java"
    click RabbitMQ "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/config/rabbitmq/RabbitConfig.java"
    click Global "https://github.com/team-tlog/tlog-was/tree/develop/tlog-was/src/main/java/com/se/Tlog/global"
    click SSO "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/config/security/SsoServiceConfig.java"
    click FCM "https://github.com/team-tlog/tlog-was/blob/develop/tlog-was/src/main/java/com/se/Tlog/domain/Notification/application/NotificationService.java"

    %% Styles
    classDef domain fill:#a2d5c6,stroke:#2d3436
    classDef infra fill:#74b9ff,stroke:#2d3436
    classDef external fill:#fdcb6e,stroke:#2d3436
    classDef global fill:#dfe6e9,stroke:#2d3436
```
