# expend20/llvm-trans architecture

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

- Interactive diagram: https://gitdiagram.com/expend20/llvm-trans
- Repository: https://github.com/expend20/llvm-trans

## Overview

##### Main Components Identification
- Auth Service (authentication/authorization)
- Client Service (frontend application)
- LLVM Backend Service
- Notifier Service
- NATS (message broker)
- MongoDB (for auth service)
- Kubernetes Infrastructure

##### Specific Details

A. Client Service:
- Next.js frontend structure
- Theme switching capability
- Authentication flow
- Obfuscation interface

B. Auth Service:
- User model
- Authentication endpoints
- Password service
- MongoDB connection

C. LLVM Backend:
- Connection to obfuscation process
- Processing flow

D. Notifier:
- Event subscription points
- Notification flow

##### Infrastructure Details

- Kubernetes deployments
- Development vs production environments
- Ingress configurations
- NATS message broker connections

##### Additional Elements

- Environment separation (dev/prod)
- Security boundaries
- SSL termination points

##### Deployment Flow

A separate section showing:
- GitHub Actions workflows
- Deployment pipelines
- Environment-specific configurations

Remember to:
- Keep components proportional to their importance
- Use consistent styling for similar components
- Version/environment indicators
- Security boundaries clearly
- Scalable components
- Stateful vs stateless services

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef auth fill:#2ecc71,stroke:#27ae60,color:white
    classDef llvm fill:#f1c40f,stroke:#f39c12,color:black
    classDef notifier fill:#9b59b6,stroke:#8e44ad,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef database fill:#34495e,stroke:#2c3e50,color:white
    classDef deployment fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        Browser["🌐 Web Browser"]
        Client["Client Service"]:::frontend
        AuthPages["Auth Pages"]:::frontend
        ObfuscateUI["Obfuscation Interface"]:::frontend
        ContactForm["Contact Form"]:::frontend
        ThemeSystem["Theme System"]:::frontend
        APIClient["API Client"]:::frontend
    end

    %% Services Layer
    subgraph Services
        AuthService["Auth Service"]:::auth
        LLVMBackend["LLVM Backend"]:::llvm
        NotifierService["Notifier Service"]:::notifier
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        NATS["NATS Message Broker"]:::infra
        MongoDB[(MongoDB)]:::database
        K8s["Kubernetes Cluster"]:::infra
    end

    %% Deployment Layer
    subgraph Deployment
        GithubActions["GitHub Actions"]:::deployment
        DevEnv["Development Environment"]:::deployment
        ProdEnv["Production Environment"]:::deployment
    end

    %% Connections
    Browser --> Client
    Client --> AuthPages
    Client --> ObfuscateUI
    Client --> ContactForm
    Client --> ThemeSystem
    Client --> APIClient
    APIClient --> AuthService
    APIClient --> LLVMBackend
    AuthService --> MongoDB
    AuthService --> NATS
    LLVMBackend --> NATS
    NotifierService --> NATS
    GithubActions --> DevEnv
    GithubActions --> ProdEnv

    %% Click Events
    click AuthPages "https://github.com/expend20/llvm-trans/tree/master/client/pages/auth"
    click ObfuscateUI "https://github.com/expend20/llvm-trans/tree/master/client/pages/obfuscate"
    click ContactForm "https://github.com/expend20/llvm-trans/blob/master/client/components/ContactForm.js"
    click ThemeSystem "https://github.com/expend20/llvm-trans/blob/master/client/context/theme-context.js"
    click AuthService "https://github.com/expend20/llvm-trans/blob/master/auth/src/app.ts"
    click LLVMBackend "https://github.com/expend20/llvm-trans/blob/master/llvm-backend/src/index.ts"
    click NotifierService "https://github.com/expend20/llvm-trans/blob/master/notifier/src/index.ts"
    click NATS "https://github.com/expend20/llvm-trans/blob/master/infra/k8s/nats-depl.yaml"
    click MongoDB "https://github.com/expend20/llvm-trans/blob/master/infra/k8s/auth-mongo-depl.yaml"
    click K8s "https://github.com/expend20/llvm-trans/tree/master/infra/k8s"
    click DevEnv "https://github.com/expend20/llvm-trans/tree/master/infra/k8s-dev"
    click ProdEnv "https://github.com/expend20/llvm-trans/tree/master/infra/k8s-prod"
    click APIClient "https://github.com/expend20/llvm-trans/blob/master/client/api/build-client.js"

    %% Legend
    subgraph Legend
        Frontend_L["Frontend"]:::frontend
        Auth_L["Auth Service"]:::auth
        LLVM_L["LLVM Service"]:::llvm
        Notifier_L["Notifier"]:::notifier
        Infra_L["Infrastructure"]:::infra
        DB_L["Database"]:::database
        Deploy_L["Deployment"]:::deployment
    end
```
