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.
- π 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.
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 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)
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 βββββββββββββββββββββββββββββββββββ
- Android Studio Hedgehog or later
- JDK 11 or later
- For iOS development: Xcode 15+ and macOS
-
/composeApp - Shared code for both platforms
- commonMain - Platform-agnostic code
- androidMain - Android-specific code
- iosMain - iOS-specific code
-
/iosApp - iOS app entry point
From Android Studio:
- Use the run configuration from the toolbar
From Terminal:
# macOS/Linux
./gradlew :composeApp:assembleDebug
# Windows
.\gradlew.bat :composeApp:assembleDebugFrom Xcode:
- Open
/iosAppdirectory in Xcode - Select target device/simulator
- Press Run (βR)
From Android Studio:
- Use the iOS run configuration from the toolbar
- Market Tab - Browse all available cryptocurrencies
- Portfolio Tab - View holdings and total value
- Watchlist Tab - Quick access to favorite coins
- 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
- Create recurring buy schedules
- Multiple frequencies (Daily, Weekly, Biweekly, Monthly)
- Schedule management (pause/resume/delete)
- Execution history tracking
- Side-by-side coin comparison
- Metric-by-metric analysis
- Save comparisons for later
- Winner highlighting
- Referral System (UI ready)
- Leaderboard (Performance rankings)
- Price Alerts (UI ready)
- VALGUARD_APP.md - Complete application documentation
- SECURITY_FIXES_APPLIED.md - Security improvements
- DATABASE_MIGRATIONS.md - Migration guide
- VERIFICATION_REPORT.md - CoinGecko integration verification
- REALITY_TESTING_GUIDE.md - Testing procedures
- Portfolio 24h Change Fix
- Chart Race Condition Fix
- Coin Icon Standardization
- Portfolio Price Sync Fix
# Run all tests
./gradlew test
# Run specific module tests
./gradlew :composeApp:testDebugUnitTest- Uses Kotest for robust testing
- Validates UI components across all screen sizes
- Tests data flow integrity
No API keys required! Uses CoinGecko's public API (free tier).
Release builds use comprehensive ProGuard rules in proguard-rules.pro:
- Kotlin/Kotlinx preserved
- Room database kept
- Compose reflection maintained
- Debug logs removed in production
- Debug: ~25-30 MB
- Release (with ProGuard): ~15-20 MB
This is a personal learning project demonstrating Kotlin Multiplatform capabilities. Feel free to fork and experiment!
- Follow Kotlin coding conventions
- Use meaningful variable names
- Document complex logic
- Write tests for new features
- see the LICENSE file for details.
- CoinGecko - Cryptocurrency data API
- CoinCap - Real-time price WebSocket
- JetBrains - Kotlin Multiplatform & Compose
- Coil - Image loading library
- Koin - Dependency injection
For questions or feedback about this project, feel free to open an issue.
Built with β€οΈ using Kotlin Multiplatform
- Startup time: < 2 seconds
- Memory usage: ~150 MB average
- APK size: 15-20 MB (release)
- Smooth 60 FPS animations
Learn more about Kotlin Multiplatform