DiaryX is a privacy-first, AI-powered digital journaling application built with Flutter. It leverages Google's Gemma 3n model through MediaPipe (Google AI Edge) or Ollama for completely offline, on-device AI processing, ensuring your personal thoughts and memories never leave your device.
- Text Moments: Rich text journaling with AI-powered enhancement
- Voice Recording: Audio capture with real-time transcription
- Photo Capture: Image journaling with intelligent analysis
- Video Recording: Video moments with contextual understanding
- Gemma 3n Integration: Google's latest multimodal AI model via MediaPipe
- Complete Privacy: All AI processing happens locally on your device
- Offline Functionality: Full feature set without internet connectivity
- Intelligent Enhancement: AI-powered content expansion and insights
- Conversational Interface: Chat with your personal AI about your experiences
- Context-Aware: AI understands your journal history for meaningful conversations
- Real-time Streaming: Responsive AI interactions with streaming responses
- Mood Tracking: Multi-dimensional emotional state analysis
- Content Insights: Writing patterns and frequency analysis
- Visual Charts: Beautiful data visualizations with FL Chart
- Smart Tagging: Automatic and manual content categorization
- Local Storage: SQLite database with encrypted secure storage
- No Data Collection: Zero telemetry or data sharing
- Offline First: Complete functionality without cloud dependencies
- Framework: Flutter 3.32.0
- Language: Dart 3.8.1
- State Management: Provider
- UI Components: Material Design with custom themes
- AI Engine: Gemma 3n via MediaPipe LLM Inference or Ollama
- Database: SQLite with Drift ORM
- Local Storage: Flutter Secure Storage
- Media Processing: Native camera, audio, and video handling
- Android: API 24+ (Android 7.0 Nougat)
- iOS: iOS 12.0+
- Architecture: ARM64, x86_64
DiaryX follows a clean architecture pattern with clear separation of concerns:
lib/
βββ app.dart # App configuration and providers
βββ main.dart # Application entry point
βββ consts/ # Constants and configuration
βββ databases/ # Drift database definitions
βββ models/ # Data models with Freezed
βββ screens/ # UI screens and pages
β βββ capture/ # Content capture screens
β βββ chat/ # AI chat interface
β βββ home/ # Main dashboard
β βββ timeline/ # Journal timeline
β βββ insight/ # Analytics and insights
β βββ profile/ # User settings
βββ services/ # Business logic and services
β βββ ai/ # AI service implementation
β β βββ implementations/ # MediaPipe/Ollama LLM engine
β β βββ models/ # AI-related models
β βββ task/ # Background task processing
βββ stores/ # State management
βββ themes/ # App theming
βββ utils/ # Utility functions
βββ widgets/ # Reusable UI components
- AI Service: Manages Gemma 3n model integration and streaming responses
- MediaPipe/Ollma Engine: Native Android/iOS implementation for AI inference
- Drift Database: Type-safe SQLite ORM for local data persistence
- Task Queue: Universal background task processing system
- Provider Stores: Reactive state management for UI components
- Flutter SDK: 3.32.0 or higher
- Dart SDK: 3.8.1 or higher
- Android Studio: For Android development
- Xcode: For iOS development (macOS only)
- Android NDK: 27.0.12077973 (for MediaPipe native components)
-
Clone the repository
git clone https://github.com/xalanq/DiaryX.git cd DiaryX
-
Install dependencies
flutter pub get
-
Generate code
dart run build_runner build
-
Setup MediaPipe Models
# Download Gemma 3n models (instructions in docs/) # Place models in platform-specific directories
# Development mode
flutter run
# Release mode
flutter run --release
# Specific platform
flutter run -d android
flutter run -d ios
# Android APK
flutter build apk --release
# Android App Bundle
flutter build appbundle --release
# iOS
flutter build ios --release
The project uses several code generation tools:
# Generate all code
dart run build_runner build
# Watch for changes
dart run build_runner watch
# Clean generated files
dart run build_runner clean
# Generate migration files
dart run drift_dev schema generate drift_schemas/app_database/
# Run all tests
flutter test
# Run with coverage
flutter test --coverage
# Analyze code
flutter analyze
# Fix formatting
dart format lib/ test/
/lib/services/ai/
: AI integration and model management/lib/databases/
: Local data persistence layer/lib/models/
: Data transfer objects and entity models/lib/stores/
: Application state management/lib/screens/
: User interface screens/lib/widgets/
: Reusable UI components
/android/app/src/main/kotlin/
: Android native MediaPipe integration/ios/Runner/
: iOS native code (MediaPipe integration planned)
pubspec.yaml
: Dependencies and asset configurationanalysis_options.yaml
: Dart linting rulesandroid/app/build.gradle.kts
: Android build configuration
Create lib/consts/env_config.dart
with your configuration:
class EnvConfig {
static const String appName = 'DiaryX';
static const bool debugMode = false;
// Add other configuration as needed
}
- Download Gemma 3n models from the official repository
- Place models in the appropriate platform directories
- Update model paths in
AIConfigService
We welcome contributions! Please read our contributing guidelines before submitting PRs.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow Dart style guide
- Use
dart format
for consistent formatting - Ensure
flutter analyze
passes without warnings - Add tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- Google MediaPipe for AI inference framework
- Ollama for AI inference framework
- Gemma 3n for the multimodal AI model
- Flutter Team for the amazing cross-platform framework
- Drift for type-safe database operations
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: Contact maintainer
Made with β€οΈ for privacy-conscious journaling