# ekycsolutions/ekyc-id-flutter architecture

> Architecture diagram of the GitHub repository ekycsolutions/ekyc-id-flutter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ekycsolutions/ekyc-id-flutter
- Repository: https://github.com/ekycsolutions/ekyc-id-flutter

## Overview

##### Main Components

a) Client Application Layer:
- Flutter Application (Main Integration Point)
- Example Application Structure
- Platform-specific Implementation (iOS/Android)

b) Core SDK Components:
- Document Scanner Module
- Face Scanner Module
- Liveness Detection Module
- Core Services Layer

c) External Systems:
- EkycID Backend Server
- Native SDK Dependencies

**[Client Application Layer]**
- ↓
**[Flutter SDK Layer]**
- ↓
**[Platform Channels]**
- ↓
**[Native Implementation Layer]**
- ↓
**[External Services]**

##### Component Details

a) Flutter SDK Components (Blue Rectangles):
- Document Scanner (DocumentScanner/)
- Face Scanner (FaceScanner/)
- Liveness Detection (LivenessDetection/)
- Core Services (core/)

b) Platform-specific Implementation (Green Rectangles):
- iOS Native Implementation
- Android Native Implementation

c) Communication Channels (Yellow Diamonds):
- Method Channels
- Platform Views
- Event Channels

d) Models and Data Flow (Purple Rectangles):
- API Results
- Document Models
- Scanner Values
- Frame Status

##### Key Relationships to Highlight

- Data flow between components
- Dependencies between modules
- Platform channel communication
- API calls to backend services

##### Implementation Details

Use annotations to highlight:
- Supported document types
- Face recognition capabilities
- Liveness detection features
- OCR functionality

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Application Layer"]
        FlutterApp["Flutter Application"]
        ExampleApp["Example Application"]
    end

    subgraph SDK["Flutter SDK Layer"]
        direction TB
        DocScanner["Document Scanner"]
        FaceScanner["Face Scanner"]
        LiveDetect["Liveness Detection"]
        CoreServices["Core Services"]
        Models["Models"]
        Assets["Asset Management"]
    end

    subgraph Platform["Platform Channels Layer"]
        direction TB
        MethodChannel["Method Channels"]
        EventChannel["Event Channels"]
        PlatformView["Platform Views"]
    end

    subgraph Native["Native Implementation Layer"]
        direction TB
        subgraph Android["Android Implementation"]
            AndroidDoc["Document Scanner"]
            AndroidFace["Face Scanner"]
            AndroidLive["Liveness Detection"]
            AndroidPlugin["Plugin Implementation"]
            AndroidLayout["Layout Resources"]
        end
        
        subgraph iOS["iOS Implementation"]
            iOSDoc["Document Scanner"]
            iOSFace["Face Scanner"]
            iOSLive["Liveness Detection"]
            iOSPlugin["Plugin Implementation"]
            iOSViews["Views"]
        end
    end

    subgraph External["External Systems"]
        Backend["EkycID Backend Server"]
        NativeSDK["Native SDK Dependencies"]
    end

    %% Relationships
    FlutterApp --> DocScanner
    FlutterApp --> FaceScanner
    FlutterApp --> LiveDetect
    
    DocScanner --> MethodChannel
    FaceScanner --> MethodChannel
    LiveDetect --> EventChannel
    CoreServices --> PlatformView
    
    MethodChannel --> AndroidPlugin
    MethodChannel --> iOSPlugin
    EventChannel --> AndroidPlugin
    EventChannel --> iOSPlugin
    
    AndroidPlugin --> AndroidDoc
    AndroidPlugin --> AndroidFace
    AndroidPlugin --> AndroidLive
    
    iOSPlugin --> iOSDoc
    iOSPlugin --> iOSFace
    iOSPlugin --> iOSLive
    
    AndroidDoc --> Backend
    iOSDoc --> Backend
    
    %% Click Events
    click DocScanner "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/lib/src/document_scanner/"
    click FaceScanner "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/lib/src/face_scanner/"
    click LiveDetect "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/lib/src/liveness_detection/"
    click CoreServices "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/lib/src/core/"
    click Models "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/lib/src/models/"
    click Assets "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/lib/assets/"
    click AndroidDoc "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/android/src/main/kotlin/com/ekycsolutions/ekyc_id_flutter/DocumentScanner/"
    click AndroidFace "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/android/src/main/kotlin/com/ekycsolutions/ekyc_id_flutter/FaceScanner/"
    click AndroidLive "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/android/src/main/kotlin/com/ekycsolutions/ekyc_id_flutter/LivenessDetection/"
    click AndroidPlugin "https://github.com/EKYCSolutions/ekyc-id-flutter/blob/main/android/src/main/kotlin/com/ekycsolutions/ekyc_id_flutter/EkycIdFlutterPlugin.kt"
    click AndroidLayout "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/android/src/main/res/layout/"
    click iOSDoc "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/ios/Classes/DocumentScanner/"
    click iOSFace "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/ios/Classes/FaceScanner/"
    click iOSLive "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/ios/Classes/LivenessDetection/"
    click iOSPlugin "https://github.com/EKYCSolutions/ekyc-id-flutter/blob/main/ios/Classes/SwiftEkycIdFlutterPlugin.swift"
    click iOSViews "https://github.com/EKYCSolutions/ekyc-id-flutter/tree/main/ios/Classes/"

    %% Styling
    classDef client fill:#e1f5fe,stroke:#01579b
    classDef sdk fill:#e8f5e9,stroke:#2e7d32
    classDef platform fill:#fff3e0,stroke:#ef6c00
    classDef native fill:#f3e5f5,stroke:#7b1fa2
    classDef external fill:#fce4ec,stroke:#c2185b

    class FlutterApp,ExampleApp client
    class DocScanner,FaceScanner,LiveDetect,CoreServices,Models,Assets sdk
    class MethodChannel,EventChannel,PlatformView platform
    class AndroidDoc,AndroidFace,AndroidLive,AndroidPlugin,AndroidLayout,iOSDoc,iOSFace,iOSLive,iOSPlugin,iOSViews native
    class Backend,NativeSDK external
```
