Skip to content

AmrEldeeb5/Valguard

Repository files navigation

πŸ›‘οΈ Valguard

A modern cryptocurrency portfolio tracker built with Kotlin Multiplatform

Valguard is a production-ready cryptocurrency portfolio tracking application that demonstrates modern mobile development practices with Kotlin Multiplatform and Compose. Track your crypto holdings, monitor real-time prices, and manage your investment strategyβ€”all with a premium dark UI.

Platform Kotlin Compose


✨ Features

  • πŸ“Š Real-time Price Tracking - Live cryptocurrency prices via WebSocket (CoinCap)
  • πŸ’Ό Portfolio Management - Track holdings, value, and performance
  • ⭐ Watchlist - Save favorite coins for quick access
  • πŸ“ˆ Price Charts - Historical price data with multiple timeframes
  • πŸ’° Simulated Trading - Practice buying/selling without real money
  • πŸ”” DCA Scheduling - Set up recurring buy reminders
  • πŸ” Coin Comparison - Side-by-side analysis of cryptocurrencies
  • πŸŒ™ Dark Theme - Premium gradient design with smooth animations
  • πŸ“΄ Offline Support - Cached data available without internet

⚠️ Educational Purpose: This app uses simulated trading only. No real cryptocurrency transactions occur. No exchange integration, KYC, or compliance features.


πŸ—οΈ Architecture

Tech Stack:

  • Kotlin Multiplatform - Share business logic across platforms
  • Compose Multiplatform - Unified UI framework
  • MVVM + Clean Architecture - Scalable, testable code structure
  • Room Database - Local data persistence with migrations
  • Ktor - HTTP client and WebSocket support
  • Koin - Dependency injection
  • Coroutines & Flow - Asynchronous programming
  • Kotest - Property-based testing

πŸ” Security & Production Readiness

βœ… Security Hardened:

  • Cleartext traffic disabled (HTTPS/WSS only)
  • ProGuard/R8 enabled for code obfuscation
  • No hardcoded credentials or API keys
  • Secure local storage with Room encryption

βœ… Production Features:

  • Proper database migrations (no data loss)
  • Error handling with user-friendly messages
  • Offline-first architecture
  • Memory leak prevention
  • Optimized APK size (~15-20 MB)

πŸ“Š Data Source

This project uses real market data from CoinGecko API with a cache-first architecture:

  • 🌐 API: CoinGecko public API (free tier)
  • πŸ’Ύ Caching: Room database with 5-minute staleness threshold
  • πŸ”„ Real-time: CoinCap WebSocket for live price updates
  • πŸ“΄ Offline: Full functionality with cached data

Data Flow:

CoinGecko API β†’ Room Cache β†’ Repository β†’ ViewModel β†’ UI
     ↓                                                  ↑
Real-time WebSocket β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • Android Studio Hedgehog or later
  • JDK 11 or later
  • For iOS development: Xcode 15+ and macOS

Project Structure

Build and Run Android

From Android Studio:

  • Use the run configuration from the toolbar

From Terminal:

# macOS/Linux
./gradlew :composeApp:assembleDebug

# Windows
.\gradlew.bat :composeApp:assembleDebug

Build and Run iOS

From Xcode:

  • Open /iosApp directory in Xcode
  • Select target device/simulator
  • Press Run (⌘R)

From Android Studio:

  • Use the iOS run configuration from the toolbar

πŸ“± Screens & Features

Main Screen

  • Market Tab - Browse all available cryptocurrencies
  • Portfolio Tab - View holdings and total value
  • Watchlist Tab - Quick access to favorite coins

Coin Detail

  • Live price with 24h change
  • Interactive price chart (1H, 24H, 7D, 1M, 1Y)
  • Market statistics (Cap, Volume, Supply, ATH/ATL)
  • Holdings display (if owned)
  • Buy/Sell actions

DCA (Dollar-Cost Averaging)

  • Create recurring buy schedules
  • Multiple frequencies (Daily, Weekly, Biweekly, Monthly)
  • Schedule management (pause/resume/delete)
  • Execution history tracking

Compare

  • Side-by-side coin comparison
  • Metric-by-metric analysis
  • Save comparisons for later
  • Winner highlighting

Additional

  • Referral System (UI ready)
  • Leaderboard (Performance rankings)
  • Price Alerts (UI ready)

πŸ“š Documentation

Technical Fix Reports


πŸ§ͺ Testing

Unit Tests

# Run all tests
./gradlew test

# Run specific module tests
./gradlew :composeApp:testDebugUnitTest

Property-Based Testing

  • Uses Kotest for robust testing
  • Validates UI components across all screen sizes
  • Tests data flow integrity

πŸ”§ Configuration

API Keys

No API keys required! Uses CoinGecko's public API (free tier).

ProGuard Rules

Release builds use comprehensive ProGuard rules in proguard-rules.pro:

  • Kotlin/Kotlinx preserved
  • Room database kept
  • Compose reflection maintained
  • Debug logs removed in production

πŸ“¦ Release Build

APK Size

  • Debug: ~25-30 MB
  • Release (with ProGuard): ~15-20 MB

🀝 Contributing

This is a personal learning project demonstrating Kotlin Multiplatform capabilities. Feel free to fork and experiment!

Code Style

  • Follow Kotlin coding conventions
  • Use meaningful variable names
  • Document complex logic
  • Write tests for new features

πŸ“ License

  • see the LICENSE file for details.

πŸ™ Acknowledgments

  • CoinGecko - Cryptocurrency data API
  • CoinCap - Real-time price WebSocket
  • JetBrains - Kotlin Multiplatform & Compose
  • Coil - Image loading library
  • Koin - Dependency injection

πŸ“§ Contact

For questions or feedback about this project, feel free to open an issue.


Built with ❀️ using Kotlin Multiplatform


πŸ“Έ Screenshots


⚑ Performance

  • Startup time: < 2 seconds
  • Memory usage: ~150 MB average
  • APK size: 15-20 MB (release)
  • Smooth 60 FPS animations

Learn more about Kotlin Multiplatform

About

Valguard is a modern cryptocurrency tracking and portfolio application built with Kotlin, CMP, Koin, Room, Ktor, MVVM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages