proofmode 0.9.0

Capture, share, and preserve verifiable photos and videos
Documentation
# ProofMode Platform Structure

This document clarifies how ProofMode is organized across different platforms. Each platform has:
1. **A library** - The core ProofMode functionality exposed through platform-specific bindings
2. **An application** - Either a CLI tool or mobile app that uses the library

## Directory Organization

```
proofmode-rust/
├── src/              # Rust library and CLI source
├── cli/              # Command-line interfaces for each platform
│   ├── python/       # Python CLI implementation
│   ├── ruby/         # Ruby CLI implementation
│   └── node/         # Node.js CLI implementation
├── examples/         # Integration examples and applications
│   ├── python/       # Python library usage examples
│   ├── ruby/         # Ruby library usage examples
│   ├── node/         # Node.js library usage examples
│   ├── web/          # Next.js web application
│   ├── android/      # Android example application
│   └── ios/          # iOS example application
└── android-library/  # Android library module for Maven publishing
```

## Platform Overview

### 🦀 Rust (Native)
- **Library**: Core implementation in `src/` 
- **Application**: Native CLI in `src/main.rs`
- **Usage**: `cargo run -- [command]`

### 🐍 Python
- **Library**: UniFFI bindings distributed as pip package
  - `proofmode.py` - High-level Python API
  - `uniffi_generated/proofmode.py` - Auto-generated UniFFI bindings
  - `libproofmode.so` - Native library
- **CLI Application**: `cli/python/` - Full command-line interface
- **Examples**: `examples/python/` - Integration examples
- **Usage**: `proofmode [command]` (after installation)

### 💎 Ruby
- **Library**: UniFFI bindings distributed as Ruby gem
  - `proofmode.rb` - High-level Ruby API
  - `uniffi_generated/proofmode.rb` - Auto-generated UniFFI bindings
  - Native library loaded via FFI
- **CLI Application**: `cli/ruby/` - Full command-line interface
- **Examples**: `examples/ruby/` - Integration examples
- **Usage**: `proofmode [command]` (after installation)

### 🟢 Node.js/JavaScript
- **Library**: WASM module distributed as NPM package
  - `pkg/` directory (generated) contains the WASM module
  - JavaScript wrapper API included in package
- **CLI Application**: `cli/node/` - Full command-line interface
- **Examples**: `examples/node/` - Integration examples
- **Usage**: `proofmode [command]` (after npm install)

### 🤖 Android
- **Library**: Android AAR with Kotlin bindings
  - `android-library/` - Library module for Maven publishing
  - Contains UniFFI-generated Kotlin bindings
  - Native libraries for all Android architectures
- **Application**: Full Android app in `examples/android/`
  - Jetpack Compose UI
  - Camera integration
  - Proof generation and verification
- **Usage**: Install APK or run from Android Studio

### 🍎 iOS
- **Library**: XCFramework with Swift bindings
  - `ProofModeRust.xcframework` - Universal framework
  - `examples/ios/ProofMode.swift` - Swift API wrapper
  - UniFFI-generated Swift bindings
- **Application**: Full iOS app in `examples/ios/`
  - SwiftUI interface
  - Camera and photo library integration
  - Proof generation and verification
- **Usage**: Run from Xcode

### 🌐 Web
- **Library**: WASM module distributed via NPM or CDN
  - Built with wasm-pack
  - Runs in Web Workers for non-blocking operations
- **Application**: Next.js web app in `examples/web/`
  - Material-UI components
  - Camera capture support
  - Geolocation integration
  - Fully client-side processing
- **Usage**: `pnpm dev` in examples/web

## Architecture Pattern

Each platform follows the same pattern:

```
Platform/
├── Library (Bindings + Native Code)
│   ├── High-level API wrapper
│   ├── UniFFI/WASM generated bindings
│   └── Native library (.so/.dylib/.dll/.a)
└── Application
    ├── CLI (Python, Ruby, Node.js, Rust)
    └── Mobile App (Android, iOS)
```

## Building and Testing

### Build All Platforms
```bash
make build-all
```

### Test Individual Platforms
```bash
# Python
cd examples/python && python -m pytest

# Ruby
cd examples/ruby && bundle exec rspec

# Node.js
cd examples/node && npm test

# Android
cd examples/android && ./gradlew test

# iOS
cd examples/ios && xcodebuild test
```

## Package Distribution

Each platform's library can be distributed separately:

- **Python**: PyPI package (`pip install proofmode`)
- **Ruby**: RubyGems (`gem install proofmode`)
- **Node.js**: NPM package (`npm install @guardianproject/proofmode`)
- **Android**: Maven AAR (`implementation 'org.guardianproject.proofmode:proofmode-android:0.8.4'`)
- **iOS**: Swift Package Manager or CocoaPods
- **Rust**: Crates.io (`cargo install proofmode`)

The applications serve as:
1. **Reference implementations** showing best practices
2. **Testing tools** for development
3. **End-user applications** (mobile apps)
4. **Command-line tools** for scripting and automation