# shashankgupta10/nymbus architecture

> Architecture diagram of the GitHub repository shashankgupta10/nymbus, 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/shashankgupta10/nymbus
- Repository: https://github.com/shashankgupta10/nymbus

## Overview

##### High-Level Components

a) Frontend Layer:
- Sub-components:
- UI Components (from src/)
- Configuration Management (config.ts)
- Build System (Vite)

b) Backend Layer (Hexagonal Architecture):
1. External Layer (Adapters):
- HTTP Handlers
- Repository Implementations (Postgres)
2. Application Layer (Ports):
- Repository Interfaces
- Service Interfaces
3. Core Domain Layer:
- Project Domain Model
- Business Logic (Services)

c) Infrastructure:
- Database (PostgreSQL)
- Deployment Services (indicated by deploy.go)

##### Component Relationships

a) External Communications:
- Frontend → Backend (HTTP/REST)
- Backend → Database (Postgres adapter)

b) Internal Backend Flow:
- Handlers → Service Interfaces → Core Services
- Core Services → Repository Interfaces → Repository Implementations

##### Detailed Component Breakdown

Frontend Section:
**[Frontend Container]**
- UI Components (App.tsx, etc.)
- Configuration (config.ts)
- Build Tools (Vite, TypeScript, Tailwind)

Backend Section (Hexagonal Architecture):
**[Outer Layer - Adapters]**
- HTTP Handlers
- Postgres Repository

**[Middle Layer - Ports]**
- Repository Interfaces
- Service Interfaces

**[Core Layer]**
- Project Domain
- Deploy Service

##### Additional Elements

- Configuration Management:
- Config.go and its relationship to components
- Environment-specific configurations

- Utility Services:
- Logger
- Helpers

- Build & Development Tools:
- Air (Go hot-reload)
- Docker support

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI[UI Components]:::frontend
        Config[Configuration]:::frontend
        Build[Build System]:::frontend
    end

    subgraph "Backend (Hexagonal Architecture)"
        subgraph "External Layer (Adapters)"
            HTTPHandler[HTTP Handlers]:::adapter
            RepoImpl[Repository Implementation]:::adapter
        end

        subgraph "Application Layer (Ports)"
            RepoPort[Repository Interface]:::port
            ServicePort[Service Interface]:::port
        end

        subgraph "Core Layer"
            Domain[Project Domain Model]:::core
            DeployService[Deployment Service]:::core
        end

        MainApp[Main Application]:::core
        BackendConfig[Backend Configuration]:::core
    end

    subgraph Infrastructure
        DB[(PostgreSQL)]:::infra
        Logger[Logger Utility]:::util
        Helper[Helper Utility]:::util
    end

    %% Frontend Relationships
    UI --> Config
    Config --> Build

    %% External Communications
    UI --> HTTPHandler
    RepoImpl --> DB

    %% Internal Backend Flow
    MainApp --> HTTPHandler
    HTTPHandler --> ServicePort
    ServicePort --> DeployService
    DeployService --> RepoPort
    RepoPort --> RepoImpl
    Domain --> DeployService

    %% Configuration and Utilities
    BackendConfig --> MainApp
    Logger --> MainApp
    Helper --> MainApp

    %% Click Events
    click UI "https://github.com/ShashankGupta10/Nymbus/blob/main/frontend/src/App.tsx"
    click Config "https://github.com/ShashankGupta10/Nymbus/blob/main/frontend/src/config.ts"
    click Build "https://github.com/ShashankGupta10/Nymbus/blob/main/frontend/vite.config.ts"
    click HTTPHandler "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/internal/adapters/handlers/handler.go"
    click RepoImpl "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/internal/adapters/repository/postgres.go"
    click RepoPort "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/internal/core/ports/repository.go"
    click ServicePort "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/internal/core/ports/services.go"
    click Domain "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/internal/core/domain/project.go"
    click DeployService "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/internal/core/services/deploy.go"
    click BackendConfig "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/internal/config/config.go"
    click Logger "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/pkg/utils/logger.go"
    click Helper "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/pkg/utils/helper.go"
    click MainApp "https://github.com/ShashankGupta10/Nymbus/blob/main/backend/cmd/main.go"

    %% Styling
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef adapter fill:#4CAF50,stroke:#2E7D32,color:white
    classDef port fill:#FFC107,stroke:#FFA000,color:black
    classDef core fill:#FF5722,stroke:#E64A19,color:white
    classDef infra fill:#9E9E9E,stroke:#616161,color:white
    classDef util fill:#607D8B,stroke:#455A64,color:white

    %% Legend
    subgraph Legend
        Frontend_L[Frontend]:::frontend
        Adapter_L[Adapter]:::adapter
        Port_L[Port]:::port
        Core_L[Core]:::core
        Infra_L[Infrastructure]:::infra
        Util_L[Utility]:::util
    end
```
