Skip to content

elisha-et/greenguide-ios

Repository files navigation

🌱 GreenGuide - iOS

πŸ“± Overview

GreenGuide is an AI-powered waste management iOS application that helps users make environmentally conscious disposal decisions. Simply snap a photo of any item, and GreenGuide uses advanced computer vision and reasoning models to identify the object, determine the proper disposal method, and provide personalized environmental impact feedback.

Backend Repository: GreenGuide Backend

✨ Features

🎯 Core Functionality

  • Smart Image Classification: Real-time object identification using NVIDIA's Nemotron AI models
  • Multi-Category Disposal: Classifies items into 6 categories (Recyclable, Compostable, Landfill, Hazardous, E-waste, Textile)
  • Preparation Guidance: Step-by-step instructions for proper item preparation before disposal
  • Confidence Scoring: Transparent AI confidence levels (High/Medium/Low) for each classification

πŸ“Š Impact Tracking

  • Local History Storage: SwiftData-powered persistent storage of all scanned items
  • Statistics Dashboard: Real-time visualization of environmental impact metrics
  • Category Breakdown: Visual progress bars showing disposal distribution
  • Environmental Metrics: Track COβ‚‚ savings, energy conservation, water saved, and more

🎨 User Experience

  • Native iOS Design: Built entirely with SwiftUI for smooth, modern interactions
  • Camera & Photo Library: Seamless integration with iOS photo capabilities
  • Dark Mode Support: Automatic adaptation to system appearance
  • Animated Launch Screen: Polished first-impression experience

πŸ—οΈ Architecture

Tech Stack

  • Language: Swift 5.9
  • UI Framework: SwiftUI 3.0
  • Data Persistence: SwiftData (iOS 17+)
  • Networking: URLSession + async/await
  • Image Processing: UIKit ImagePicker, CoreImage
  • Backend API: RESTful FastAPI service

Project Structure

GreenGuide/
β”œβ”€β”€ Models/
β”‚   β”œβ”€β”€ ScanRecord.swift          # SwiftData model for scan history
β”‚   └── APIService.swift          # Network layer & API responses
β”œβ”€β”€ Views/
β”‚   β”œβ”€β”€ LaunchScreen.swift        # Animated launch screen
β”‚   β”œβ”€β”€ MainTabView.swift         # Tab navigation container
β”‚   β”œβ”€β”€ ScanView.swift            # Main scanning interface
β”‚   β”œβ”€β”€ HistoryView.swift         # Scan history & detail views
β”‚   └── ImpactDashboardView.swift # Statistics & impact tracking
β”œβ”€β”€ Components/
β”‚   β”œβ”€β”€ ImagePicker.swift         # UIKit-SwiftUI bridge
β”‚   β”œβ”€β”€ CategoryCard.swift        # Reusable category display
β”‚   └── ConfidenceBadge.swift     # Confidence level indicator
└── GreenGuideApp.swift           # App entry point

πŸš€ Getting Started

Prerequisites

  • macOS 13.0 or later
  • Xcode 15.0 or later
  • iOS 17.0+ device or simulator
  • Active GreenGuide backend instance

Installation

  1. Clone the repository

    git clone https://github.com/elisha-et/greenguide-ios.git
    cd greenguide-ios
  2. Open in Xcode

    open GreenGuide.xcodeproj
  3. Configure Backend URL

    In APIService.swift, update the backend URL:

    static let baseURL = "YOUR_BACKEND_URL"
    // Example: "https://greenguide-backend.onrender.com"
  4. Build and Run

    • Select your target device/simulator
    • Press ⌘ + R to build and run
    • Grant camera and photo library permissions when prompted

Backend Setup

This app requires the GreenGuide backend service. Follow the setup instructions at: GreenGuide Backend Repository

πŸ“Έ Screenshots

Scan View Results History Dashboard
Scan Results History Dashboard

πŸ“Š Data Models

ScanRecord (SwiftData)

@Model
final class ScanRecord {
    var id: UUID
    var date: Date
    var objectName: String
    var category: String
    var categoryIcon: String
    var categoryColor: String
    var confidence: Double
    var environmentalFeedback: String
    var primaryMetric: String
    var preparationSteps: [String]
    var imageData: Data?
}

API Response Structure

struct ClassificationResponse: Codable {
    let success: Bool
    let is_waste_item: Bool
    let object: String?
    let category: String?
    let category_info: CategoryInfo?
    let preparation_steps: [String]?
    let confidence: Confidence?
    let environmental_impact: EnvironmentalImpact?
}

🎯 Features Roadmap

  • Export Functionality: Share impact statistics as images
  • Notifications: Reminders for recycling days
  • Community Features: Compare impact with friends
  • Offline Mode: Cache classifications for offline access
  • AR Mode: Point camera at items for real-time classification
  • Location-Based Tips: Local recycling center information
  • Multi-Language Support: Internationalization

πŸ§ͺ Testing

Manual Testing

  1. Test camera capture with various lighting conditions
  2. Verify photo library integration
  3. Test with edge cases:
    • Blurry images
    • Multiple objects
    • Non-waste items (people, landscapes)
  4. Validate data persistence across app restarts
  5. Test deletion and history management

Test Coverage

  • Unit tests for API response parsing
  • SwiftData CRUD operations
  • Image processing pipeline

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Made with πŸ’š and ♻️ for a sustainable future

About

AI-powered waste classification iOS Application using Swift

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages