# baptistelechat/aura architecture

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

- Interactive diagram: https://gitdiagram.com/baptistelechat/aura
- Repository: https://github.com/baptistelechat/aura

## Overview

##### Project Type Analysis
This is a Next.js-based web application with a focus on image generation and manipulation. It's a full-stack application using modern web technologies, with particular emphasis on client-side features.

##### Main Architectural Components

a) Frontend Layer:
- Next.js Application (Core)
- UI Components Layer
- Feature Modules
- Image Generator
- Screen Recorder
- State Management
- Utility Services

b) API Layer:
- Image Conversion API
- External Image Services Integration
- Unsplash API
- Pixabay API
- OG Image Generation

c) Static Assets:
- Public Resources
- Image Assets
- Fonts

**┌─────────────────────────────────────────────────────────────┐**
- Client Browser                          │
- ┬─────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────────────┐**
- Next.js Application                     │
- ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐ │
- Pages    │  │   Layout    │  │  Global Components  │ │
- ┘  └─────────────┘  └─────────────────────┘ │

- ┌─────────────────────┐  ┌───────────────────────────────┐│
- Feature Modules    │  │      Utility Services         ││
- Screen Recorder   │  │ - Image Processing            ││
- ┘  │ - Hotkey Management          ││
- ┘│
- ┬─────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────────────┐**
- API Layer                           │
- ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐ │
- Image Convert│  │  External   │  │    OG Image Gen     │ │
- API      │  │   APIs      │  │                     │ │
- ┘  └─────────────┘  └─────────────────────┘ │
- ┘

##### Key Relationships to Highlight
- Client-Server interaction
- API integration points
- Component hierarchy
- Data flow patterns
- State management connections

##### Implementation Details

- Next.js app router architecture
- Component organization (/components, /app structure)
- API routes under /api
- Integration with external services
- Static asset management
- State management using store files
- Utility functions organization

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Browser"]
        Browser
    end

    subgraph NextApp["Next.js Application"]
        Core["Next.js Core"]:::core
        click Core "https://github.com/baptistelechat/aura/tree/main/src/app"
        
        subgraph Components["Components Layer"]
            UI["UI Components"]:::ui
            click UI "https://github.com/baptistelechat/aura/tree/main/src/components/ui"
            GlobalComps["Global Components"]:::ui
        end
        
        subgraph Features["Feature Modules"]
            ImageGen["Image Generator"]:::feature
            click ImageGen "https://github.com/baptistelechat/aura/tree/main/src/app/image-generator"
            ScreenRec["Screen Recorder"]:::feature
            click ScreenRec "https://github.com/baptistelechat/aura/tree/main/src/app/screen-recorder"
        end
        
        subgraph State["State Management"]
            ImageStore["Image Generator Store"]:::state
            click ImageStore "https://github.com/baptistelechat/aura/blob/main/src/lib/store/imageGenerator.store.ts"
        end
        
        subgraph Utils["Utility Services"]
            ColorUtils["Color Utils"]:::util
            click ColorUtils "https://github.com/baptistelechat/aura/tree/main/src/lib/utils/colors"
            ImageProc["Image Processing"]:::util
            click ImageProc "https://github.com/baptistelechat/aura/tree/main/src/lib/utils/image-generator"
            HotkeyMgmt["Hotkey Management"]:::util
            click HotkeyMgmt "https://github.com/baptistelechat/aura/tree/main/src/lib/utils/hotkey"
        end
    end
    
    subgraph APILayer["API Layer"]
        ImageConvert["Image Conversion API"]:::api
        click ImageConvert "https://github.com/baptistelechat/aura/blob/main/src/app/api/convert-image/route.ts"
        
        subgraph ExtAPIs["External Image Services"]
            UnsplashAPI["Unsplash API"]:::external
            click UnsplashAPI "https://github.com/baptistelechat/aura/blob/main/src/app/api/images/unsplash/route.ts"
            PixabayAPI["Pixabay API"]:::external
            click PixabayAPI "https://github.com/baptistelechat/aura/blob/main/src/app/api/images/pixabay/route.ts"
        end
        
        OGImage["OG Image Generation"]:::api
        click OGImage "https://github.com/baptistelechat/aura/blob/main/src/app/api/og/route.tsx"
    end
    
    subgraph Static["Static Assets"]
        Fonts["Fonts"]:::static
        click Fonts "https://github.com/baptistelechat/aura/tree/main/public/fonts"
        Images["Image Assets"]:::static
        click Images "https://github.com/baptistelechat/aura/tree/main/public/images"
        Patterns["Patterns"]:::static
        click Patterns "https://github.com/baptistelechat/aura/tree/main/public/images/patterns"
        Overlays["Overlays"]:::static
        click Overlays "https://github.com/baptistelechat/aura/tree/main/public/images/overlays"
    end
    
    %% Connections
    Browser --> Core
    Core --> Components
    Core --> Features
    Features --> State
    Features --> Utils
    Features --> APILayer
    ImageGen --> ImageConvert
    ImageGen --> ExtAPIs
    Core --> Static
    
    %% Styles
    classDef core fill:#2563eb,color:white
    classDef ui fill:#3b82f6,color:white
    classDef feature fill:#0891b2,color:white
    classDef state fill:#7c3aed,color:white
    classDef util fill:#6366f1,color:white
    classDef api fill:#059669,color:white
    classDef external fill:#ea580c,color:white
    classDef static fill:#71717a,color:white
    
    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["UI Elements"]:::ui
        L3["Feature Modules"]:::feature
        L4["State Management"]:::state
        L5["Utilities"]:::util
        L6["Internal APIs"]:::api
        L7["External Services"]:::external
        L8["Static Resources"]:::static
    end
```
