Skip to content
/ DiaryX Public

DiaryX is a private, offline-first diary application that empowers users to quickly capture their thoughts, experiences, and memories through multiple input methods (voice, text, images/videos). Leveraging local LLM capabilities, it intelligently assists users in recording, expanding, summarizing, searching, and categorizing their diary moments.

License

Notifications You must be signed in to change notification settings

xalanq/DiaryX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DiaryX

Flutter Dart Android API License

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.

🌟 Key Features

πŸ“ Multimodal Content Capture

  • 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

πŸ€– On-Device AI Processing

  • 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

πŸ’¬ AI Chat Companion

  • 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

πŸ“Š Personal Analytics

  • 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

πŸ”’ Privacy & Security

  • Local Storage: SQLite database with encrypted secure storage
  • No Data Collection: Zero telemetry or data sharing
  • Offline First: Complete functionality without cloud dependencies

πŸ›  Technical Stack

Frontend

  • Framework: Flutter 3.32.0
  • Language: Dart 3.8.1
  • State Management: Provider
  • UI Components: Material Design with custom themes

Backend & AI

  • 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

Platform Support

  • Android: API 24+ (Android 7.0 Nougat)
  • iOS: iOS 12.0+
  • Architecture: ARM64, x86_64

πŸ— Architecture Overview

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

Key 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

πŸš€ Getting Started

Prerequisites

  • 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)

Installation

  1. Clone the repository

    git clone https://github.com/xalanq/DiaryX.git
    cd DiaryX
  2. Install dependencies

    flutter pub get
  3. Generate code

    dart run build_runner build
  4. Setup MediaPipe Models

    # Download Gemma 3n models (instructions in docs/)
    # Place models in platform-specific directories

Running the App

# Development mode
flutter run

# Release mode
flutter run --release

# Specific platform
flutter run -d android
flutter run -d ios

Building

# Android APK
flutter build apk --release

# Android App Bundle
flutter build appbundle --release

# iOS
flutter build ios --release

πŸ§ͺ Development

Code Generation

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

Database Migrations

# Generate migration files
dart run drift_dev schema generate drift_schemas/app_database/

Testing

# Run all tests
flutter test

# Run with coverage
flutter test --coverage

Linting

# Analyze code
flutter analyze

# Fix formatting
dart format lib/ test/

πŸ“ Project Structure

Core Modules

  • /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

Platform-Specific Code

  • /android/app/src/main/kotlin/: Android native MediaPipe integration
  • /ios/Runner/: iOS native code (MediaPipe integration planned)

Configuration

  • pubspec.yaml: Dependencies and asset configuration
  • analysis_options.yaml: Dart linting rules
  • android/app/build.gradle.kts: Android build configuration

πŸ”§ Configuration

Environment Variables

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
}

AI Model Setup

  1. Download Gemma 3n models from the official repository
  2. Place models in the appropriate platform directories
  3. Update model paths in AIConfigService

🀝 Contributing

We welcome contributions! Please read our contributing guidelines before submitting PRs.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Style

  • Follow Dart style guide
  • Use dart format for consistent formatting
  • Ensure flutter analyze passes without warnings
  • Add tests for new features

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ for privacy-conscious journaling

About

DiaryX is a private, offline-first diary application that empowers users to quickly capture their thoughts, experiences, and memories through multiple input methods (voice, text, images/videos). Leveraging local LLM capabilities, it intelligently assists users in recording, expanding, summarizing, searching, and categorizing their diary moments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages