# aws/res architecture

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

- Interactive diagram: https://gitdiagram.com/aws/res
- Repository: https://github.com/aws/res

## Overview

##### Main Components

a. Frontend Layer:
- Web Portal (located in /idea-cluster-manager/webapp)
- React-based UI components
- Authentication interface

b. Backend Services:
- Cluster Manager Service
- Virtual Desktop Controller
- AD Sync Service
- Bastion Host Service
- Administrator Service

c. AWS Integration Layer:
- EC2 Integration (for virtual desktops)
- DCV Integration
- IAM/Security Components
- Directory Services
- Storage Services (EFS/FSx)

##### Key Architectural Patterns to Highlight

a. Microservices Architecture:
- Separate services as individual components
- Service boundaries
- Inter-service communication paths

b. Event-Driven Architecture:
- Event bus/message queue
- Event handlers and processors
- Demonstrate asynchronous workflows

##### Infrastructure Components

a. AWS Services:
- EC2 instances for virtual desktops
- DCV for remote desktop access
- Directory services
- Storage solutions
- Security groups and IAM roles

b. Network Layer:
- VPC configuration
- Subnet organization
- Security groups
- Load balancers

##### Specific Implementation Details

**[Client Layer]**

- ▼
**[API Gateway/Load Balancer]**

- ▼
**[Application Layer]**
- Web Portal (React)
- Authentication Service
- Cluster Manager
- Virtual Desktop Controller
- Administration Service

- ▼
**[Integration Layer]**
- AWS Service Clients
- Event Handlers
- Security Controls

- ▼
**[Infrastructure Layer]**
- EC2 Instances
- DCV Services
- Storage (EFS/FSx)
- Directory Services

##### Connection Types

Use different line styles:
- Bold lines: Primary user paths

##### Additional Elements

Include:
- Security boundaries
- Availability zones
- Auto-scaling groups
- Monitoring and logging components
- Backup and recovery paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef aws fill:#f1c40f,stroke:#f39c12,color:black
    classDef security fill:#e74c3c,stroke:#c0392b,color:white
    classDef storage fill:#9b59b6,stroke:#8e44ad,color:white
    classDef integration fill:#e67e22,stroke:#d35400,color:white

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        WebPortal["Web Portal (React)"]:::frontend
        AuthUI["Authentication UI"]:::frontend
    end

    %% API Gateway Layer
    APIGateway["API Gateway/Load Balancer"]:::integration

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        ClusterMgr["Cluster Manager Service"]:::backend
        VDController["Virtual Desktop Controller"]:::backend
        ADSync["AD Sync Service"]:::backend
        BastionHost["Bastion Host Service"]:::backend
        AdminService["Administrator Service"]:::backend
        AuthService["Authentication Service"]:::security
    end

    %% Integration Layer
    subgraph IntegrationLayer["Integration Layer"]
        AWSIntegration["AWS Service Clients"]:::integration
        EventHandlers["Event Handlers"]:::integration
        SecurityControls["Security Controls"]:::security
        DCVIntegration["DCV Integration"]:::integration
    end

    %% Infrastructure Layer
    subgraph InfraLayer["Infrastructure Layer"]
        EC2["EC2 Instances"]:::aws
        DCV["DCV Services"]:::aws
        Storage["Storage (EFS/FSx)"]:::storage
        DirectoryServices["Directory Services"]:::aws
    end

    %% Connections
    ClientLayer --> APIGateway
    APIGateway --> AppLayer
    ClusterMgr --> AWSIntegration
    VDController --> DCVIntegration
    ADSync --> DirectoryServices
    BastionHost --> EC2
    AdminService --> SecurityControls
    AuthService --> DirectoryServices
    AWSIntegration --> EC2
    DCVIntegration --> DCV
    EventHandlers --> Storage

    %% Click events
    click WebPortal "https://github.com/aws/res/tree/mainline//source/idea/idea-cluster-manager/webapp/"
    click ClusterMgr "https://github.com/aws/res/tree/mainline//source/idea/idea-cluster-manager/src/ideaclustermanager/"
    click VDController "https://github.com/aws/res/tree/mainline//source/idea/idea-virtual-desktop-controller/src/ideavirtualdesktopcontroller/"
    click ADSync "https://github.com/aws/res/tree/mainline//source/idea/ad-sync/src/adsync/"
    click BastionHost "https://github.com/aws/res/tree/mainline//source/idea/idea-bastion-host/src/ideabastionhost/"
    click AdminService "https://github.com/aws/res/tree/mainline//source/idea/idea-administrator/src/ideaadministrator/"
    click AWSIntegration "https://github.com/aws/res/tree/mainline//source/idea/idea-sdk/src/ideasdk/aws/"
    click AuthService "https://github.com/aws/res/tree/mainline//source/idea/idea-cluster-manager/src/ideaclustermanager/app/auth/"
    click DCVIntegration "https://github.com/aws/res/tree/mainline//source/idea/idea-virtual-desktop-controller/src/ideavirtualdesktopcontroller/app/clients/dcv_broker_client/"
    click DirectoryServices "https://github.com/aws/res/blob/mainline//source/idea/idea-administrator/src/ideaadministrator/app/cdk/constructs/directory_service.py"
    click Storage "https://github.com/aws/res/blob/mainline//source/idea/idea-administrator/src/ideaadministrator/app/cdk/constructs/storage.py"
    click APIGateway "https://github.com/aws/res/tree/mainline//source/idea/idea-cluster-manager/src/ideaclustermanager/app/api/"
```
