# zarpec/visionartificial architecture

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

- Interactive diagram: https://gitdiagram.com/zarpec/visionartificial
- Repository: https://github.com/zarpec/visionartificial

## Overview

##### Project type and purpose
- This is a cross-platform mobile application built with React Native (TypeScript), targeting Android and iOS.
- Its purpose is to provide real-time computer vision assistance—object/obstacle detection, OCR, and audio guidance—for users with visual impairments.

##### File structure
- Top-level files & folders:
– App.tsx, index.js: entry points for the React Native JS application
– android/, ios/: native platform code and configuration
– __tests__/: Jest unit tests
– ml/ (under android/app/src/main/assets/models & android/app/src/ml): prebuilt ONNX models + TypeScript wrapper (detector.ts)
– export_model.py & yolov8n.onnx/pt: Python export script and model sources
– babel.config.js, metro.config.js, tsconfig.json, package.json: build and tooling configs
- Patterns:
– JS layer (React components & business logic)
– Native layer (Android: MainActivity.kt, Application.kt; iOS: AppDelegate.swift, Podfile)
– ML inference assets sitting alongside native resources

##### README for additional insights
- Core technologies: React Native, OpenCV, ONNX models, mobile device APIs (camera, mic, TTS)
- No external server: runs fully on-device
- Real-time audio orientation and OCR

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "React Native JS Layer"
        App["App.tsx"]:::js
        Index["index.js"]:::js
        Tests["__tests__/App.test.tsx"]:::js
    end

    subgraph "Native Platform Layer"
        subgraph Android
            MainActivity["MainActivity.kt"]:::native
            MainApplication["MainApplication.kt"]:::native
        end
        subgraph iOS
            AppDelegate["AppDelegate.swift"]:::native
            Podfile_iOS["Podfile"]:::native
        end
    end

    subgraph "ML Inference Module"
        Detector["detector.ts"]:::ml
        ModelAsset["model.onnx"]:::ml
        ExportScript["export_model.py"]:::ml
        YOLO_ONNX["yolov8n.onnx"]:::ml
        YOLO_PT["yolov8n.pt"]:::ml
    end

    subgraph "Device APIs"
        Camera["Camera API"]:::api
        Microphone["Microphone API"]:::api
        TTS["Text-to-Speech API"]:::api
    end

    subgraph "Build Toolchain"
        Babel["babel.config.js"]:::tool
        Metro["metro.config.js"]:::tool
        TSConfig["tsconfig.json"]:::tool
        Package["package.json"]:::tool
        Gradle["android/gradlew\nsettings.gradle\nbuild.gradle"]:::tool
        Podfile_tool["ios/Podfile"]:::tool
    end

    Babel -->|"bundles JS"| App
    Metro -->|"bundles JS"| App
    Gradle -->|"builds Android"| MainActivity
    Podfile_tool -->|"installs iOS pods"| AppDelegate

    App -->|"via React Native Bridge"| MainActivity
    App -->|"via React Native Bridge"| AppDelegate

    MainActivity -->|"Camera2"| Camera
    AppDelegate -->|"AVFoundation"| Camera
    MainActivity -->|"TTS Native"| TTS
    AppDelegate -->|"TTS Native"| TTS

    MainActivity -->|"run ML inference"| Detector
    AppDelegate -->|"run ML inference"| Detector
    Detector -->|"returns results"| App

    Detector -.->|"loads model"| ModelAsset

    classDef js fill:#cce5ff,stroke:#004085
    classDef native fill:#d4edda,stroke:#155724
    classDef ml fill:#d1ecf1,stroke:#0c5460
    classDef api fill:#fff3cd,stroke:#856404
    classDef tool fill:#e2e3e5,stroke:#6c757d

    click App "https://github.com/zarpec/visionartificial/blob/main/App.tsx"
    click Index "https://github.com/zarpec/visionartificial/blob/main/index.js"
    click Tests "https://github.com/zarpec/visionartificial/blob/main/__tests__/App.test.tsx"
    click MainActivity "https://github.com/zarpec/visionartificial/blob/main/android/app/src/main/java/com/visionartificialapp/MainActivity.kt"
    click MainApplication "https://github.com/zarpec/visionartificial/blob/main/android/app/src/main/java/com/visionartificialapp/MainApplication.kt"
    click AppDelegate "https://github.com/zarpec/visionartificial/blob/main/ios/VisionArtificialApp/AppDelegate.swift"
    click Podfile_iOS "https://github.com/zarpec/visionartificial/tree/main/ios/Podfile"
    click Detector "https://github.com/zarpec/visionartificial/blob/main/android/app/src/ml/detector.ts"
    click ModelAsset "https://github.com/zarpec/visionartificial/blob/main/android/app/src/main/assets/models/model.onnx"
    click ExportScript "https://github.com/zarpec/visionartificial/blob/main/export_model.py"
    click YOLO_ONNX "https://github.com/zarpec/visionartificial/blob/main/yolov8n.onnx"
    click YOLO_PT "https://github.com/zarpec/visionartificial/blob/main/yolov8n.pt"
    click Babel "https://github.com/zarpec/visionartificial/blob/main/babel.config.js"
    click Metro "https://github.com/zarpec/visionartificial/blob/main/metro.config.js"
    click TSConfig "https://github.com/zarpec/visionartificial/blob/main/tsconfig.json"
    click Package "https://github.com/zarpec/visionartificial/blob/main/package.json"
    click Gradle "https://github.com/zarpec/visionartificial/tree/main/android/gradlew"
    click Podfile_tool "https://github.com/zarpec/visionartificial/tree/main/ios/Podfile"
```
