Skip to content

kaifansariw/MindBloom

Repository files navigation

🌿 MindBloom - Mental Health App

Android (Java) + SQLite Database

A beautiful green & white themed mental health app with mood tracking, journaling, meditation, and wellness insights.


📁 Project Structure

MindBloom/
├── app/
│   ├── build.gradle
│   └── src/main/
│       ├── AndroidManifest.xml
│       ├── java/com/mindbloom/
│       │   ├── activities/
│       │   │   └── MainActivity.java          ← App entry, Bottom Nav
│       │   ├── database/
│       │   │   ├── DatabaseHelper.java        ← SQLite setup + seed data
│       │   │   ├── MoodDAO.java               ← Mood CRUD operations
│       │   │   ├── JournalDAO.java            ← Journal CRUD operations
│       │   │   ├── MeditationDAO.java         ← Sessions + affirmations
│       │   │   └── StreakDAO.java             ← Streak logic
│       │   ├── models/
│       │   │   ├── MoodLog.java
│       │   │   ├── JournalEntry.java
│       │   │   ├── MeditationSession.java
│       │   │   └── Streak.java
│       │   ├── fragments/
│       │   │   ├── HomeFragment.java          ← Dashboard
│       │   │   ├── MoodFragment.java          ← Mood check-in
│       │   │   ├── JournalFragment.java       ← Journal list + new entry
│       │   │   ├── MeditateFragment.java      ← Meditation player
│       │   │   └── InsightsFragment.java      ← Analytics & charts
│       │   └── adapters/
│       │       ├── JournalAdapter.java
│       │       └── MeditationAdapter.java
│       └── res/
│           ├── layout/
│           │   ├── activity_main.xml
│           │   ├── fragment_home.xml
│           │   ├── fragment_mood.xml
│           │   ├── fragment_journal.xml
│           │   ├── fragment_meditate.xml
│           │   ├── fragment_insights.xml
│           │   ├── item_journal_entry.xml
│           │   └── item_meditation_session.xml
│           ├── values/
│           │   ├── colors.xml                 ← Green & white palette
│           │   ├── strings.xml
│           │   └── themes.xml
│           ├── drawable/                      ← Shapes, gradients, icons
│           └── menu/
│               └── bottom_nav_menu.xml
├── build.gradle
└── settings.gradle

🗄️ SQLite Database Schema

Tables

Table Purpose
users User profile
mood_logs Daily mood check-ins
journal_entries Journal writings
meditation_sessions Available sessions
session_logs Completed sessions
affirmations Daily affirmations pool
streaks Streak tracking

Key Queries

-- Today's mood
SELECT * FROM mood_logs WHERE user_id=1 AND date=date('now');

-- Weekly average
SELECT AVG(mood_score) FROM mood_logs
WHERE user_id=1 AND date >= date('now', '-6 days');

-- Search journals
SELECT * FROM journal_entries
WHERE user_id=1 AND (title LIKE '%?%' OR content LIKE '%?%');

-- Random affirmation
SELECT text FROM affirmations ORDER BY RANDOM() LIMIT 1;

✨ Features

🏠 Home Dashboard

  • Daily streak counter
  • Random affirmation with refresh
  • Today's mood display
  • Quick access to Journal & Meditation
  • Stats cards (avg mood, entries, sessions)
  • Weekly mood bar chart (built programmatically)
  • Recent journal entries

😊 Mood Tracker

  • 6 emoji mood selectors (Sad → Amazing)
  • 10 emotion tags via ChipGroup
  • Optional mood note
  • SQLite insertion with auto-date
  • Streak auto-update on check-in

📖 Journal

  • Full entry list with search
  • Favorite/unfavorite toggle
  • Writing prompts (5 built-in)
  • New entry form with title + content
  • Entries stored in SQLite with date

🧘 Meditation

  • 7 pre-seeded sessions (from SQLite)
  • Animated breathing circle (ObjectAnimator)
  • Inhale → Hold → Exhale cycle
  • Countdown timer per session
  • Session log saved to SQLite on complete

📊 Insights

  • Avg mood, journal count, meditation minutes, streak stats
  • Weekly bar chart (dynamic, drawn in Java)
  • Emotion frequency bars with animated fill

🛠️ Setup Instructions

Step 1: Import into Android Studio

  1. Open Android Studio
  2. File → Open → Select the MindBloom folder
  3. Wait for Gradle sync

Step 2: Dependencies (auto-resolved)

  • com.google.android.material:material:1.11.0
  • androidx.appcompat:appcompat:1.6.1
  • androidx.recyclerview:recyclerview:1.3.2
  • androidx.work:work-runtime:2.9.0

Step 3: Run

  • Connect Android device or start emulator (API 24+)
  • Click ▶ Run
  • Database auto-creates and seeds on first launch

🎨 Design System

Token Value
green_darkest #1B5E20
green_dark #2E7D32
green_medium #388E3C
green_accent #43A047
green_light #81C784
green_surface #E8F5E9
green_background #F0FAF0
white #FFFFFF

All cards use bg_card.xml (white, 20dp radius, green border). Headers use bg_header_gradient.xml (dark → medium green).


🔧 Extending the App

Add Notifications

// In MoodFragment, after saving mood:
NotificationHelper.scheduleDailyReminder(
    requireContext(), 20, 0, "How are you feeling tonight? 🌙"
);

Add New Meditation Session

// Insert via MeditationDAO or directly in DatabaseHelper.seedData():
db.execSQL("INSERT INTO meditation_sessions (title, duration, category, icon, audio_url) " +
    "VALUES ('Gratitude', '6 min', 'Mindfulness', '🙏', '');");

Export Journal as PDF

// Use Android's PdfDocument class in JournalFragment
PdfDocument document = new PdfDocument();
// ... add pages with journal content
document.writeTo(outputStream);

📌 Min Requirements

  • Android API 24+ (Android 7.0)
  • Java 8
  • Android Studio Hedgehog or later

About

MindBloom is a beautiful, intuitive, and feature-rich mental health application designed to help users track their emotional well-being, cultivate mindfulness, and build lasting positive habits. With its calming green-and-white design system, MindBloom provides a safe and serene digital space for self-reflection and growth.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages