# line/abc-user-feedback architecture

> Architecture diagram of the GitHub repository line/abc-user-feedback, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/line/abc-user-feedback
- Repository: https://github.com/line/abc-user-feedback

## Overview

##### Project type and purpose
- This is a monorepo for a full-stack VOC (Voice of Customer) management system called “ABC User Feedback.”
- It comprises:
- A Next.js web admin frontend (apps/web)
- A NestJS REST API backend (apps/api)
- A CLI tool (apps/cli) for spinning up local infra and orchestrating services
- Shared UI and utility packages (packages/ufb-react, ufb-shared, ufb-tailwindcss)
- End-to-end and integration test suites

##### File structure
- Top-level “apps” directory splits concerns:
- api – NestJS modules (common, domains, configs, shared, operation, scripts)
- web – Next.js pages, features, entities, widgets, server handlers
- cli – Infrastructure orchestration via Docker Compose templates
- “packages” holds reusable UI components, shared types, and TailwindCSS theming
- Root “docker” and workflows define container images, infra stacks (MySQL, OpenSearch, SMTP, optional S3)
- Test harnesses under apps/api/integration-test, apps/api/test, apps/e2e

##### README insights
- Monorepo powered by Turborepo (turbo.json)
- Dev workflow uses an “auf-cli” for init/start/stop commands
- Infra requirements: MySQL 8, OpenSearch 2.16, SMTP, S3
- Production images published to Docker Hub for web and api

##### Elements
- Labels for each component (e.g., “Next.js Frontend,” “NestJS API,” “MySQL DB”)
- Rectangles for application containers
- Clouds for external services
- Diamond or node symbols for the CLI/orchestrator

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Swimlanes as subgraphs
    subgraph "Developer Tooling" 
        CLI(["auf-cli CLI"]):::cli
        Compose(["Docker Compose"]):::infra
    end

    subgraph "Local Infrastructure Services"
        MySQL[(MySQL 8)]:::infra
        OpenSearch[(OpenSearch 2.16)]:::infra
        SMTP[(SMTP Mail Server)]:::infra
        S3[(Optional S3 Object Store)]:::infra
    end

    subgraph "Application Containers"
        Web["Next.js Frontend"]:::container
        API["NestJS API"]:::container
        subgraph "API Modules"
            Common["Common & Config"]:::module
            Domains["Domain Modules"]:::module
            Subscribers["Event Subscribers"]:::module
        end
    end

    subgraph "External Integrations"
        OAuth((OAuth Identity Provider)):::external
        IssueTracker((External Issue Tracker)):::external
        Webhooks((Outbound Webhooks)):::external
    end

    subgraph "Testing & CI/CD"
        IntTests["API Integration Tests"]:::test
        UnitTests["API Unit Tests"]:::test
        E2ETests["Web E2E Tests"]:::test
        CICD["CI/CD Workflows"]:::ci
    end

    %% Flows
    CLI -->|"starts"| Compose
    Compose --> MySQL
    Compose --> OpenSearch
    Compose --> SMTP
    Compose --> S3
    Compose --> Web
    Compose --> API

    Browser["Browser Client"]:::user -->|HTTP/HTTPS| Web
    Web -->|REST API Calls| API

    API -->|SQL Queries| MySQL
    API -->|Full-Text Search| OpenSearch
    API -->|SMTP Emails| SMTP
    API -->|S3 Operations| S3

    API -->|OAuth SSO| OAuth
    API -->|Issue-Tracker API| IssueTracker
    API -->|Webhook Events| Webhooks

    IntTests --> API
    UnitTests --> API
    E2ETests --> Web
    CICD -->|build/test/publish| Web
    CICD -->|build/test/publish| API

    %% Click Events
    click CLI "https://github.com/line/abc-user-feedback/blob/main/apps/cli/bin/auf-cli.ts"
    click Compose "https://github.com/line/abc-user-feedback/blob/main/docker/docker-compose.yml"
    click Compose "https://github.com/line/abc-user-feedback/blob/main/apps/cli/docker-compose.template.yml"
    click Web "https://github.com/line/abc-user-feedback/tree/main/apps/web"
    click API "https://github.com/line/abc-user-feedback/tree/main/apps/api"
    click OAuth "https://github.com/line/abc-user-feedback/blob/main/apps/api/src/domains/admin/auth/strategies/jwt.strategy.ts"
    click IssueTracker "https://github.com/line/abc-user-feedback/tree/main/apps/api/src/domains/admin/project/issue-tracker"
    click Subscribers "https://github.com/line/abc-user-feedback/tree/main/apps/api/src/domains/admin/history/subscribers"
    click IntTests "https://github.com/line/abc-user-feedback/tree/main/apps/api/integration-test"
    click UnitTests "https://github.com/line/abc-user-feedback/tree/main/apps/api/test"
    click E2ETests "https://github.com/line/abc-user-feedback/tree/main/apps/e2e"
    click CICD "https://github.com/line/abc-user-feedback/tree/main/.github/workflows"

    %% Styles
    classDef cli fill:#FFD700,shape:diamond
    classDef infra fill:#87CEEB,shape:cylinder
    classDef container fill:#98FB98,stroke:#2E8B57
    classDef module fill:#E6E6FA,stroke:#9370DB
    classDef external fill:#FFB6C1,shape:cloud
    classDef user fill:#F0E68C
    classDef test fill:#D3D3D3,stroke:#696969
    classDef ci fill:#FFA500,stroke:#FF8C00
```
