# jinwook94/bootme architecture

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

- Interactive diagram: https://gitdiagram.com/jinwook94/bootme
- Repository: https://github.com/jinwook94/bootme

## Overview

##### High-Level Architecture Components

a) Client Layer:
- React Frontend (frontend/)
- Admin Panel (admin/)

b) API Gateway/Load Balancer Layer:
- CloudFront distribution
- API routing

c) Application Layer:
- Backend Services (Spring Boot)
- Authentication Service
- Core Business Services

d) Data Layer:
- MariaDB
- Redis Cache
- Elasticsearch
- AWS S3 (for image storage)

##### Service Components

- Auth Service (auth/)
- Course Service (course/)
- Member Service (member/)
- Post Service (post/)
- Notification Service (notification/)
- Bookmark Service (bookmark/)
- Comment Service (comment/)
- Vote Service (vote/)
- Prompt Service (prompt/)
- Image Service (image/)

##### Infrastructure Components

AWS services:
- EC2 instances
- S3 buckets
- CloudFront
- CodeDeploy
- Secrets Manager

##### Connection Flows

- User requests → CloudFront → Frontend
- Frontend → API Gateway → Backend Services
- Service-to-service communication
- Services → Databases
- Authentication flows
- Event-driven communication (SSE)

##### Important Details

a) Security Layer:
- OAuth2 authentication flow
- JWT token handling
- API security

b) Caching Layer:
- Redis caching
- CloudFront caching

c) Search Functionality:
- Elasticsearch integration
- Full-text search capabilities

##### Environment Separation

- Production environment
- Staging environment
- Local development environment

##### Additional Elements

Supporting components:
- CI/CD pipeline flow
- Monitoring and logging
- Backup systems
- Error handling flow

##### Notes

Annotations for:
- Scalability points
- Security measures
- Performance optimizations
- Critical dependencies

Remember to highlight the microservices architecture pattern and the event-driven nature of certain components (like notifications and SSE). Also, emphasize the separation between the admin panel and main frontend application, as they serve different purposes but interact with the same backend services.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        Frontend["Frontend Application"]
        Admin["Admin Panel"]
    end
    click Frontend "https://github.com/Jinwook94/bootme/tree/main/frontend/"
    click Admin "https://github.com/Jinwook94/bootme/tree/main/admin/"

    %% API Gateway Layer
    subgraph GatewayLayer["API Gateway Layer"]
        CloudFront["AWS CloudFront"]
        APIGateway["API Gateway"]
    end

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        direction TB
        AuthService["Auth Service"]:::service
        CourseService["Course Service"]:::service
        MemberService["Member Service"]:::service
        PostService["Post Service"]:::service
        NotificationService["Notification Service"]:::service
        BookmarkService["Bookmark Service"]:::service
        CommentService["Comment Service"]:::service
        VoteService["Vote Service"]:::service
        PromptService["Prompt Service"]:::service
        ImageService["Image Service"]:::service
    end
    click AuthService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/auth/"
    click CourseService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/course/"
    click MemberService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/member/"
    click PostService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/post/"
    click NotificationService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/notification/"
    click BookmarkService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/bookmark/"
    click CommentService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/comment/"
    click VoteService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/vote/"
    click PromptService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/prompt/"
    click ImageService "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/image/"

    %% Data Layer
    subgraph DataLayer["Data Layer"]
        MariaDB[(MariaDB)]:::database
        Redis[(Redis Cache)]:::database
        Elasticsearch[(Elasticsearch)]:::database
        S3["AWS S3"]:::storage
    end
    click Redis "https://github.com/Jinwook94/bootme/blob/main/backend/src/main/java/com/bootme/config/RedisConfig.java"
    click Elasticsearch "https://github.com/Jinwook94/bootme/blob/main/backend/src/main/java/com/bootme/config/ElasticsearchConfig.java"
    click S3 "https://github.com/Jinwook94/bootme/blob/main/backend/src/main/java/com/bootme/config/S3Config.java"

    %% Infrastructure Layer
    subgraph InfraLayer["Infrastructure Layer"]
        EC2["EC2 Instances"]
        CodeDeploy["AWS CodeDeploy"]
        SecretsManager["AWS Secrets Manager"]
    end
    click SecretsManager "https://github.com/Jinwook94/bootme/blob/main/backend/src/main/java/com/bootme/config/AWSSecretsManagerConfig.java"

    %% Security Layer
    subgraph SecurityLayer["Security Layer"]
        TokenProvider["JWT Token Provider"]
        SecurityInterceptors["Security Interceptors"]
    end
    click TokenProvider "https://github.com/Jinwook94/bootme/blob/main/backend/src/main/java/com/bootme/auth/util/TokenProvider.java"
    click SecurityInterceptors "https://github.com/Jinwook94/bootme/tree/main/backend/src/main/java/com/bootme/common/interceptor/"

    %% Connections
    Frontend --> CloudFront
    Admin --> CloudFront
    CloudFront --> APIGateway
    APIGateway --> AppLayer
    AppLayer --> DataLayer
    AppLayer --> SecurityLayer
    SecurityLayer --> DataLayer

    %% Styles
    classDef service fill:#a8e6cf
    classDef database fill:#ffd3b6
    classDef storage fill:#ffaaa5
    classDef frontend fill:#dcedc1

    %% Legend
    subgraph Legend
        ServiceLegend["Service"]:::service
        DatabaseLegend[(Database)]:::database
        StorageLegend["Storage"]:::storage
        FrontendLegend["Frontend"]:::frontend
    end
```
