Native Android mobile client for BaluHost NAS management system.
- Language: Kotlin 1.9+
- UI Framework: Jetpack Compose with Material 3
- Architecture: Clean Architecture + MVVM
- Dependency Injection: Hilt
- Networking: Retrofit + OkHttp
- Local Storage: Room + DataStore
- VPN: WireGuard Android Library
- Min SDK: 26 (Android 8.0)
- Target SDK: 34 (Android 14)
- 📱 QR code device registration with ML Kit barcode scanning
- 🔐 Secure JWT authentication with automatic token refresh
- 🔒 WireGuard VPN integration for secure remote access
- 📂 File management with upload/download/delete operations
- 📁 Android Files app integration via DocumentsProvider
- 📸 Automatic camera backup with WorkManager
- ⚙️ Background sync with configurable settings
- 🌙 Material 3 design with dark mode support
app/src/main/java/com/baluhost/android/
├── BaluHostApplication.kt # Application class with Hilt
├── di/ # Dependency Injection modules
├── data/ # Data layer (API, Database, Repository)
│ ├── local/
│ ├── remote/
│ └── repository/
├── domain/ # Domain layer (Models, UseCases)
│ ├── model/
│ ├── repository/
│ └── usecase/
├── presentation/ # Presentation layer (UI, ViewModels)
│ ├── ui/
│ └── navigation/
└── service/ # Android Services (VPN, Sync, Provider)
- Android Studio Hedgehog (2023.1.1) or later
- JDK 17
- Android SDK with API 34
- Gradle 8.1+
- Clone the repository
- Open project in Android Studio
- Sync Gradle files
- Update
BASE_URLinapp/build.gradle.ktswith your server address - Build and run on emulator or device
# Build debug APK
./gradlew assembleDebug
# Run unit tests
./gradlew test
# Run instrumented tests
./gradlew connectedAndroidTest
# Generate test coverage report
./gradlew jacocoTestReport- Project setup and dependencies
- QR scanner with ML Kit
- Device registration flow
- Token management with DataStore
- Secure storage with EncryptedSharedPreferences
- WireGuard VPN service
- VPN connection UI
- File browser with Compose
- Upload/download with progress
- File operations (delete, move, rename)
- Camera backup with WorkManager
- DocumentsProvider for Files app
- Background sync configuration
- Settings screen
- Offline mode
- Unit tests for all use cases
- UI tests with Compose Test
- Integration tests with MockWebServer
- Performance optimization
- Accessibility improvements
- Full Implementation Guide:
/docs/ANDROID_APP_GUIDE.md - Backend API Reference:
/docs/api/API_REFERENCE.md - Architecture Overview:
/docs/ARCHITECTURE.md
The app connects to the BaluHost FastAPI backend. Key endpoints:
POST /api/mobile/token/generate?include_vpn=true- Generate QR (Desktop)POST /api/mobile/register- Register devicePOST /api/auth/refresh- Refresh access tokenGET /api/files/list?path=<path>- List filesPOST /api/files/upload- Upload fileGET /api/files/download?path=<path>- Download filePOST /api/vpn/generate-config- Generate VPN config
Run the complete test suite:
# Unit tests
./gradlew test
# Instrumented tests (requires emulator/device)
./gradlew connectedAndroidTest
# Coverage report
./gradlew jacocoTestReport- JWT tokens stored in EncryptedSharedPreferences
- Network communication over HTTPS with certificate pinning
- VPN credentials encrypted at rest
- File data never cached unencrypted
See LICENSE in root directory.
See CONTRIBUTING.md for guidelines.