# lou1svuong/actionx-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/lou1svuong/actionx-frontend
- Repository: https://github.com/lou1svuong/actionx-frontend

## Overview

##### Main System Components

a) Frontend Layer (Next.js Application):
- Sub-components:
- Pages/Routes (from src/app directory)
- UI Components (from src/components)
- Action Components (from src/api/Action)

b) API Layer:
- Action endpoints:
- Mint NFT API
- Transfer APT API
- Connection to external server (server.actionxapt.com)

c) Blockchain Integration:
- Wallet integration components
- Connection to Aptos blockchain (based on APT token references)

##### Component Relationships

a) User Interface Flow:

b) Data Flow:
- Wallet connection flow from UI to Blockchain

##### Detailed Component Breakdown

Specific elements:

a) Frontend Components:
- Action Management
- * ActionContainer
- * ActionDisplay
- * ActionLayout
- Wallet Integration
- * WalletProvider
- * AutoConnectProvider
- UI Components
- * Forms
- * Inputs
- * Buttons

b) Action System:
- Action Components
- * ButtonAction
- * FormAction
- * MultiValueAction
- * SingleValueAction
- Action Registry
- Action Config

##### Important Architectural Patterns to Highlight

- Next.js app router structure (src/app directory)
- Component abstraction pattern in Action system
- Demonstrate the provider pattern for wallet and theme management
- Separation of UI components and business logic

##### Integration Points

Integration points:
- Wallet connection interface
- API endpoints
- External service connections

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        Routes["Frontend Routes"]
        UI["UI Layer"]
        ActionSys["Action System"]
        
        subgraph UIComponents
            Input["Input Components"]:::ui
            Button["Button Components"]:::ui
            Forms["Form Elements"]:::ui
            WalletUI["Wallet UI"]:::ui
            ThemeComps["Theme Components"]:::ui
        end
        
        subgraph ActionComponents
            ActionReg["Action Registry"]:::action
            ActionConf["Action Config"]:::action
            BaseAction["Base Action Component"]:::action
            ActionComp["Action Components"]:::action
        end
        
        subgraph LayoutComponents
            ActionLayout["Action Layout"]:::layout
            ActionContainer["Action Container"]:::layout
            ActionDisplay["Action Display"]:::layout
        end
        
        subgraph LandingComponents
            Hero["Hero Section"]:::landing
            Features["Features Section"]:::landing
            FAQ["FAQ Section"]:::landing
        end
    end
    
    subgraph Integration
        WalletProvider["Wallet Provider"]:::web3
        AutoConnect["Auto Connect Provider"]:::web3
        ThemeProvider["Theme Provider"]:::theme
    end
    
    subgraph External
        API["Action API Server"]:::external
        Blockchain["Aptos Blockchain"]:::external
    end
    
    %% Relationships
    Routes --> ActionSys
    ActionSys --> ActionComponents
    UI --> UIComponents
    UIComponents --> ActionComponents
    ActionComponents --> Integration
    Integration --> External
    WalletProvider --> Blockchain
    
    %% Component Mappings
    click Routes "https://github.com/Lou1sVuong/ActionX-Frontend/tree/main/src/app/(action)"
    click ActionReg "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/api/ActionsRegistry.ts"
    click ActionConf "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/api/ActionConfig.ts"
    click ActionComp "https://github.com/Lou1sVuong/ActionX-Frontend/tree/main/src/api/Action/action-components"
    click BaseAction "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/api/Action/action-components/AbstractActionComponent.ts"
    click Input "https://github.com/Lou1sVuong/ActionX-Frontend/tree/main/src/components/ui/inputs"
    click Button "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/ui/button.tsx"
    click Forms "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/ui/inputs/ActionTextInput.tsx"
    click WalletProvider "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/WalletProvider.tsx"
    click AutoConnect "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/AutoConnectProvider.tsx"
    click WalletUI "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/ui/WalletSelector.tsx"
    click ActionLayout "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/ActionLayout.tsx"
    click ActionContainer "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/ActionContainer.tsx"
    click ActionDisplay "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/ActionDisplay.tsx"
    click ThemeProvider "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/theme-provider.tsx"
    click ThemeComps "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/components/ui/toggle-theme.tsx"
    click Hero "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/containers/landing/hero.tsx"
    click Features "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/containers/landing/features.tsx"
    click FAQ "https://github.com/Lou1sVuong/ActionX-Frontend/blob/main/src/containers/landing/FAQs.tsx"
    
    %% Styling
    classDef ui fill:#3498db
    classDef action fill:#2ecc71
    classDef layout fill:#9b59b6
    classDef landing fill:#e74c3c
    classDef web3 fill:#f39c12
    classDef external fill:#95a5a6
    classDef theme fill:#1abc9c
    
    %% Legend
    subgraph Legend
        UI_L["UI Components"]:::ui
        Action_L["Action Components"]:::action
        Layout_L["Layout Components"]:::layout
        Landing_L["Landing Components"]:::landing
        Web3_L["Web3 Integration"]:::web3
        External_L["External Services"]:::external
        Theme_L["Theme System"]:::theme
    end
```
