# feathers-studio/hyperactive architecture

> Architecture diagram of the GitHub repository feathers-studio/hyperactive, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/feathers-studio/hyperactive
- Repository: https://github.com/feathers-studio/hyperactive

## Overview

##### Main Components Organization
The project consists of several key packages that should be represented as major components:

a) Core Components (Primary Layer):
- Hyper Package (/packages/hyper): The main rendering engine
- Serve Package (/packages/serve): Server-side functionality
- Blink Package (/packages/blink): Application framework
- Scripts Package (/packages/scripts): Build and generation utilities

##### Architectural Flow

**┌─ Hyperactive Suite ──────────────────────────────────┐**

- ┌─ Hyper Engine ─────┐    ┌─ Serve ────────────┐   │
- DOM Rendering    │◄──►│ - HTTP Server      │   │
- HTML Generation  │    │ - WebSocket        │   │
- Router          │    │ - EventSource      │   │
- ┬─┘    └──────────────────┬─┘   │

- ┌─ Blink ─────────┼─────────────────────────┼─┐   │
- Auth          │                         │ │   │
- Dashboard     │                         │ │   │
- Links         │                         │ │   │
- ┬┘                         │ │   │

- ┌─ Scripts ──────┼──────────────────────────┼─┘   │
- DOM Lib      │                          │     │
- Generators   │                          │     │
- ┬┘                          │     │
- ▼                           ▼     │
- ┘

##### Component Details

For each major component, include these elements:

Hyper Engine:
- Element management
- DOM utilities
- Rendering system (HTML & DOM)
- State management
- Routing capabilities

Serve Package:
- HTTP server functionality
- WebSocket support
- EventSource handling
- Method handlers

Blink Package:
- Authentication system
- Dashboard interface
- Link management
- Configuration handling
- Middleware system

Scripts Package:
- Build tools
- Code generators
- Utility functions

##### Data Flow Indicators

- Component dependencies
- Data flow between packages
- Build process flow
- Runtime interactions

##### Integration Points

Highlight:
- Package interconnections
- External system interfaces
- Build system integration
- Development tooling

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Hyperactive["Hyperactive Suite"]
        subgraph HyperEngine["Hyper Engine"]
            Core["Core Engine"]:::core
            DOMRender["DOM Rendering"]:::core
            HTMLGen["HTML Generation"]:::core
            Router["Router"]:::core
            ElementMgmt["Element Management"]:::core
            DOMUtils["DOM Utilities"]:::core
            StateMgmt["State Management"]:::core
        end

        subgraph ServePackage["Serve Package"]
            HTTPServer["HTTP Server"]:::server
            WebSocket["WebSocket Handler"]:::server
            EventSource["EventSource Handler"]:::server
            MethodHandlers["Method Handlers"]:::server
        end

        subgraph BlinkFramework["Blink Framework"]
            BlinkCore["Blink Core"]:::blink
            Auth["Authentication"]:::blink
            Dashboard["Dashboard Interface"]:::blink
            Links["Link Management"]:::blink
            Config["Configuration"]:::blink
            Store["Store Management"]:::blink
        end

        subgraph ScriptsPackage["Scripts Package"]
            BuildTools["Build Tools"]:::scripts
            DOMLib["DOM Library"]:::scripts
            Utils["Utility Functions"]:::scripts
        end
    end

    %% Relationships
    Core --> DOMRender
    Core --> HTMLGen
    Core --> Router
    Core --> ElementMgmt
    Core --> DOMUtils
    Core --> StateMgmt

    HTTPServer --> WebSocket
    HTTPServer --> EventSource
    HTTPServer --> MethodHandlers

    BlinkCore --> Auth
    BlinkCore --> Dashboard
    BlinkCore --> Links
    BlinkCore --> Config
    BlinkCore --> Store

    BuildTools --> DOMLib
    BuildTools --> Utils

    %% Cross-package relationships
    HyperEngine <--> ServePackage
    HyperEngine <--> BlinkFramework
    ServePackage <--> BlinkFramework
    ScriptsPackage --> HyperEngine
    ScriptsPackage --> BlinkFramework

    %% Styling
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef server fill:#2ecc71,stroke:#27ae60,color:white
    classDef blink fill:#e67e22,stroke:#d35400,color:white
    classDef scripts fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Click events
    click Core "https://github.com/feathers-studio/hyperactive/blob/dev/packages/hyper/src/index.ts"
    click DOMRender "https://github.com/feathers-studio/hyperactive/blob/dev/packages/hyper/src/render/dom.ts"
    click HTMLGen "https://github.com/feathers-studio/hyperactive/blob/dev/packages/hyper/src/render/html.ts"
    click Router "https://github.com/feathers-studio/hyperactive/blob/dev/packages/hyper/src/router.ts"
    click ElementMgmt "https://github.com/feathers-studio/hyperactive/blob/dev/packages/hyper/src/element.ts"
    click DOMUtils "https://github.com/feathers-studio/hyperactive/blob/dev/packages/hyper/src/domutils.ts"
    click StateMgmt "https://github.com/feathers-studio/hyperactive/blob/dev/packages/hyper/src/state.ts"
    click HTTPServer "https://github.com/feathers-studio/hyperactive/blob/dev/packages/serve/core.ts"
    click WebSocket "https://github.com/feathers-studio/hyperactive/blob/dev/packages/serve/ws.ts"
    click EventSource "https://github.com/feathers-studio/hyperactive/blob/dev/packages/serve/eventsource.ts"
    click MethodHandlers "https://github.com/feathers-studio/hyperactive/blob/dev/packages/serve/methods.ts"
    click BlinkCore "https://github.com/feathers-studio/hyperactive/blob/dev/packages/blink/src/index.ts"
    click Auth "https://github.com/feathers-studio/hyperactive/blob/dev/packages/blink/src/middleware/auth.ts"
    click Dashboard "https://github.com/feathers-studio/hyperactive/blob/dev/packages/blink/src/pages/dashboard.ts"
    click Links "https://github.com/feathers-studio/hyperactive/blob/dev/packages/blink/src/pages/links.ts"
    click Config "https://github.com/feathers-studio/hyperactive/blob/dev/packages/blink/src/config.ts"
    click Store "https://github.com/feathers-studio/hyperactive/blob/dev/packages/blink/src/store.ts"
    click BuildTools "https://github.com/feathers-studio/hyperactive/blob/dev/packages/scripts/gen.ts"
    click DOMLib "https://github.com/feathers-studio/hyperactive/blob/dev/packages/scripts/domlib.ts"
    click Utils "https://github.com/feathers-studio/hyperactive/blob/dev/packages/scripts/util/hypertyper.ts"
```
