๐ŸŽฏ Enhanced uHabits Analytics

Advanced Group-Based Habit Performance Dashboard

Last updated:

API:

Loading group analytics...

๐Ÿ“ˆ Overall Group Performance Comparison
๐Ÿ“Š Habit Distribution by Group
๐Ÿ•Œ

Religious

Spiritual and religious practices

Total Habits
Average Score
Performance Grade
Total Points
High Priority
Active Streaks

๐Ÿ“‹ Individual Habits

No habits in this group yet.

Add habits to this group in your mobile app to see them here.

๐Ÿ“ˆ Religious - Individual Habit Performance
๐Ÿ’ผ

Career & Work

Professional development and work tasks

Total Habits
Average Score
Performance Grade
Total Points
High Priority
Active Streaks

๐Ÿ“‹ Individual Habits

No habits in this group yet.

Add habits to this group in your mobile app to see them here.

๐Ÿ“ˆ Career & Work - Individual Habit Performance
๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ

Social & Family

Family time and social relationships

Total Habits
Average Score
Performance Grade
Total Points
High Priority
Active Streaks

๐Ÿ“‹ Individual Habits

No habits in this group yet.

Add habits to this group in your mobile app to see them here.

๐Ÿ“ˆ Social & Family - Individual Habit Performance
๐ŸŒŸ

Personal Improvement

Health, fitness, and self-development

Total Habits
Average Score
Performance Grade
Total Points
High Priority
Active Streaks

๐Ÿ“‹ Individual Habits

No habits in this group yet.

Add habits to this group in your mobile app to see them here.

๐Ÿ“ˆ Personal Improvement - Individual Habit Performance

System Debug Information

Last API URL:

API Response Analysis

Data Format:
Category Field Detection:
  • Category field present:
  • Field name used:
  • Sample value:
Category Distribution:

    Group Assignment Results

    Detailed Habit Information

    Name Group Raw Category Score Priority

    Debugging Tools

    Raw API Data
    
                    
    Detected Mapping Issues
    AWS Storage Analysis

    Use this section to understand how categories are stored in AWS and fix them at the source.

    Database Structure Analysis
    • Storage Method: Habits are likely stored in DynamoDB tables or S3 buckets
    • Category Field:
    • Category Data Type:
    • Potential Category Fields:
    Fix Instructions
    1. Step 1: Identify the AWS resource storing your habit data
    2. Step 2: Use AWS Console or CLI to examine and modify the data
    3. Step 3: Update your mobile app to use consistent category values
    AWS CLI Commands for Data Inspection
    # List DynamoDB tables
    aws dynamodb list-tables --region eu-central-1
    
    # Scan a table (replace TABLE_NAME)
    aws dynamodb scan --table-name TABLE_NAME --region eu-central-1
    
    # Query for habits (replace TABLE_NAME and USER_ID)
    aws dynamodb query --table-name TABLE_NAME \
      --key-condition-expression "userId = :uid" \
      --expression-attribute-values '{":uid":{"S":"USER_ID"}}' \
      --region eu-central-1
    
    # Export S3 bucket data (replace BUCKET_NAME)
    aws s3 sync s3://BUCKET_NAME ./exported-data --region eu-central-1
    
    AWS Storage Analysis

    Use this section to understand how categories are stored in AWS and fix them at the source.

    Database Structure Analysis
    • Storage Method: Habits are likely stored in DynamoDB tables or S3 buckets
    • Category Field:
    • Category Data Type:
    Fix Instructions
    1. Step 1: Identify the AWS resource storing your habit data
    2. Step 2: Use AWS Console or CLI to examine and modify the data
    3. Step 3: Update your mobile app to use consistent category values
    AWS CLI Commands for Data Inspection
    # List DynamoDB tables
    aws dynamodb list-tables --region eu-central-1
    
    # Scan a table (replace TABLE_NAME)
    aws dynamodb scan --table-name TABLE_NAME --region eu-central-1
    
    # Query for habits (replace TABLE_NAME and USER_ID)
    aws dynamodb query --table-name TABLE_NAME \
      --key-condition-expression "userId = :uid" \
      --expression-attribute-values '{":uid":{"S":"USER_ID"}}' \
      --region eu-central-1
    
    # Export S3 bucket data (replace BUCKET_NAME)
    aws s3 sync s3://BUCKET_NAME ./exported-data --region eu-central-1
    

    Manual Category Reassignment

    Note: This is a temporary solution for testing. For permanent fixes, update categories in your Android app.

    Mobile App & AWS Fix Guide

    Follow these steps to permanently fix category issues at the source.

    Android App Fix
    1. Check the Category Field: In your Android app code, look for how categories are defined.
      // Possible locations in Android code:
      // 1. Habit model class
      public class Habit {
          private String category;  // Check how this is defined
      }
      
      // 2. When saving habits
      habit.setCategory("Personal");  // Check what values are used
      
    2. Standardize Categories: Update your Android code to use consistent category names:
      // Define constants for categories
      public static final String CATEGORY_RELIGIOUS = "Religious";
      public static final String CATEGORY_CAREER = "Career & Work";
      public static final String CATEGORY_SOCIAL = "Social & Family";
      public static final String CATEGORY_PERSONAL = "Personal Improvement";
      
      // Use these constants when saving habits
      habit.setCategory(CATEGORY_RELIGIOUS);
      
    3. Update UI: Ensure your habit creation/editing UI presents these standard categories.
    4. Migrate Existing Data: Add code to migrate existing habits to the new category scheme.
    AWS Database Fix
    1. Locate your data: Determine if you're using DynamoDB, S3, or another storage service.
    2. Export current data: Make a backup before making changes.
      # For DynamoDB
      aws dynamodb export-table-to-point-in-time \
        --table-arn arn:aws:dynamodb:eu-central-1:ACCOUNT_ID:table/TABLE_NAME \
        --s3-bucket BACKUP_BUCKET \
        --s3-prefix "backups/habits" \
        --export-format DYNAMODB_JSON
    3. Create update script: Write a script to standardize categories in your database:
      import boto3
      import json
      
      dynamodb = boto3.resource('dynamodb')
      table = dynamodb.Table('YOUR_TABLE_NAME')
      
      # Category mapping
      category_map = {
          # Map existing categories to standard ones
          'Personal': 'Personal Improvement',
          'personal': 'Personal Improvement',
          'PERSONAL': 'Personal Improvement',
          # Add more mappings based on your data
      }
      
      # Scan the table for habits
      response = table.scan()
      items = response['Items']
      
      # Update each item with standardized category
      for item in items:
          if 'category' in item:
              old_category = item['category']
              if old_category in category_map:
                  new_category = category_map[old_category]
                  
                  # Update the item
                  table.update_item(
                      Key={'id': item['id']},
                      UpdateExpression='SET category = :cat',
                      ExpressionAttributeValues={':cat': new_category}
                  )
                  print(f"Updated {item['name']} from {old_category} to {new_category}")
    4. Run and verify: Run your script and verify the data is updated correctly.
    Advanced Database Inspection

    If you need to analyze the data structure in more detail:

    import boto3
    import json
    from collections import defaultdict
    
    # Connect to DynamoDB
    dynamodb = boto3.resource('dynamodb')
    table = dynamodb.Table('YOUR_TABLE_NAME')
    
    # Analyze category field
    response = table.scan()
    items = response['Items']
    
    # Analyze all fields that might contain category information
    field_values = defaultdict(set)
    field_types = {}
    
    print(f"Analyzing {len(items)} records...")
    
    # First pass - identify fields and their types
    for item in items:
        for field, value in item.items():
            value_type = type(value).__name__
            field_values[field].add(str(value))
            field_types[field] = value_type
    
    # Look for fields that might be categories
    potential_category_fields = []
    for field, values in field_values.items():
        # If field has a small number of distinct values, it might be categorical
        if 1 < len(values) < 10:
            potential_category_fields.append(field)
        # Or if the field name suggests it's a category
        elif any(kw in field.lower() for kw in ['category', 'group', 'type']):
            potential_category_fields.append(field)
    
    print("\nPotential category fields:")
    for field in potential_category_fields:
        print(f"- {field} ({field_types.get(field, 'unknown')}): {', '.join(list(field_values[field])[:5])}")
    
    # If you find the correct field, print detailed distribution
    category_field = potential_category_fields[0] if potential_category_fields else None
    if category_field:
        category_counts = defaultdict(int)
        for item in items:
            if category_field in item:
                category_counts[str(item[category_field])] += 1
        
        print(f"\nCategory distribution for field '{category_field}':")
        for category, count in sorted(category_counts.items(), key=lambda x: -x[1]):
            print(f"- {category}: {count} items")

    Mobile App & AWS Fix Guide

    Follow these steps to permanently fix category issues at the source.

    Android App Fix
    1. Check the Category Field: In your Android app code, look for how categories are defined.
      // Possible locations in Android code:
      // 1. Habit model class
      public class Habit {
          private String category;  // Check how this is defined
      }
      
      // 2. When saving habits
      habit.setCategory("Personal");  // Check what values are used
      
    2. Standardize Categories: Update your Android code to use consistent category names:
      // Define constants for categories
      public static final String CATEGORY_RELIGIOUS = "Religious";
      public static final String CATEGORY_CAREER = "Career & Work";
      public static final String CATEGORY_SOCIAL = "Social & Family";
      public static final String CATEGORY_PERSONAL = "Personal Improvement";
      
      // Use these constants when saving habits
      habit.setCategory(CATEGORY_RELIGIOUS);
      
    3. Update UI: Ensure your habit creation/editing UI presents these standard categories.
    4. Migrate Existing Data: Add code to migrate existing habits to the new category scheme.
    AWS Database Fix
    1. Locate your data: Determine if you're using DynamoDB, S3, or another storage service.
    2. Export current data: Make a backup before making changes.
      # For DynamoDB
      aws dynamodb export-table-to-point-in-time \
        --table-arn arn:aws:dynamodb:eu-central-1:ACCOUNT_ID:table/TABLE_NAME \
        --s3-bucket BACKUP_BUCKET \
        --s3-prefix "backups/habits" \
        --export-format DYNAMODB_JSON
    3. Create update script: Write a script to standardize categories in your database:
      import boto3
      import json
      
      dynamodb = boto3.resource('dynamodb')
      table = dynamodb.Table('YOUR_TABLE_NAME')
      
      # Category mapping
      category_map = {
          # Map existing categories to standard ones
          'Personal': 'Personal Improvement',
          'personal': 'Personal Improvement',
          'PERSONAL': 'Personal Improvement',
          # Add more mappings based on your data
      }
      
      # Scan the table for habits
      response = table.scan()
      items = response['Items']
      
      # Update each item with standardized category
      for item in items:
          if 'category' in item:
              old_category = item['category']
              if old_category in category_map:
                  new_category = category_map[old_category]
                  
                  # Update the item
                  table.update_item(
                      Key={'id': item['id']},
                      UpdateExpression='SET category = :cat',
                      ExpressionAttributeValues={':cat': new_category}
                  )
                  print(f"Updated {item['name']} from {old_category} to {new_category}")
    4. Run and verify: Run your script and verify the data is updated correctly.