Skip to content

A clean, modern Flutter app that analyzes trading charts and gives structured insights — trend direction, key levels, and possible moves.

License

Notifications You must be signed in to change notification settings

AmirBayat0/ChartInsight-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

📊 ChartInsight AI

AI-Powered Trading Chart Analysis for Crypto & Commodities

Flutter Dart Gemini AI License Platform

Upload a trading chart. Get instant AI-powered insights. Make smarter trading decisions.

🚀 Features📱 Screenshots🛠️ Installation📚 Documentation🤝 Contributing


📖 Overview

ChartInsight AI is a cutting-edge mobile application that leverages Google's Gemini 1.5 Pro multimodal AI to analyze trading charts for cryptocurrencies, gold, forex, and other financial instruments. Simply upload or capture a chart screenshot, and receive comprehensive technical analysis with actionable trade suggestions.

🎯 Problem Statement

Traders spend hours analyzing charts manually, often missing critical patterns or support/resistance levels. ChartInsight AI democratizes professional-grade technical analysis by providing instant, AI-powered insights accessible to everyone.

💡 Solution

A beautiful, intuitive mobile app that:

  • ✅ Analyzes any trading chart in seconds
  • ✅ Identifies patterns, trends, and key levels
  • ✅ Suggests trades with entry, stop loss, and take profit levels
  • ✅ Supports multiple asset classes

✨ Features

🤖 AI-Powered Analysis

  • Multimodal AI: Uses Google Gemini 1.5 Pro for advanced image + text understanding
  • Comprehensive Insights: Detects asset type, timeframe, trend direction, patterns
  • Trade Signals: Provides BUY/SELL/HOLD recommendations with specific levels
  • Risk Assessment: Highlights potential risks and considerations

📸 Image Handling

  • Multiple Input Methods: Gallery upload or camera capture
  • Image Preview: Review your chart before analysis
  • Format Support: JPEG, PNG, and other common image formats
  • Compression: Optimized image handling for faster uploads

🎨 Modern UI/UX

  • Glassmorphism Design: Beautiful frosted glass effects
  • Dark Mode: Eye-friendly dark theme
  • Smooth Animations: Polished transitions and loading states
  • Responsive Layout: Adapts to phones, tablets, and foldables
  • Custom Components: Reusable, accessible UI elements

🏗️ Technical Excellence

  • GetX State Management: Reactive, high-performance state handling
  • Clean Architecture: Separation of concerns for maintainability
  • Error Handling: Comprehensive error messages and recovery
  • Type Safety: Full Dart null safety implementation
  • Offline Support: View previous analyses without internet

📱 Screenshots

Upload Screen Analyzing Results Screen
Chart Preview Trade Signal Analysis Details

🛠️ Tech Stack

Frontend

  • Framework: Flutter 3.x
  • Language: Dart 3.0+
  • State Management: GetX 4.6+
  • UI Components: Custom glassmorphism widgets
  • Typography: Google Fonts (Poppins)
  • Animations: Lottie, AnimatedSwitcher, FadeTransition

Backend & APIs

  • AI Model: Google Gemini 1.5 Pro (Multimodal)
  • HTTP Client: Dio 5.5+
  • Image Handling: image_picker 1.1+

Architecture

  • Pattern: GetX MVC with Clean Architecture
  • Routing: GetX Named Routes
  • Dependency Injection: GetX Bindings
  • Data Layer: Service-Repository pattern

🚀 Getting Started

Prerequisites

Before you begin, ensure you have:

  • Flutter SDK 3.0 or higher (Install Flutter)
  • Dart 3.0 or higher (comes with Flutter)
  • Android Studio / Xcode for emulators
  • Google Gemini API Key (Get API Key)
  • Git for version control

System Requirements

Platform Minimum Version
Android 6.0 (API 23)
iOS 12.0
Flutter 3.0.0
Dart 3.0.0

📥 Installation

1️⃣ Clone the Repository

# HTTPS
git clone https://github.com/AmirBayat0/chartinsight-ai.git

# SSH
git clone [email protected]:AmirBayat0/chartinsight-ai.git

# Navigate to project
cd chartinsight-ai

2️⃣ Install Dependencies

# Get all Flutter packages
flutter pub get

# Verify installation
flutter doctor -v

3️⃣ Platform-Specific Setup

Android Setup

  • No additional configuration needed! Permissions are already configured in AndroidManifest.xml.
cd ios
pod install
cd ..
  • Ensure Info.plist has the required permissions (already included).

4️⃣ Run the App

# List available devices
flutter devices

# Run on connected device
flutter run

# Run in release mode
flutter run --release

# Run on specific device
flutter run -d <device_id>

📂 Project Structure

chartinsight_ai/
├── lib/
│   ├── main.dart                          # App entry point
│   ├── app/
│   │   ├── bindings/                      # GetX dependency injection
│   │   │   ├── upload_binding.dart
│   │   │   └── result_binding.dart
│   │   ├── controllers/                   # GetX controllers (business logic)
│   │   │   ├── upload_controller.dart
│   │   │   └── result_controller.dart
│   │   ├── data/
│   │   │   ├── models/                    # Data models
│   │   │   │   └── analysis_result.dart
│   │   │   └── services/                  # API services
│   │   │       └── ai_service.dart
│   │   ├── routes/                        # Navigation configuration
│   │   │   ├── app_pages.dart
│   │   │   └── app_routes.dart
│   │   └── ui/
│   │       ├── pages/                     # Screen widgets
│   │       │   ├── upload_page.dart
│   │       │   └── result_page.dart
│   │       ├── widgets/                   # Reusable components
│   │       │   ├── glass_card.dart
│   │       │   ├── custom_button.dart
│   │       │   └── analysis_card.dart
│   │       └── theme/                     # App theming
│   │           └── app_theme.dart
├── assets/
│   └── lottie/                            # Animation files
│       └── ai_loader.json
├── android/                               # Android native code
├── ios/                                   # iOS native code
├── test/                                  # Unit & widget tests
├── .gitignore                             # Git ignore rules
├── pubspec.yaml                           # Dependencies
└── README.md                              # This file

🎮 Usage Guide

Basic Workflow

  • Launch App → Opens on Upload Screen
  • Select Chart → Choose "Upload from Gallery" or "Capture with Camera"
  • Preview → Review the selected chart image
  • Analyze → Tap "Analyze Now" button
  • Wait → AI processes the chart (5-15 seconds)
  • View Results → See comprehensive analysis and trade signal
  • New Analysis → Tap "Try Another Chart" to start over

Understanding Results

Trade Signal Card

  • 🟢 BUY: Bullish bias with entry/SL/TP levels
  • 🔴 SELL: Bearish bias with entry/SL/TP levels
  • 🟡 HOLD: Neutral or unclear direction

Analysis Sections

  • Asset: Detected cryptocurrency/commodity (e.g., BTC/USD, Gold)
  • Timeframe: Chart period (e.g., 1H, 4H, Daily)
  • Trend: Overall direction (Bullish/Bearish/Neutral)
  • Support: Key support levels to watch
  • Resistance: Key resistance levels to watch
  • Pattern: Identified chart patterns (e.g., Head & Shoulders, Triangle)
  • Risks: Potential risks and considerations

🏛️ Architecture

Design Pattern: GetX MVC + Clean Architecture

┌─────────────────────────────────────────────────────┐
│                    UI LAYER                         │
│  (Pages, Widgets, Theme)                            │
│  - upload_page.dart                                 │
│  - result_page.dart                                 │
│  - Reusable widgets                                 │
└─────────────────┬───────────────────────────────────┘
                  │
                  ▼
┌─────────────────────────────────────────────────────┐
│              CONTROLLER LAYER                       │
│  (Business Logic, State Management)                 │
│  - UploadController                                 │
│  - ResultController                                 │
│  - GetX reactive state                              │
└─────────────────┬───────────────────────────────────┘
                  │
                  ▼
┌─────────────────────────────────────────────────────┐
│                DATA LAYER                           │
│  (Services, Repositories, Models)                   │
│  - AIService (API calls)                            │
│  - AnalysisResult model                             │
└─────────────────┬───────────────────────────────────┘
                  │
                  ▼
┌─────────────────────────────────────────────────────┐
│              EXTERNAL APIs                          │
│  - Google Gemini 1.5 Pro                            │
└─────────────────────────────────────────────────────┘

Key Components

1. Controllers

Handle business logic and state management:

  • UploadController: Manages image selection and analysis trigger
  • ResultController: Displays and formats analysis results

2. Services

Encapsulate external API communication:

  • AIService: Gemini API integration with retry logic

3. Models

Define data structures:

  • AnalysisResult: Structured AI response data
  • SuggestedTrade: Trade recommendation details

4. Bindings

Manage dependency injection:

  • Lazy loading of controllers
  • Automatic disposal

🤖 API Integration

Google Gemini 1.5 Pro

  • Request Structure:
{
  "contents": [
    {
      "parts": [
        {
          "text": "Analyze this chart and return JSON with asset, timeframe, trend, support, resistance, pattern, suggested_trade (bias, entry, stop_loss, take_profit), risks, and disclaimer."
        },
        {
          "inline_data": {
            "mime_type": "image/jpeg",
            "data": "<BASE64_ENCODED_IMAGE>"
          }
        }
      ]
    }
  ],
  "generationConfig": {
    "temperature": 0.4,
    "topK": 32,
    "topP": 1,
    "maxOutputTokens": 2048
  }
}
  • Response Structure:
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "{\"asset\":\"BTC/USD\",\"timeframe\":\"4H\",...}"
          }
        ]
      }
    }
  ]
}

API Configuration

Features:

  • ✅ Multimodal input (image + text)
  • ✅ Automatic retry on failure
  • ✅ Model fallback mechanism
  • ✅ Response validation
  • ✅ Error handling with user-friendly messages

Rate Limits:

  • Free Tier: 60 requests/minute
  • For production: Consider upgrading to paid tier

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 ChartInsight AI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

🙏 Acknowledgments

Technologies

  • Flutter - UI framework
  • GetX - State management
  • Google Gemini - AI model
  • Dio - HTTP client

Inspiration

  • TradingView for chart analysis concepts
  • Modern fintech apps for UI/UX inspiration
  • Flutter community for best practices

Contributors

  • Thanks to all contributors who help improve ChartInsight AI!

📞 Support & Contact

Get Help

Report Issues

  • Found a bug? Open an issue

Feature Requests

  • Have an idea? Submit a feature request

❓ FAQ

Is this app free to use? Yes! The app is completely free. You only need a free Google Gemini API key (60 requests/min).
Does it work offline? Analysis requires internet to connect to Gemini API. However, you can view previously analyzed charts offline.
Is the analysis accurate? The AI provides educated insights based on technical analysis principles. However, this is NOT financial advice. Always do your own research.
What chart types are supported? Any screenshot of candlestick, line, or bar charts for crypto, forex, stocks, or commodities.
Can I use this for live trading? This tool is for educational purposes only. Use at your own risk. Past performance doesn't guarantee future results.
How do I get a Gemini API key? Visit Google AI Studio, sign in, and click "Create API Key". It's free!
Can I contribute to this project? Absolutely! See the Contributing section. We welcome all contributions.

⚖️ Disclaimer

IMPORTANT: This application is for educational and informational purposes only.

  • ❌ NOT financial advice

  • ❌ NOT investment recommendations

  • ❌ NOT guaranteed to be accurate

  • Trading and investing involve substantial risk of loss. Always:

  • ✅ Do your own research (DYOR)

  • ✅ Consult with licensed financial advisors

  • ✅ Never invest more than you can afford to lose

  • ✅ Understand the risks involved

  • The developers are not responsible for any financial losses incurred using this app.

⭐ Star this repo if you find it helpful!

Made with ❤️ by Flexz

About

A clean, modern Flutter app that analyzes trading charts and gives structured insights — trend direction, key levels, and possible moves.

Topics

Resources

License

Stars

Watchers

Forks