# git-eat/giteat architecture

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

- Interactive diagram: https://gitdiagram.com/git-eat/giteat
- Repository: https://github.com/git-eat/giteat

## Overview

##### Project type and purpose
- This is a full‑stack, microservice‑style web application.
- Purpose: An AI‑powered code‑review service (“GIT‑EAT”) integrated with GitLab, providing automated code feedback, notifications, dashboards, performance metrics, and secured via OAuth/JWT.

##### File‑structure analysis
- Top‑level separation into:
- frontend (React + Vite SPA)
- backend (five independent Spring Boot modules: ai, notification, report, rest, security)
- exec (deployment/CI‑CD docs, DB dumps)
- Each backend module contains its own build (Gradle), Dockerfile, application.properties, controllers/services/entities/repositories.
- The “rest” module exposes the main user‑facing API endpoints (PRs, repos, comments, stats, webhooks).
- The “security” module handles OAuth interception, JWT issuance, and secures all service calls.
- “ai” module runs an asynchronous daemon to generate AI reviews via GitLab and an LLM.
- “notification” module sends messages to external Mattermost.
- “report” module fetches and stores Lighthouse performance data.
- CI/CD artifacts: Dockerfiles in each module, Jenkins and NGINX configurations in exec/docs.

##### README insights
- OAuth login via GitLab.
- Webhook integration to sync MR events.
- Automatic AI review creation upon MR events.
- GitLab API integration for posting review comments.
- Data persistence in MySQL.
- Frontend dashboard, MR detail pages, performance measurement (Lighthouse).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers
    subgraph "Egress Layer"
        style EgressLayer fill:none,stroke:none
        BrowserSPA["Browser SPA"]:::frontend
        SPAServer["NGINX (Static Hosting)"]:::frontend
    end

    subgraph "Business Layer"
        style BusinessLayer fill:none,stroke:none
        SecurityService["Security Service"]:::backend
        CoreAPI["Core API Service"]:::backend
        AIService["AI Review Service"]:::backend
        NotificationService["Notification Service"]:::backend
        ReportService["Report Service"]:::backend
    end

    subgraph "Data Layer"
        style DataLayer fill:none,stroke:none
        DB[(MySQL Database)]:::database
    end

    subgraph "External Systems"
        style ExternalLayer fill:none,stroke:none
        GitLab["GitLab\n(OAuth & Webhooks)"]:::external
        Mattermost["Mattermost API"]:::external
        LLM["LLM API\n(OpenAI)"]:::external
    end

    %% Connections
    BrowserSPA -->|HTTPS| SPAServer
    SPAServer -->|TLS Offload| SecurityService
    SecurityService -->|Authenticate & JWT| CoreAPI
    BrowserSPA -->|API Calls| CoreAPI
    CoreAPI -->|CRUD| DB
    GitLab -->|Webhook POST /webhook| CoreAPI
    CoreAPI -->|Enqueue Review Job| AIService
    AIService -->|Review Request| LLM
    AIService -->|Store Review| DB
    CoreAPI -->|GET /review| CoreAPI
    CoreAPI -->|Trigger Notification| NotificationService
    NotificationService -->|POST Message| Mattermost
    CoreAPI -->|Dashboard Data| ReportService
    ReportService -->|Lighthouse Run| ReportService
    ReportService -->|Store Metrics| DB

    %% Click Events - Frontend
    click BrowserSPA "https://github.com/git-eat/giteat/tree/develop/frontend/"
    click SPAServer "https://github.com/git-eat/giteat/tree/develop/frontend/Dockerfile"

    %% Click Events - API Gateway
    click SPAServer "https://github.com/git-eat/giteat/blob/develop/exec/프로젝트 관련 문서/Nginx_(완).pdf"

    %% Click Events - Security Service
    click SecurityService "https://github.com/git-eat/giteat/tree/develop/backend/security/"
    click SecurityApp "https://github.com/git-eat/giteat/blob/develop/backend/security/src/main/java/com/giteat/security/SecurityApplication.java"
    click OauthInterceptor "https://github.com/git-eat/giteat/blob/develop/backend/security/src/main/java/com/giteat/security/interceptor/OauthInterceptor.java"
    click OAuthController "https://github.com/git-eat/giteat/blob/develop/backend/security/src/main/java/com/giteat/security/user/controller/OAuthController.java"

    %% Click Events - Core API Service
    click CoreAPI "https://github.com/git-eat/giteat/tree/develop/backend/rest/"
    click RestApp "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/GiteatApplication.java"
    click WebhookController "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/webHook/gitLab/controller/GitLabWebHookController.java"
    click PrController "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/pr/controller/PrController.java"
    click RepoController "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/repo/controller/RepoController.java"
    click ReviewController "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/review/ReviewController.java"
    click StatsController "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/statistics/controller/StatisticsRepoController.java"
    click UserController "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/user/controller/UserController.java"
    click JwtUtil "https://github.com/git-eat/giteat/blob/develop/backend/rest/src/main/java/com/giteat/common/jwt/JwtUtil.java"

    %% Click Events - AI Service
    click AIService "https://github.com/git-eat/giteat/tree/develop/backend/ai/"
    click AiApp "https://github.com/git-eat/giteat/blob/develop/backend/ai/src/main/java/com/giteat/ai/AiApplication.java"
    click AiDaemon "https://github.com/git-eat/giteat/blob/develop/backend/ai/src/main/java/com/giteat/ai/review/daemon/AiReviewDaemon.java"
    click GitLabApi "https://github.com/git-eat/giteat/blob/develop/backend/ai/src/main/java/com/giteat/ai/GitLabApi.java"

    %% Click Events - Notification Service
    click NotificationService "https://github.com/git-eat/giteat/tree/develop/backend/notification/"
    click NotificationApp "https://github.com/git-eat/giteat/blob/develop/backend/notification/src/main/java/com/giteat/notification/NotificationApplication.java"
    click NotificationDaemon "https://github.com/git-eat/giteat/blob/develop/backend/notification/src/main/java/com/giteat/notification/daemon/NotificationDaemon.java"
    click MatterMostApi "https://github.com/git-eat/giteat/blob/develop/backend/notification/src/main/java/com/giteat/notification/api/mm/MatterMostApi.java"

    %% Click Events - Report Service
    click ReportService "https://github.com/git-eat/giteat/tree/develop/backend/report/"
    click ReportApp "https://github.com/git-eat/giteat/blob/develop/backend/report/src/main/java/com/giteat/report/ReportApplication.java"
    click LighthouseController "https://github.com/git-eat/giteat/blob/develop/backend/report/src/main/java/com/giteat/report/Controller/LighthouseController.java"
    click LighthouseService "https://github.com/git-eat/giteat/blob/develop/backend/report/src/main/java/com/giteat/report/Service/LighthouseServiceImpl.java"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#66b0ff,color:#000
    classDef backend fill:#d4edda,stroke:#81c784,color:#000
    classDef database fill:#fff3cd,stroke:#ffeeba,color:#000
    classDef external fill:#f8d7da,stroke:#f5c6cb,color:#000
```
