An Android diary application designed for long-distance relationships, allowing couples to track their daily moods, milestones, and memories.
- Daily Mood Tracking: Record daily feelings with 6 emotion types (Happy, Satisfied, Normal, Sad, Angry, Other)
- Relationship Timeline: Automatic day counter from relationship start date
- Anniversary Reminders: Special notifications for 100-day milestones and other significant dates
- Habit Tracking: Track and monitor daily habits and check-ins
- Statistics Dashboard: Visualize mood trends and patterns over time
- History View: Browse all past mood entries with search and filter
- Dark Mode: Full dark theme support with system-follow option
- Smooth Animations: Beautiful transitions and micro-interactions
- Accessibility: Content descriptions for screen readers
- Personalization: Customizable couple name and nicknames
- Backup & Restore: Export/import all data as JSON
- Data Security: Local SQLite database with Room
- Privacy First: All data stored locally on device
- Content Sharing: Share mood cards as text or beautiful images
- Daily Reminders: Optional notification reminders for mood tracking
- Anniversary Alerts: Automatic notifications for special milestones
- Language: Kotlin (99.4%)
- UI Framework: Jetpack Compose with Material 3
- Architecture: MVVM (Model-View-ViewModel)
- Dependency Injection: Hilt/Dagger
- Database: Room with SQLite (Version 8)
- Async Operations: Kotlin Coroutines & Flow
- Navigation: Jetpack Navigation Compose
- Image Loading: Coil
- Charts: Vico Charts
app/
├── data/
│ ├── backup/ # Backup/restore managers
│ ├── database/ # Room database, DAOs, entities
│ ├── model/ # Data models
│ └── repository/ # Repository layer
├── di/ # Dependency injection modules
├── docs/ # Architecture documentation
├── presentation/
│ ├── components/ # Reusable UI components
│ ├── screens/ # Screen composables
│ └── viewmodel/ # ViewModels
├── ui/
│ └── theme/ # Theme configuration
└── util/ # Utility classes (Notification, Share)
Comprehensive documentation available in the docs/ directory:
- ARCHITECTURE.md - Complete architecture guide
- DATABASE_SCHEMA.md - Database design and schema
- REFACTORING_PLAN.md - Refactoring strategy and roadmap
- SAMPLE_DATA.md - Importable 30-day sample backup for quick testing
- Android Studio Hedgehog or later
- Android SDK 26+ (Android 8.0 Oreo)
- Kotlin 2.0.21
-
Clone the repository:
git clone https://github.com/panguangze/diary.git cd diary -
Open the project in Android Studio
-
Sync Gradle dependencies
-
Build and run on emulator or device:
./gradlew assembleDebug
# Run unit tests
./gradlew test
# Run instrumented tests
./gradlew connectedAndroidTest- HomeViewModel: Manages home screen state and mood selection
- HistoryViewModel: Handles mood history loading and filtering
- StatisticsViewModel: Computes and presents mood statistics
- SettingsViewModel: Manages app configuration and preferences
- AppRepository: Main repository for app configuration and mood data
- CheckInRepository: Manages habit check-in data
- HabitRepository: Handles habit CRUD operations
- NotificationHelper: Manages local notifications and reminders
- ShareHelper: Handles content sharing (text and images)
- DataBackupManager: Implements backup/restore functionality
- Semantic content descriptions for all interactive elements
- Support for screen readers
- High contrast color schemes
- Proper touch target sizes
- Scale animations on mood button selection
- Fade-in transitions for feedback cards
- Staggered list item animations in history
- Smooth screen transitions
- Complete dark theme implementation
- System-follow option
- Manual light/dark toggle
- Optimized colors for night use
- All data stored locally (no cloud sync by default)
- Encrypted database support ready
- Secure file sharing with FileProvider
- No analytics or tracking
POST_NOTIFICATIONS: For reminder notifications (Android 13+)INTERNET: For future cloud sync (optional)- File access only through SAF (Storage Access Framework)
- All public APIs documented
- Repository methods with error handling docs
- ViewModel state classes documented
- Utility classes with usage examples
- Consistent error handling with try-catch
- Comprehensive logging in critical paths
- Null safety throughout
- Unit tests for ViewModels and Repositories
Database Optimization:
- Added indexes for improved query performance on frequently accessed columns
- Optimized check-in history and statistics queries
- Better support for date range filtering
Architecture Enhancements:
- Comprehensive documentation added (Architecture, Database Schema, Refactoring Plan)
- Bridge pattern implementation for gradual system migration
- Improved code maintainability and scalability
- Better separation of concerns between legacy and unified systems
Data Consistency:
- Dual-write strategy for backward compatibility
- UnifiedCheckIn system as primary data store
- Legacy Habit system maintained during transition
- Seamless migration path for future improvements
- Follow Kotlin coding conventions
- Use meaningful variable names
- Keep functions small and focused
- Add KDoc for public APIs
- Unit tests for business logic
- ViewModel tests with coroutine testing
- Repository tests with test doubles
- UI tests for critical user flows (future)
- Feature branches for new work
- Pull requests for code review
- Semantic commit messages
- Linear history preferred
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- panguangze - Initial work and maintenance
- Material Design 3 guidelines
- Jetpack Compose community
- Open source contributors
For questions or support, please open an issue on GitHub.
Made with ❤️ for long-distance couples