Skip to content

Latest commit

 

History

History
323 lines (228 loc) · 6.26 KB

File metadata and controls

323 lines (228 loc) · 6.26 KB

Setup Guide for AI Data Science Learning App

This guide will help you set up the development environment and run the app.

Table of Contents

  1. System Requirements
  2. Flutter Setup
  3. Project Setup
  4. AI Content Generation
  5. Running the App
  6. Troubleshooting

System Requirements

Minimum Requirements

  • macOS: 10.14 (Mojave) or later
  • RAM: 8GB (16GB recommended)
  • Disk Space: 10GB free space
  • Xcode: 14.0 or later (for iOS development)

Software Prerequisites

  • Git
  • Flutter SDK 3.0+
  • Xcode 14+ with Command Line Tools
  • CocoaPods
  • VS Code or Android Studio (recommended IDEs)

Flutter Setup

1. Install Flutter

Download and install Flutter from the official website:

# Download Flutter
cd ~/development
git clone https://github.com/flutter/flutter.git -b stable

# Add Flutter to PATH (add to ~/.zshrc or ~/.bash_profile)
export PATH="$PATH:`pwd`/flutter/bin"

# Verify installation
flutter doctor

2. Install Xcode

  1. Install Xcode from the App Store
  2. Install Xcode Command Line Tools:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
  1. Accept licenses:
sudo xcodebuild -license accept

3. Install CocoaPods

sudo gem install cocoapods

4. Verify Setup

flutter doctor -v

All checkmarks should be green. If not, follow the instructions provided.

Project Setup

1. Clone the Repository

git clone <repository-url>
cd learn-ai-data-science

2. Install Dependencies

# Get Flutter packages
flutter pub get

# Install iOS pods
cd ios
pod install
cd ..

3. Generate Code

The app uses code generation for Hive adapters and Riverpod:

flutter pub run build_runner build --delete-conflicting-outputs

If you encounter errors, try:

flutter pub run build_runner clean
flutter pub run build_runner build --delete-conflicting-outputs

4. Configure iOS

Open ios/Runner.xcworkspace in Xcode and:

  1. Update Bundle Identifier:

    • Select Runner in Project Navigator
    • Change Bundle Identifier to your unique ID
    • Example: com.yourname.learnaidatascience
  2. Select Development Team:

    • In Signing & Capabilities
    • Select your Apple Developer account
  3. Update App Name (optional):

    • In Info.plist, modify CFBundleDisplayName

AI Content Generation

The app can generate educational content using local LLMs via Ollama.

1. Install Ollama

Option A: Homebrew

brew install ollama

Option B: Direct Download Download from https://ollama.ai

2. Start Ollama Server

ollama serve

Leave this terminal window open while using the app.

3. Download AI Models

In a new terminal:

# Recommended for balanced performance (3.2GB)
ollama pull llama3.2

# Alternative options:
ollama pull phi3        # Lighter model (2.3GB)
ollama pull mistral     # Higher quality (4.1GB)

4. Test AI Service

# Test that Ollama is working
curl http://localhost:11434/api/generate -d '{
  "model": "llama3.2",
  "prompt": "Explain Python lists in one sentence"
}'

5. App Configuration

The app is pre-configured to connect to http://localhost:11434.

To change the model or URL, edit lib/services/ai_content_service.dart:

AIContentService({
  this.baseUrl = 'http://localhost:11434',
  this.model = 'llama3.2',  // Change to your preferred model
});

Running the App

iOS Simulator

# List available simulators
flutter devices

# Run on default simulator
flutter run

# Run on specific simulator
flutter run -d "iPhone 14 Pro"

Physical iOS Device

  1. Connect your device via USB
  2. Trust the computer on your device
  3. In Xcode, select your device
  4. Run:
flutter run

Development Mode

# Run with hot reload (recommended for development)
flutter run

# Run in profile mode (for performance testing)
flutter run --profile

# Run in release mode
flutter run --release

Hot Reload

While the app is running:

  • Press r to hot reload
  • Press R to hot restart
  • Press q to quit

Troubleshooting

Common Issues

1. "Pod install failed"

cd ios
pod deintegrate
pod install
cd ..
flutter clean
flutter pub get

2. "Build failed" in Xcode

  • Clean build folder: Product > Clean Build Folder (Cmd+Shift+K)
  • Delete derived data: rm -rf ~/Library/Developer/Xcode/DerivedData
  • Restart Xcode

3. "Signing for Runner requires a development team"

  • Open ios/Runner.xcworkspace in Xcode
  • Select Runner target
  • Go to Signing & Capabilities
  • Select your Apple Developer account

4. "Code generation failed"

flutter clean
flutter pub get
flutter pub run build_runner clean
flutter pub run build_runner build --delete-conflicting-outputs

5. AI content not generating

  • Ensure Ollama is running: ollama serve
  • Verify model is downloaded: ollama list
  • Check logs for connection errors
  • Try accessing: http://localhost:11434/api/tags

6. "CocoaPods not installed"

sudo gem install cocoapods
pod setup

7. Simulator not launching

# Reset simulator
xcrun simctl erase all

# Kill existing simulators
killall Simulator

# Try again
flutter run

Getting Help

If you encounter issues:

  1. Check Flutter doctor: flutter doctor -v
  2. Check iOS build: flutter build ios --debug --verbose
  3. View logs: flutter logs
  4. Clean project: flutter clean && flutter pub get

For specific errors, search the Flutter GitHub issues or ask in the Flutter Community.

Next Steps

Once setup is complete:

  1. Run the app: flutter run
  2. Explore the onboarding flow
  3. Start learning with the first module
  4. Check out DEVELOPMENT.md for development guidelines

Additional Resources


Happy coding! 🚀

If you have questions, open an issue on GitHub or contact the maintainer.