# moyeenhaider3/travel_lens architecture

> Architecture diagram of the GitHub repository moyeenhaider3/travel_lens, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moyeenhaider3/travel_lens
- Repository: https://github.com/moyeenhaider3/travel_lens

## Overview

##### Project Type and Purpose
- TravelLens is a cross-platform, full-stack mobile/desktop/web application built with Flutter.
- It leverages Firebase for authentication, real-time database, and storage, and integrates external ML (Hugging Face Inference API) and content (Wikipedia REST API) services to perform object detection, OCR, translation, summarization, and text-to-speech.

##### File Structure
- Top-level “travel_lens” contains platform folders (android, ios, linux, macos, windows, web) generated by Flutter.
- The “lib” folder is subdivided into:
- core/ – low-level configuration, error handling, service interfaces
- data/ – models and providers for state management (Provider)
- features/ – service implementations for each feature (detection, OCR, translation, Wikipedia lookup)
- ui/ – screens and widgets
- main.dart – app entry point
- Configuration files (firebase.json, google-services.json/Info.plist, pubspec.yaml) and CI/dev tools (analysis_options.yaml, devtools_options.yaml) are present.

##### README for Additional Insights
- Tech stack: Flutter + Dart front-end, Firebase back-end, Hugging Face and Wikipedia external APIs.
- State management: Provider.
- Features map directly to service classes under lib/features and to providers under lib/data/providers.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Platform Runners
    subgraph "Platform Runners"
        Android["Android Runner"]:::frontend
        iOS["iOS Runner"]:::frontend
        WebRunner["Web Runner"]:::frontend
        Linux["Linux Runner"]:::frontend
        macOS["macOS Runner"]:::frontend
        Windows["Windows Runner"]:::frontend
    end

    %% Flutter App Layers
    subgraph "Flutter App"
        direction TB

        UI["UI Layer\nScreens & Widgets"]:::frontend
        click UI "https://github.com/moyeenhaider3/travel_lens/tree/main/lib/ui/screens/"

        subgraph "State Management" 
            AuthProv["AuthProvider"]:::data
            click AuthProv "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/data/providers/auth_provider.dart"
            DetectProv["DetectionProvider"]:::data
            click DetectProv "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/data/providers/detection_provider.dart"
            HistoryProv["HistoryProvider"]:::data
            click HistoryProv "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/data/providers/history_provider.dart"
            LangProv["LanguageProvider"]:::data
            click LangProv "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/data/providers/language_provider.dart"
        end

        Models["Data Models\n(detection_result.dart)"]:::data
        click Models "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/data/models/detection_result.dart"

        subgraph "Core Services & Interfaces"
            APIConfig["APIConfig"]:::core
            click APIConfig "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/services/api_config.dart"
            APIService["APIService"]:::core
            click APIService "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/services/api_service.dart"
            StorageIntf["StorageInterface"]:::core
            click StorageIntf "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/interfaces/storage_interface.dart"
            StorageSvc["StorageService"]:::core
            click StorageSvc "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/services/storage_service.dart"
            FirebaseStorage["FirebaseStorageService"]:::core
            click FirebaseStorage "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/services/firebase_storage_service.dart"
            CloudinaryStorage["CloudinaryStorageService"]:::core
            click CloudinaryStorage "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/services/cloudinary_storage_service.dart"
            LocationSvc["LocationService"]:::core
            click LocationSvc "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/services/location_service.dart"
        end

        subgraph "Feature Services"
            ObjDetect["ObjectDetectionService"]:::feature
            click ObjDetect "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/features/detection/object_detection_service.dart"
            OCR["OCRService"]:::feature
            click OCR "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/features/ocr/ocr_service.dart"
            Translate["TranslationService"]:::feature
            click Translate "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/features/translation/translation_service.dart"
            Wiki["WikipediaService"]:::feature
            click Wiki "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/features/information/wikipedia_service.dart"
        end

        Entry["App Entry Point\nmain.dart"]:::frontend
        click Entry "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/main.dart"
    end

    %% Backend
    subgraph "Firebase Backend"
        Auth["Firebase Auth"]:::backend
        Firestore["Firestore DB"]:::backend
        Storage["Firebase Storage"]:::backend
    end
    click Auth "https://github.com/moyeenhaider3/travel_lens/blob/main/lib/core/config/firebase_options.dart"
    click Firestore "https://github.com/moyeenhaider3/travel_lens/blob/main/firebase.json"
    click Storage "https://github.com/moyeenhaider3/travel_lens/blob/main/travel_lens/android/app/google-services.json"

    %% External APIs
    subgraph "External Services"
        MLAPI["Hugging Face Inference\n(ML API)"]:::external
        WikiAPI["Wikipedia REST API"]:::external
    end

    %% Device Hardware
    subgraph "Device Hardware"
        Camera["Camera"]:::hardware
        Mic["Microphone & Speaker"]:::hardware
    end

    %% Relationships
    Android -->|runs| Entry
    iOS -->|runs| Entry
    WebRunner -->|runs| Entry
    Linux -->|runs| Entry
    macOS -->|runs| Entry
    Windows -->|runs| Entry

    Entry --> UI
    UI -->|reads/writes| AuthProv
    UI -->|reads/writes| DetectProv
    UI -->|reads/writes| HistoryProv
    UI -->|reads/writes| LangProv

    AuthProv -->|uses| Auth
    HistoryProv -->|reads/writes| Firestore
    DetectProv -->|reads/writes| Firestore

    AuthProv --> CoreServices{Core Services & Interfaces}
    DetectProv --> CoreServices

    CoreServices --> StorageSvc
    StorageSvc -->|uploads| Storage
    CloudinaryStorage -->|uploads| Storage

    ObjDetect --> APIService
    OCR --> APIService
    Translate --> APIService
    Wiki --> APIService

    APIService --> MLAPI
    Wiki --> WikiAPI

    ObjDetect --> DetectProv
    OCR --> DetectProv
    Translate --> LangProv
    Wiki --> HistoryProv

    Camera --> ObjDetect
    Camera --> OCR
    Mic -->|text-to-speech| Mic

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#3182CE,color:#000
    classDef data fill:#DFFFE0,stroke:#38A169,color:#000
    classDef core fill:#E6FFFA,stroke:#2C7A7B,color:#000
    classDef feature fill:#F0EFFF,stroke:#805AD5,color:#000
    classDef backend fill:#FFF5E6,stroke:#DD6B20,color:#000
    classDef external fill:#F3E8FF,stroke:#6B46C1,color:#000
    classDef hardware fill:#EDF2F7,stroke:#4A5568,color:#000
```
