8000 GitHub - aaravgarg/deepcricket: DeepCricket is a Flutter application that provides in-depth cricket analysis powered by the Perplexity AI API. Users can search for information about cricket players, matches, statistics, tournaments, and strategies.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

DeepCricket is a Flutter application that provides in-depth cricket analysis powered by the Perplexity AI API. Users can search for information about cricket players, matches, statistics, tournaments, and strategies.

Notifications You must be signed in to change notification settings

aaravgarg/deepcricket

Repository files navigation

DeepCricket

DeepCricket is a Flutter application that provides in-depth cricket analysis powered by the Perplexity AI API. Users can search for information about cricket players, matches, statistics, tournaments, and strategies.

Features

  • AI-Powered Cricket Analysis: Get detailed information about any cricket-related query
  • Clean and Modern UI: User-friendly interface with a search bar and results display
  • Recent Searches: Keep track of your recent searches for quick access
  • Error Handling: Robust error handling for API failures and network issues

Running on Web

This application is configured to run on the web platform. Follow these steps to get it running:

Prerequisites

  • Flutter SDK (latest version recommended)
  • Dart SDK (latest version recommended)
  • Node.js and npm (for the CORS proxy server)
  • A Perplexity API key

Setup

  1. Clone the repository
  2. Run flutter pub get to install dependencies
  3. Make sure your Perplexity API key is set in lib/config/api_config.dart

Running the CORS Proxy Server (Required for Web)

When running the app on the web, you'll need to use a CORS proxy server to handle API requests. We've included a simple Node.js proxy server:

  1. Install the required Node.js packages:

    npm install
    
  2. Start the proxy server:

    npm start
    

The proxy server will run on http://localhost:8080.

Running the Flutter Web App

  1. Make sure the CORS proxy server is running

  2. Run the Flutter web app:

    flutter run -d chrome
    
  3. Or build for production:

    flutter build web
    

Configuration

You can configure the app's behavior in lib/config/api_config.dart:

  • useProxyForWeb: Set to true to use the CORS proxy for web requests (recommended)
  • perplexityApiUrl: The direct URL for the Perplexity API
  • corsProxyUrl: The URL for the local CORS proxy server
  • apiKey: Your Perplexity API key
  • model: The Perplexity model to use
  • maxTokens: Maximum number of tokens to generate
  • timeoutSeconds: Timeout duration for API requests

Troubleshooting Web Issues

If you encounter issues when running on the web:

  1. Check the browser console for error messages
  2. Ensure the CORS proxy server is running
  3. Verify that useProxyForWeb is set to true in lib/config/api_config.dart
  4. Try clearing your browser cache
  5. Check if your Perplexity API key is valid

Handling Timeouts

The Perplexity API can sometimes take longer than expected to respond, especially for complex cricket queries. The app is configured with the following timeout settings:

  • Flutter app timeout: 120 seconds (configurable in lib/config/api_config.dart)
  • CORS proxy server timeout: 300 seconds (5 minutes)
  • JavaScript fetch timeout: 120 seconds

If you're still experiencing timeout issues:

  1. Increase the timeoutSeconds value in lib/config/api_config.dart
  2. Try simpler, more specific queries
  3. Check if the Perplexity API is experiencing high traffic
  4. Ensure your internet connection is stable

The app includes an automatic retry mechanism that will attempt to resend failed requests up to 2 times before showing an error message.

License

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

Acknowledgments

  • Perplexity AI for providing the API
  • Flutter team for the amazing framework

About

DeepCricket is a Flutter application that provides in-depth cricket analysis powered by the Perplexity AI API. Users can search for information about cricket players, matches, statistics, tournaments, and strategies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0