Back to .md Directory

New Aeon Magic Apps v2.2 - Complete Documentation

Documents a React + TypeScript creative suite that uses Google Gemini 2.5 Flash for AI image editing, offer design, story animation, and audio integration.

May 2, 2026
0 downloads
1 views
ai rag prompt gemini
View source

What this file does

Documents a React + TypeScript creative suite that uses Google Gemini 2.5 Flash for AI image editing, offer design, story animation, and audio integration.

When to use it

  • Building an AI-powered social media content creator
  • Integrating Gemini API for image editing and copy generation
  • Implementing canvas-based video animation with audio sync
  • Creating a project management system with localStorage persistence

Assumes this stack

React 19.2TypeScriptGoogle Gemini 2.5 FlashVite 6.2Tailwind CSShtml-to-image

New Aeon Magic Apps v2.2 - Complete Documentation

<div align="center">

AI-Powered Creative Suite for Social Media Content

Built with React 19.2 + TypeScript + Google Gemini 2.5 Flash

Live App | GitHub Repository

</div>

Table of Contents

  1. Overview
  2. Features
  3. Installation
  4. Architecture
  5. Components Reference
  6. API Reference
  7. Configuration
  8. Usage Guide
  9. Data Storage
  10. Export Capabilities

Overview

New Aeon Magic Apps is an all-in-one AI creative suite designed for social media content creation. It combines AI-powered image editing, professional offer design, cinematic story animation, and audio integration into a single web application.

Key Capabilities

ModuleDescriptionAI-Powered
AI Image StudioEdit images using natural language promptsGemini 2.5 Flash
Story AnimatorCreate cinematic video animations from static imagesCanvas-based
Offer CreatorDesign professional retail offers and promotionsGemini 2.5 Flash
Audio EngineAdd royalty-free music to your creationsLibrary + Upload

Tech Stack

  • Frontend: React 19.2, TypeScript, Tailwind CSS
  • Build Tool: Vite 6.2
  • AI Engine: Google Gemini 2.5 Flash API
  • Icons: Lucide React
  • Export: html-to-image, MediaRecorder API

Features

1. AI Image Studio

Transform images using natural language prompts powered by Google Gemini 2.5 Flash.

Capabilities:

  • Magic Prompt Editing: Describe changes in plain English
    • "Add fireworks to the background"
    • "Apply vintage filter"
    • "Remove background"
    • "Make it cyberpunk style"
  • Smart Text Extraction: Automatically detect and extract text from images with bounding box coordinates
  • Background Cleaning: Remove text while intelligently filling the background
  • Image Sources: Drag & drop upload, URL import, history selection

Supported Formats: JPEG, PNG


2. Story Animator

Create cinematic animations from static images with 14 professional camera movements.

Animation Types:

AnimationEffectBest For
ZOOM_INGradual zoom towards centerDramatic reveals
ZOOM_OUTPull back from centerContext reveals
PAN_LEFT_RIGHTHorizontal sweep left to rightPanoramic views
PAN_RIGHT_LEFTHorizontal sweep right to leftAlternative pans
PAN_TOP_BOTTOMVertical sweep top to bottomTall subjects
PAN_BOTTOM_TOPVertical sweep bottom to topBuilding reveals
ZOOM_ROTATECombined zoom with rotationDynamic energy
BREATHESubtle scaling pulseMinimal style
FADEOpacity transitionSmooth intros
PARALLAXMulti-layer depth effect3D feel
TILTRotational tiltArtistic angle
POPQuick scale burstHype/energy

Animation Presets:

PresetAnimationDurationStyle
CinematicZOOM_IN10sSlow, elegant
Hype/PopPOP5sFast, energetic
ShowcasePAN_LEFT_RIGHT7sPanoramic
MinimalBREATHE7sSubtle
DynamicZOOM_ROTATE5sActive

Text Overlays:

  • 9 position options (top/middle/bottom + left/center/right)
  • Text effects: Typewriter, Fade Up
  • 5 font families: Inter, Playfair Display, Montserrat, Roboto Mono, Permanent Marker
  • Customizable colors and sizes

Video Export:

  • Format: MP4/WebM (9:16 vertical)
  • Resolution: Standard (1x) or High Quality (2x)
  • Audio sync included
  • Duration: 5-15 seconds configurable

3. Offer Creator

Design professional retail offers with AI-generated copywriting.

Template Library:

TemplateStyleBest For
Modern MinimalClean, serif typographyLuxury brands
Bold SaleHigh contrast, sans-serifFlash sales
Fashion EditorialMinimal text, artisticFashion/lifestyle
Custom UploadUser backgroundFull customization

Output Sizes:

SizeDimensionsPlatform
Square (1:1)1080 x 1080 pxInstagram Feed
Story (9:16)1080 x 1920 pxInstagram/FB Stories
Reel (9:16)1080 x 1920 pxTikTok/Reels (safe zones)

AI Copywriting:

  • Headlines: Max 8 words, attention-grabbing
  • Subheadlines: Max 12 words, supporting message
  • CTAs: Max 3 words, action-oriented
  • Tone Variants: Standard, Urgent, Luxury, Minimalist

Product Information:

  • Product name and SKU
  • Original and sale prices
  • Currency support: USD ($), EUR (€), GBP (£), JPY (¥)

4. Audio Engine

Add professional audio to your story animations.

Royalty-Free Library (6 tracks):

TrackCategoryDuration
SentinelCinematic2:45
Driven To SuccessUplifting2:20
Star LingAmbient3:05
EnthusiastEnergetic2:15
ElipsLo-Fi2:40
HomeroadAmbient3:10

Categories: Cinematic, Uplifting, Ambient, Energetic, Lo-Fi

Features:

  • Search and filter by category
  • Preview playback before selection
  • Custom MP3 upload support
  • Automatic audio-video sync

5. Brand Kit System

Maintain consistent branding across all designs.

Customizable Elements:

{
  primaryColor: "#hex",      // Main brand color
  secondaryColor: "#hex",    // Supporting color
  accentColor: "#hex",       // Highlight color
  primaryFont: "fontname",   // Headlines
  secondaryFont: "fontname", // Body text
  defaultBorderRadius: "none" | "sm" | "md" | "lg" | "full",
  defaultShadow: "none" | "soft" | "strong"
}

Available Fonts:

  • Inter (Modern sans-serif)
  • Playfair Display (Elegant serif)
  • Montserrat (Bold sans-serif)
  • Roboto Mono (Technical)
  • Permanent Marker (Handwritten)

6. Project Management

Save and restore your work sessions.

Capabilities:

  • Save complete project state
  • Load previous projects
  • Delete unwanted projects
  • Timestamped project list

Saved Data:

  • Product information
  • Selected template and size
  • Generated copy
  • Brand kit settings
  • Social media content

7. Social Content Generator

AI-generated captions and hashtags for social media.

Output:

  • Captions: 2-3 sentences with emojis
  • Hashtags: 5-10 relevant tags

Installation

Prerequisites

  • Node.js (v18+ recommended)
  • Google Gemini API Key

Quick Start

# Clone the repository
git clone https://github.com/Ibrahim-newaeon/Magic-tool.git
cd Magic-tool

# Install dependencies
npm install

# Configure API key
echo "GEMINI_API_KEY=your_api_key_here" > .env.local

# Start development server
npm run dev

Available Scripts

CommandDescription
npm run devStart development server (port 3000)
npm run buildBuild for production
npm run previewPreview production build

Architecture

Project Structure

Magic-tool/
├── App.tsx                    # Main application (state management)
├── index.tsx                  # React entry point
├── index.html                 # HTML template
├── types.ts                   # Core type definitions
│
├── components/
│   ├── ImageUpload.tsx        # Image source selector
│   ├── StoryViewer.tsx        # Animation engine
│   ├── OfferCreator.tsx       # Offer workflow
│   ├── OfferPreview.tsx       # Offer rendering
│   ├── OfferCanvas.tsx        # Canvas renderer
│   ├── MusicSelector.tsx      # Audio library
│   ├── Wizard.tsx             # Onboarding flow
│   ├── BrandSettings.tsx      # Brand kit UI
│   ├── ProjectLibrary.tsx     # Project management
│   ├── ProductForm.tsx        # Product inputs
│   └── Button.tsx             # Reusable button
│
├── services/
│   └── geminiService.ts       # Gemini API integration
│
├── types/
│   ├── offerTemplate.ts       # Offer type definitions
│   └── storyTypes.ts          # Animation types
│
├── templates/
│   └── offerTemplates.ts      # Template definitions
│
├── data/
│   └── templates.ts           # Fallback templates
│
└── config files...

Data Flow

User Action → React State (App.tsx)
     ↓
Component Update → AI Service Call (if needed)
     ↓
Canvas/DOM Render → Export (PNG/MP4)
     ↓
localStorage (persistence)

State Management

All state is managed in App.tsx using React hooks:

  • Image State: sourceImage, generatedImage, imageHistory
  • Text State: customText, fontFamily, textColor, textPosition
  • Audio State: audioUrl, audioFileName, isPlaying
  • Offer State: selectedTemplate, productInfo, offerCopy, brandKit
  • UI State: activeTab, showWizard, isGenerating, error

Components Reference

Core Components

ComponentFilePurposeSize
AppApp.tsxMain orchestrator38KB
StoryViewercomponents/StoryViewer.tsxAnimation & export24KB
OfferCreatorcomponents/OfferCreator.tsxOffer workflow19KB
OfferPreviewcomponents/OfferPreview.tsxOffer rendering15KB
Wizardcomponents/Wizard.tsxOnboarding13KB
ImageUploadcomponents/ImageUpload.tsxImage sources10KB
MusicSelectorcomponents/MusicSelector.tsxAudio library9KB
BrandSettingscomponents/BrandSettings.tsxBrand kit8KB
ProjectLibrarycomponents/ProjectLibrary.tsxProject save/load7KB
OfferCanvascomponents/OfferCanvas.tsxCanvas render7KB
ProductFormcomponents/ProductForm.tsxProduct inputs3KB
Buttoncomponents/Button.tsxReusable button2KB

API Reference

Gemini Service Functions

Location: services/geminiService.ts

editImageWithGemini(base64, mimeType, prompt)

Edit an image using natural language.

const result = await editImageWithGemini(
  imageBase64,           // Base64 encoded image
  'image/jpeg',          // MIME type
  'Add rainbow to sky'   // Edit instruction
);
// Returns: "data:image/png;base64,..."

detectTextInImage(base64, mimeType)

Extract text and bounding boxes from an image.

const textData = await detectTextInImage(imageBase64, 'image/png');
// Returns: { text: "SALE 50%", boundingBox: {x, y, width, height} }

generateOfferCopy(product, template, size, tone)

Generate AI copywriting for offers.

const copy = await generateOfferCopy(
  { name: 'Summer Dress', price: 99.99, salePrice: 49.99 },
  'modern_minimal',
  'SQUARE_1080',
  'urgent'
);
// Returns: { headline, subheadline, cta }

generateSocialContent(product, offerCopy)

Generate social media captions and hashtags.

const social = await generateSocialContent(productInfo, offerCopy);
// Returns: { caption: "...", hashtags: ["#sale", "#fashion", ...] }

generateOfferVariants(product, template)

Generate multiple tone variants for A/B testing.

const variants = await generateOfferVariants(product, template);
// Returns: [{ tone: 'urgent', copy: {...} }, { tone: 'luxury', copy: {...} }]

Configuration

Environment Variables

VariableRequiredDescription
GEMINI_API_KEYYesGoogle Gemini API key

Vite Configuration

// vite.config.ts
{
  server: {
    port: 3000,
    host: '0.0.0.0'  // Allow external access
  },
  define: {
    'process.env.GEMINI_API_KEY': env.GEMINI_API_KEY
  }
}

TypeScript Configuration

  • Target: ES2022
  • Module: ESNext
  • JSX: react-jsx
  • Strict mode enabled

Usage Guide

Workflow 1: Edit an Image with AI

  1. Open the Studio Editor tab
  2. Upload an image (drag & drop, URL, or history)
  3. Enter a prompt describing your desired edit
  4. Click Generate and wait for Gemini to process
  5. View the result and optionally extract text
  6. Use in Story Animator or download

Workflow 2: Create a Story Animation

  1. Have an image ready (from Studio or upload)
  2. Switch to Story Mode tab
  3. Select an animation preset or customize:
    • Choose animation type
    • Set duration (5-15s)
    • Add text overlay (optional)
    • Select music track
  4. Preview the animation
  5. Export as MP4/WebM video

Workflow 3: Design an Offer

  1. Open Offer Creator tab (or use Wizard)
  2. Enter product information:
    • Name, SKU, prices, currency
  3. Select a template and size
  4. Configure brand kit colors/fonts
  5. Generate AI copy (or write custom)
  6. Preview and adjust
  7. Export as high-res PNG

Workflow 4: Use the Wizard

  1. Click Start Wizard button
  2. Step 1: Choose output format (Square/Story/Reel)
  3. Step 2: Enter product details
  4. Step 3: Select template and brand settings
  5. Step 4: Review AI-generated content
  6. Click Complete to finish setup

Data Storage

localStorage Keys

KeyContentLimit
image_historyArray of recent images (base64)6 items
brand_kitBrand settings object1 object
aeon_projectsSaved projects arrayUnlimited

Storage Format

// Image History Item
{
  id: string,
  url: string,        // base64 data URL
  mimeType: string,
  timestamp: number
}

// Project
{
  id: string,
  timestamp: number,
  productInfo: ProductInfo,
  templateId: string,
  size: CreativeSize,
  offerCopy: GeneratedOfferCopy,
  brandKit: BrandKit,
  socialContent: SocialContent
}

Export Capabilities

Image Export (PNG)

  • Source: OfferPreview component
  • Method: html-to-image library
  • Quality: 1x (standard) or 2x (high DPI)
  • Sizes: 1080x1080 or 1080x1920 pixels

Video Export (MP4/WebM)

  • Source: StoryViewer component
  • Method: MediaRecorder API + Canvas stream
  • Quality: 1x or 2x pixel ratio
  • Format: 9:16 vertical video
  • Audio: Synced from selected track
  • Duration: 5-15 seconds

Data Export (JSON)

  • Projects saved to localStorage
  • Can be copied manually for backup

Dependencies

Production

PackageVersionPurpose
react^19.2.0UI framework
react-dom^19.2.0DOM rendering
@google/genai^1.30.0Gemini API SDK
lucide-react^0.555.0Icon library
html-to-image1.11.11DOM to image

Development

PackageVersionPurpose
vite^6.2.0Build tool
typescript~5.8.2Type checking
@vitejs/plugin-react^5.0.0React plugin
@types/node^22.14.0Node types

CDN Resources

  • Tailwind CSS (styling)
  • Google Fonts (Inter, Montserrat, Playfair Display, Roboto Mono, Permanent Marker)

License

This project is private and proprietary.


Support

For issues and feature requests, please contact the development team or open an issue on GitHub.


Documentation generated for New Aeon Magic Apps v2.2

What's inside

10 sections covering 7 feature modules, 14 animation types, 6 API functions, 3 localStorage keys, and 2 export methods.

Change this for your project

  • Replace GEMINI_API_KEY=your_api_key_here with your own key
  • Replace Ibrahim-newaeon/Magic-tool with your repository path
  • Replace https://ai.studio/apps/drive/1Z5dx5NfIIKTL81hk-VPbQ5lSjOrfJ7Pw with your live app URL

Where it goes

Save in docs/ or the repository root. Gives agents and new contributors a map of the codebase.

Worth borrowing

  • Using a single App.tsx with React hooks for all state management instead of a global store
  • Offering animation presets (Cinematic, Hype/Pop, Showcase) that combine type, duration, and style

Related Documents