Skip to content

shubham230523/TraceFlow

Repository files navigation

TraceFlow

TraceFlow is a powerful Kotlin Multiplatform network inspection library designed for modern mobile and desktop applications. It provides real-time visibility into your app's network traffic directly on the device, making debugging and monitoring effortless.

✨ Key Features

  • 🔍 Real-time Network Monitoring - Watch HTTP requests and responses as they happen
  • 📱 Cross-Platform Support - Works seamlessly on Android, iOS, and Desktop applications
  • 🎯 Ktor Integration - Built specifically for Ktor-based networking stacks
  • 📊 Session Tracking - Distinguishes between current and previous app sessions
  • 🔒 Privacy-Focused - Configurable data redaction and retention policies
  • Lightweight - Minimal performance impact on your application
  • 🎨 Native UI - Platform-appropriate interfaces for optimal user experience

🚀 Quick Start

Prerequisites

  • Kotlin Multiplatform project
  • Ktor client library (version 2.3.1 or higher)
  • Android API level 21+ / iOS 12+ / Desktop JVM

Installation

Add the library to your commonMain dependencies:

repositories {
    mavenCentral()
}

For Ktor 3.x.x

commonMain.dependencies {
    implementation("io.github.TraceFlowTeam:TraceFlow-ktor3:{mavenVersion}")
}

For Ktor 2.3.1 - 3.0.0

commonMain.dependencies {
    implementation("io.github.TraceFlowTeam:TraceFlow-ktor2:{mavenVersion}")
}

Basic Setup

Integrate TraceFlow into your Ktor client with a single line:

val httpClient = HttpClient() {
    install(ContentNegotiation) {
        json()
    }
    install(TraceFlowKtor) // That's it! 🎉
}

📱 Platform-Specific Configuration

iOS Integration

Depending on your iOS framework configuration:

Static Frameworks

Add -lsqlite3 to Other Linker Flags in your Xcode project settings.

Dynamic Frameworks

iosTarget.binaries.all {
    linkerOpts("-lsqlite3")
}

⚙️ Advanced Configuration

TraceFlow offers extensive customization options to fit your development needs:

Available Configurations

  1. 🤖 Auto-Detection - Automatically identify network configurations
  2. 📝 Log Levels - Control verbosity of network logging
  3. 🗂️ Data Retention - Manage how long network data is stored
  4. ⌨️ Shortcuts - Quick access shortcuts for mobile platforms
  5. 🚫 Release Exclusion - Keep TraceFlow out of production builds
  6. 🔐 Data Redaction - Sensitive data protection and masking
  7. 🎯 Endpoint Filtering - Ignore specific endpoints from tracking

📖 Explore Configuration Docs

🧪 Sample Application

Experience TraceFlow in action with our comprehensive sample project:

# Clone and run the sample
git clone https://github.com/shubham230523/TraceFlow
cd TraceFlowSample
./gradlew :composeApp:run

Switch between Ktor versions:

# In gradle.properties
TraceFlow.ktorVersion=v3  # or v2 for legacy support

🏗️ Architecture

TraceFlow follows clean architecture principles with clear separation of concerns:

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Presentation  │    │      Domain     │    │       Data      │
│                 │    │                 │    │                 │
│ • UI Components │    │ • Use Cases     │    │ • Repositories  │
│ • ViewModels    │    │ • Models        │    │ • Data Sources  │
│ • Navigation    │    │ • Interfaces    │    │ • Mappers       │
└─────────────────┘    └─────────────────┘    └─────────────────┘

🛠️ Development & Contributing

We welcome contributions from the community! Here's how you can help:

  • 🐛 Report Issues - Found a bug? Let us know!
  • 💡 Feature Requests - Have an idea? We'd love to hear it
  • 🔧 Pull Requests - Submit improvements and fixes
  • 📚 Documentation - Help us improve our docs

Development Setup

git clone https://github.com/shubham230523/TraceFlow
cd TraceFlow
./gradlew build

📊 Performance Impact

TraceFlow is designed with performance in mind:

  • < 2% CPU overhead during active monitoring
  • < 5MB additional memory footprint
  • Zero impact when monitoring is disabled
  • Asynchronous processing to avoid blocking main thread

🔒 Privacy & Security

Your data security is our priority:

  • Local storage only - no data leaves the device
  • Configurable data redaction for sensitive information
  • Automatic data cleanup based on retention policies
  • Optional exclusion from release builds

About

TraceFlow is a powerful Kotlin Multiplatform network inspection library designed for modern mobile and desktop applications. It provides real-time visibility into your app's network traffic directly on the device, making debugging and monitoring effortless.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors