Skip to content

Repository files navigation

🧠 MindVault

A native Android study companion with uninterruptible focus sessions, intelligent app blocking, and detailed productivity analytics.

Landing Page Latest Release

OpenSSF Best Practices Kotlin Jetpack Compose Material 3 Firebase Room Min SDK 28 License: MIT


Overview

MindVault is an Android app designed for students who need enforced focus during study sessions. Once a focus session starts, it locks the device into a distraction-free state that cannot be interrupted until the timer completes. The app pairs this core mechanic with detailed study analytics, smart notifications, and cloud backup via Firebase.

Key Features

Feature Description
Uninterruptible Focus Mode Full-screen lock with foreground service, wake lock, and overlay protection. Once started, a session cannot be bypassed.
App Blocking Accessibility service monitors and blocks distracting apps during active sessions
Smart Scheduling Configurable study/sleep windows with automatic session availability detection
Productivity Analytics Pie charts, weekly screen-time breakdowns, streak tracking, and session history
Achievement System Gamified milestones to reward consistent study habits
Cloud Sync Firebase Auth + Firestore for cross-device backup and profile management
Daily Motivation Scheduled motivational notifications via WorkManager
Security App-level password protection and developer settings guard

Architecture

graph TB
    subgraph Presentation["UI Layer β€” Jetpack Compose"]
        MA[MainActivity]
        FM[FocusModeSetupActivity]
        SA[StatisticsActivity]
        PA[ProfileActivity]
        LA[LoginActivity]
    end

    subgraph Domain["ViewModel + Logic"]
        VM[FocusModeSetupViewModel]
        SM[StatisticsManager]
        PM[PermissionManager]
        AM[AppManager]
    end

    subgraph Data["Data Layer"]
        DS[FocusDataStore β€” Preferences]
        RM[Room Database β€” Sessions]
        FS[Firebase Auth + Firestore]
        APM[AppPasswordManager]
    end

    subgraph Services["Background Services"]
        FG[FocusAccessibilityService]
        NL[NotificationListenerService]
        WM[WorkManager β€” Reminders & Backup]
        BR[BootReceiver]
    end

    MA --> VM --> DS
    MA --> SM --> RM
    SA --> SM
    PA --> FS
    LA --> FS
    FM --> VM
    VM --> AM
    FG --> AM
    WM --> FS
    BR --> WM
Loading

Tech Stack

Layer Technology
Language Kotlin
UI Jetpack Compose, Material Design 3
Architecture MVVM with ViewModel + StateFlow
Local Storage Room (sessions), DataStore (preferences)
Cloud Firebase Auth, Firestore (sync & backup)
Background Foreground Service, AccessibilityService, WorkManager
Auth Google Sign-In via Credential Manager
Image Loading Coil
Serialization Gson
Build Gradle KTS with version catalogs

Project Structure

mindvault/
β”œβ”€β”€ app/src/main/java/com/example/mindvault/
β”‚   β”œβ”€β”€ MainActivity.kt                # Main entry, home screen, navigation
β”‚   β”œβ”€β”€ MindVaultApplication.kt        # Application class, dependency setup
β”‚   β”œβ”€β”€ AppBlockedActivity.kt          # Overlay shown when blocked app is opened
β”‚   β”œβ”€β”€ BootReceiver.kt                # Re-schedule workers on device restart
β”‚   β”‚
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ FocusDataStore.kt          # DataStore preferences wrapper
β”‚   β”‚   β”œβ”€β”€ FocusSession.kt            # Room entity + DAO
β”‚   β”‚   β”œβ”€β”€ StatisticsManager.kt       # Aggregation logic for analytics
β”‚   β”‚   β”œβ”€β”€ AuthManager.kt             # Firebase Auth wrapper
β”‚   β”‚   β”œβ”€β”€ UserManager.kt             # Firestore user profile CRUD
β”‚   β”‚   β”œβ”€β”€ AppPasswordManager.kt      # Encrypted app lock
β”‚   β”‚   └── BackupSyncWorker.kt        # Periodic Firestore sync via WorkManager
β”‚   β”‚
β”‚   β”œβ”€β”€ model/
β”‚   β”‚   └── FocusModels.kt             # Domain models and enums
β”‚   β”‚
β”‚   β”œβ”€β”€ notifications/
β”‚   β”‚   β”œβ”€β”€ NotificationHelper.kt      # Channel setup + notification builder
β”‚   β”‚   β”œβ”€β”€ FocusReminderScheduler.kt  # Schedule daily study reminders
β”‚   β”‚   β”œβ”€β”€ FocusReminderWorker.kt     # WorkManager worker for reminders
β”‚   β”‚   β”œβ”€β”€ MotivationScheduler.kt     # Schedule motivational quotes
β”‚   β”‚   └── DailyMotivationWorker.kt   # WorkManager worker for motivation
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ FocusAccessibilityService.kt      # Monitors and blocks apps
β”‚   β”‚   └── FocusNotificationListenerService.kt # Manages notification suppression
β”‚   β”‚
β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”œβ”€β”€ FocusModeSetupActivity.kt  # Session configuration screen
β”‚   β”‚   β”œβ”€β”€ FocusModeSetupViewModel.kt # ViewModel for focus setup
β”‚   β”‚   β”œβ”€β”€ LockScreenActivity.kt      # Full-screen lock during sessions
β”‚   β”‚   β”œβ”€β”€ StatisticsActivity.kt      # Analytics dashboard
β”‚   β”‚   β”œβ”€β”€ ProfileActivity.kt         # User profile management
β”‚   β”‚   β”œβ”€β”€ LoginActivity.kt           # Firebase auth flow
β”‚   β”‚   β”œβ”€β”€ AchievementsActivity.kt    # Gamified milestones
β”‚   β”‚   β”œβ”€β”€ SecurityActivity.kt        # App lock settings
β”‚   β”‚   β”œβ”€β”€ PieChartComponents.kt      # Custom Compose chart components
β”‚   β”‚   β”œβ”€β”€ PremiumAnalyticsComponents.kt # Analytics card composables
β”‚   β”‚   β”œβ”€β”€ WeeklyComponents.kt        # Weekly breakdown UI
β”‚   β”‚   β”œβ”€β”€ WeeklyScreenTimeChart.kt   # Screen time visualization
β”‚   β”‚   └── theme/                     # Material 3 color, type, theme
β”‚   β”‚
β”‚   └── utils/
β”‚       β”œβ”€β”€ AppManager.kt             # App list and blocking logic
β”‚       β”œβ”€β”€ OverlayBlocker.kt         # System overlay protection
β”‚       β”œβ”€β”€ PermissionManager.kt      # Runtime permission handling
β”‚       └── UsageStatsHelper.kt       # Android UsageStats API wrapper
β”‚
β”œβ”€β”€ build.gradle.kts                   # App-level build config
β”œβ”€β”€ settings.gradle.kts                # Project settings
└── gradle/                            # Gradle wrapper + version catalog

Getting Started

Prerequisites

  • Android Studio Ladybug (2024.2) or newer
  • JDK 11+
  • Android SDK 36 (compile) / 28 (min)
  • A Firebase project with Auth and Firestore enabled

1. Clone

git clone https://github.com/WelcomeLegend-Git/mindvault.git
cd mindvault

2. Firebase Setup

  1. Create a Firebase project at console.firebase.google.com
  2. Add an Android app with package name com.example.mindvault
  3. Download google-services.json and place it in app/
  4. Enable Authentication (Google Sign-In) and Firestore Database

3. Build & Run

./gradlew assembleDebug

Or open the project in Android Studio and click Run.


Permissions

Permission Purpose
SYSTEM_ALERT_WINDOW Overlay to block apps during focus sessions
FOREGROUND_SERVICE Persistent focus session timer
WAKE_LOCK Prevent device sleep during sessions
ACCESSIBILITY_SERVICE Monitor and intercept app launches
NOTIFICATION_LISTENER Suppress distracting notifications
USAGE_STATS Screen time analytics
RECEIVE_BOOT_COMPLETED Reschedule workers after restart

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages