mirror of
https://github.com/Dvorinka/1356.git
synced 2026-07-29 13:43:49 +00:00
cleanup
This commit is contained in:
@@ -1,608 +0,0 @@
|
||||
# App Performance Monitoring & Analytics Setup Guide
|
||||
|
||||
**Project:** LifeTimer
|
||||
**Version:** 1.0.0
|
||||
**Date:** 2026-01-03
|
||||
|
||||
## Overview
|
||||
|
||||
This guide covers setting up production-ready analytics and performance monitoring for the LifeTimer app. The current implementation includes a placeholder analytics service that needs to be replaced with a real analytics provider.
|
||||
|
||||
## Recommended Solutions
|
||||
|
||||
### 1. Firebase Analytics (Primary Recommendation)
|
||||
|
||||
**Why Firebase Analytics?**
|
||||
- Free tier with generous limits
|
||||
- Seamless integration with Flutter
|
||||
- Real-time analytics
|
||||
- User properties and event tracking
|
||||
- Integration with Firebase Crashlytics
|
||||
- Works well with Supabase
|
||||
|
||||
**Setup Steps:**
|
||||
|
||||
#### Step 1: Add Dependencies
|
||||
|
||||
Add to `pubspec.yaml`:
|
||||
```yaml
|
||||
dependencies:
|
||||
firebase_core: ^2.24.2
|
||||
firebase_analytics: ^10.7.4
|
||||
firebase_crashlytics: ^3.4.9
|
||||
firebase_performance: ^0.9.3+11
|
||||
```
|
||||
|
||||
#### Step 2: Initialize Firebase
|
||||
|
||||
Create `lib/bootstrap/firebase.dart`:
|
||||
```dart
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||
import 'package:firebase_performance/firebase_performance.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
Future<void> initializeFirebase() async {
|
||||
await Firebase.initializeApp();
|
||||
|
||||
// Initialize Analytics
|
||||
FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(true);
|
||||
|
||||
// Initialize Crashlytics
|
||||
FlutterError.onError = (errorDetails) {
|
||||
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
|
||||
};
|
||||
PlatformDispatcher.instance.onError = (error, stack) {
|
||||
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
|
||||
return true;
|
||||
};
|
||||
|
||||
// Initialize Performance Monitoring
|
||||
await FirebasePerformance.instance.setPerformanceCollectionEnabled(true);
|
||||
}
|
||||
```
|
||||
|
||||
Update `lib/bootstrap/bootstrap.dart`:
|
||||
```dart
|
||||
Future<void> bootstrap() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await initializeFirebase();
|
||||
await Supabase.initialize(
|
||||
url: Env.supabaseUrl,
|
||||
anonKey: Env.supabaseAnonKey,
|
||||
);
|
||||
|
||||
initializeSupabaseClient();
|
||||
}
|
||||
```
|
||||
|
||||
#### Step 3: Update Analytics Service
|
||||
|
||||
Update `lib/core/services/analytics_service.dart`:
|
||||
```dart
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||
|
||||
class AnalyticsService {
|
||||
static final AnalyticsService _instance = AnalyticsService._internal();
|
||||
factory AnalyticsService() => _instance;
|
||||
AnalyticsService._internal();
|
||||
|
||||
final FirebaseAnalytics _analytics = FirebaseAnalytics.instance;
|
||||
final FirebaseCrashlytics _crashlytics = FirebaseCrashlytics.instance;
|
||||
|
||||
bool _isInitialized = false;
|
||||
|
||||
Future<void> initialize() async {
|
||||
_isInitialized = true;
|
||||
await _analytics.setAnalyticsCollectionEnabled(true);
|
||||
}
|
||||
|
||||
void setUserId(String userId) {
|
||||
_analytics.setUserId(id: userId);
|
||||
}
|
||||
|
||||
void setUserProperty(String name, dynamic value) {
|
||||
_analytics.setUserProperty(name: name, value: value.toString());
|
||||
}
|
||||
|
||||
void logEvent(String eventName, {Map<String, dynamic>? parameters}) {
|
||||
_analytics.logEvent(
|
||||
name: eventName,
|
||||
parameters: parameters?.map(
|
||||
(key, value) => MapEntry(key, value.toString()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void logSignUp({required String method}) {
|
||||
_analytics.logSignUp(signUpMethod: method);
|
||||
}
|
||||
|
||||
void logSignIn({required String method}) {
|
||||
_analytics.logLogin(loginMethod: method);
|
||||
}
|
||||
|
||||
void logSignOut() {
|
||||
// Firebase doesn't have a built-in sign out event
|
||||
logEvent('sign_out');
|
||||
}
|
||||
|
||||
void logGoalCreated({required String goalId, required String hasLocation, required String hasImage}) {
|
||||
logEvent('goal_created', parameters: {
|
||||
'goal_id': goalId,
|
||||
'has_location': hasLocation,
|
||||
'has_image': hasImage,
|
||||
});
|
||||
}
|
||||
|
||||
void logGoalUpdated({required String goalId}) {
|
||||
logEvent('goal_updated', parameters: {'goal_id': goalId});
|
||||
}
|
||||
|
||||
void logGoalCompleted({required String goalId, required int daysInChallenge}) {
|
||||
logEvent('goal_completed', parameters: {
|
||||
'goal_id': goalId,
|
||||
'days_in_challenge': daysInChallenge,
|
||||
});
|
||||
}
|
||||
|
||||
void logGoalDeleted({required String goalId}) {
|
||||
logEvent('goal_deleted', parameters: {'goal_id': goalId});
|
||||
}
|
||||
|
||||
void logCountdownStarted({required String startDate, required String endDate}) {
|
||||
logEvent('countdown_started', parameters: {
|
||||
'start_date': startDate,
|
||||
'end_date': endDate,
|
||||
});
|
||||
}
|
||||
|
||||
void logCountdownViewed() {
|
||||
_analytics.logScreenView(screenName: 'home_countdown');
|
||||
}
|
||||
|
||||
void logProfileUpdated({required String fieldsUpdated}) {
|
||||
logEvent('profile_updated', parameters: {
|
||||
'fields_updated': fieldsUpdated,
|
||||
});
|
||||
}
|
||||
|
||||
void logProfileVisibilityChanged({required bool isPublic}) {
|
||||
logEvent('profile_visibility_changed', parameters: {
|
||||
'is_public': isPublic,
|
||||
});
|
||||
}
|
||||
|
||||
void logOnboardingCompleted() {
|
||||
logEvent('onboarding_completed');
|
||||
}
|
||||
|
||||
void logOnboardingStepCompleted({required String stepName}) {
|
||||
logEvent('onboarding_step_completed', parameters: {
|
||||
'step_name': stepName,
|
||||
});
|
||||
}
|
||||
|
||||
void logSettingsChanged({required String settingName, required String value}) {
|
||||
logEvent('settings_changed', parameters: {
|
||||
'setting_name': settingName,
|
||||
'value': value,
|
||||
});
|
||||
}
|
||||
|
||||
void logNotificationEnabled({required String notificationType}) {
|
||||
logEvent('notification_enabled', parameters: {
|
||||
'notification_type': notificationType,
|
||||
});
|
||||
}
|
||||
|
||||
void logNotificationDisabled({required String notificationType}) {
|
||||
logEvent('notification_disabled', parameters: {
|
||||
'notification_type': notificationType,
|
||||
});
|
||||
}
|
||||
|
||||
void logError({required String error, String? context}) {
|
||||
_crashlytics.recordError(
|
||||
error,
|
||||
null,
|
||||
fatal: false,
|
||||
information: context != null ? [context] : null,
|
||||
);
|
||||
}
|
||||
|
||||
void logScreenView({required String screenName}) {
|
||||
_analytics.logScreenView(screenName: screenName);
|
||||
}
|
||||
|
||||
void reset() {
|
||||
_analytics.resetAnalyticsData();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Step 4: Configure Firebase Console
|
||||
|
||||
1. Go to [Firebase Console](https://console.firebase.google.com/)
|
||||
2. Create a new project: "LifeTimer"
|
||||
3. Add Android app:
|
||||
- Package name: `com.lifetimer.app`
|
||||
- Download `google-services.json`
|
||||
- Place in `android/app/`
|
||||
4. Add iOS app:
|
||||
- Bundle ID: `com.lifetimer.app`
|
||||
- Download `GoogleService-Info.plist`
|
||||
- Place in `ios/Runner/`
|
||||
|
||||
#### Step 5: Configure Android
|
||||
|
||||
Update `android/build.gradle`:
|
||||
```gradle
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath 'com.google.gms:google-services:4.4.0'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Update `android/app/build.gradle`:
|
||||
```gradle
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
```
|
||||
|
||||
#### Step 6: Configure iOS
|
||||
|
||||
Update `ios/Runner/Info.plist`:
|
||||
```xml
|
||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||
<false/>
|
||||
```
|
||||
|
||||
### 2. Alternative: Mixpanel Analytics
|
||||
|
||||
**Why Mixpanel?**
|
||||
- Advanced user segmentation
|
||||
- Funnel analysis
|
||||
- Cohort analysis
|
||||
- Real-time insights
|
||||
|
||||
**Setup Steps:**
|
||||
|
||||
Add to `pubspec.yaml`:
|
||||
```yaml
|
||||
dependencies:
|
||||
mixpanel_flutter: ^2.2.0
|
||||
```
|
||||
|
||||
Initialize in `lib/bootstrap/bootstrap.dart`:
|
||||
```dart
|
||||
import 'package:mixpanel_flutter/mixpanel_flutter.dart';
|
||||
|
||||
Future<void> initializeMixpanel() async {
|
||||
final mixpanel = await Mixpanel.init('YOUR_MIXPANEL_TOKEN');
|
||||
mixpanel.track('app_opened');
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Alternative: Sentry (Error Tracking)
|
||||
|
||||
**Why Sentry?**
|
||||
- Excellent error tracking
|
||||
- Performance monitoring
|
||||
- Release tracking
|
||||
- Breadcrumbs
|
||||
|
||||
**Setup Steps:**
|
||||
|
||||
Add to `pubspec.yaml`:
|
||||
```yaml
|
||||
dependencies:
|
||||
sentry_flutter: ^7.14.0
|
||||
```
|
||||
|
||||
Initialize in `lib/bootstrap/bootstrap.dart`:
|
||||
```dart
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
|
||||
Future<void> initializeSentry() async {
|
||||
await SentryFlutter.init(
|
||||
(options) {
|
||||
options.dsn = 'YOUR_SENTRY_DSN';
|
||||
options.tracesSampleRate = 1.0;
|
||||
options.profilesSampleRate = 1.0;
|
||||
},
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## Recommended Implementation
|
||||
|
||||
**Primary Stack:**
|
||||
- Firebase Analytics (user analytics)
|
||||
- Firebase Crashlytics (crash reporting)
|
||||
- Firebase Performance Monitoring (performance)
|
||||
|
||||
**Optional Add-ons:**
|
||||
- Sentry (additional error tracking)
|
||||
- Mixpanel (advanced user analytics)
|
||||
|
||||
## Key Events to Track
|
||||
|
||||
### User Acquisition
|
||||
- `app_opened` - First app open
|
||||
- `sign_up` - New user registration
|
||||
- `sign_in` - User login
|
||||
- `sign_out` - User logout
|
||||
|
||||
### Core Features
|
||||
- `onboarding_completed` - User finishes onboarding
|
||||
- `bucket_list_created` - User creates bucket list
|
||||
- `countdown_started` - User starts countdown
|
||||
- `goal_created` - User adds a goal
|
||||
- `goal_updated` - User updates a goal
|
||||
- `goal_completed` - User completes a goal
|
||||
- `goal_deleted` - User deletes a goal
|
||||
|
||||
### Engagement
|
||||
- `countdown_viewed` - User views countdown
|
||||
- `goals_viewed` - User views goals list
|
||||
- `profile_viewed` - User views profile
|
||||
- `social_feed_viewed` - User views social feed
|
||||
- `leaderboards_viewed` - User views leaderboards
|
||||
|
||||
### Settings
|
||||
- `settings_changed` - User changes settings
|
||||
- `notification_enabled` - User enables notifications
|
||||
- `notification_disabled` - User disables notifications
|
||||
- `theme_changed` - User changes theme
|
||||
|
||||
### Errors
|
||||
- `error` - Any error occurrence
|
||||
- `network_error` - Network-related errors
|
||||
- `auth_error` - Authentication errors
|
||||
|
||||
## User Properties to Track
|
||||
|
||||
- `user_id` - Unique user identifier
|
||||
- `sign_up_method` - Email, Google, or Apple
|
||||
- `countdown_started` - Boolean, has countdown started
|
||||
- `countdown_start_date` - Date countdown started
|
||||
- `goals_count` - Number of goals
|
||||
- `completed_goals_count` - Number of completed goals
|
||||
- `is_public_profile` - Profile visibility
|
||||
- `theme_preference` - Light, dark, or system
|
||||
- `notification_enabled` - Notifications status
|
||||
|
||||
## Performance Metrics to Monitor
|
||||
|
||||
### App Performance
|
||||
- App startup time
|
||||
- Screen load time
|
||||
- API response times
|
||||
- Database query times
|
||||
- Image loading times
|
||||
|
||||
### User Experience
|
||||
- Crash-free users
|
||||
- ANR (Application Not Responding) rate
|
||||
- Session duration
|
||||
- Screen flow analysis
|
||||
- Drop-off points
|
||||
|
||||
### Business Metrics
|
||||
- Daily Active Users (DAU)
|
||||
- Monthly Active Users (MAU)
|
||||
- Retention rate (Day 1, 7, 30)
|
||||
- Conversion rate (signup to countdown start)
|
||||
- Goal completion rate
|
||||
|
||||
## Logging Framework
|
||||
|
||||
Replace `print()` statements with proper logging:
|
||||
|
||||
Add to `pubspec.yaml`:
|
||||
```yaml
|
||||
dependencies:
|
||||
logger: ^2.0.2+1
|
||||
```
|
||||
|
||||
Create `lib/core/utils/logger.dart`:
|
||||
```dart
|
||||
import 'package:logger/logger.dart';
|
||||
|
||||
final logger = Logger(
|
||||
printer: PrettyPrinter(
|
||||
methodCount: 2,
|
||||
errorMethodCount: 8,
|
||||
lineLength: 120,
|
||||
colors: true,
|
||||
printEmojis: true,
|
||||
printTime: true,
|
||||
),
|
||||
);
|
||||
|
||||
final loggerNoStack = Logger(
|
||||
printer: PrettyPrinter(
|
||||
methodCount: 0,
|
||||
errorMethodCount: 0,
|
||||
lineLength: 120,
|
||||
colors: true,
|
||||
printEmojis: true,
|
||||
printTime: true,
|
||||
),
|
||||
);
|
||||
```
|
||||
|
||||
Usage:
|
||||
```dart
|
||||
// Instead of print('Analytics not initialized');
|
||||
logger.w('Analytics not initialized');
|
||||
|
||||
// Instead of print('Analytics Event: $eventData');
|
||||
logger.d('Analytics Event: $eventData');
|
||||
|
||||
// For errors
|
||||
logger.e('Error syncing mutation', error: e, stackTrace: stackTrace);
|
||||
```
|
||||
|
||||
## Privacy & Compliance
|
||||
|
||||
### Data Collection
|
||||
- Only collect necessary data
|
||||
- Anonymize user IDs where possible
|
||||
- Provide opt-out options
|
||||
- Follow GDPR and CCPA guidelines
|
||||
|
||||
### User Consent
|
||||
- Add consent dialog on first launch
|
||||
- Allow users to opt out of analytics
|
||||
- Provide privacy policy link
|
||||
- Implement data deletion on request
|
||||
|
||||
### Firebase Configuration
|
||||
```dart
|
||||
// Disable analytics collection for users who opt out
|
||||
await FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(false);
|
||||
|
||||
// Delete user data on account deletion
|
||||
await FirebaseAnalytics.instance.resetAnalyticsData();
|
||||
```
|
||||
|
||||
## Testing Analytics
|
||||
|
||||
### Local Testing
|
||||
1. Use Firebase DebugView for real-time event verification
|
||||
2. Test all event tracking flows
|
||||
3. Verify user properties are set correctly
|
||||
4. Test error reporting
|
||||
|
||||
### DebugView Setup
|
||||
```dart
|
||||
// Enable DebugView for development
|
||||
await FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(true);
|
||||
```
|
||||
|
||||
### Event Verification
|
||||
```dart
|
||||
// Test event tracking
|
||||
AnalyticsService().logEvent('test_event', parameters: {'test': 'value'});
|
||||
```
|
||||
|
||||
## Monitoring Dashboards
|
||||
|
||||
### Firebase Console Dashboards
|
||||
1. **Overview Dashboard** - Key metrics overview
|
||||
2. **Events Dashboard** - Event tracking
|
||||
3. **Conversions Dashboard** - Funnel analysis
|
||||
4. **Audiences Dashboard** - User segments
|
||||
5. **Retention Dashboard** - User retention
|
||||
|
||||
### Custom Dashboards
|
||||
Create custom dashboards for:
|
||||
- Countdown start funnel
|
||||
- Goal completion rate
|
||||
- User engagement metrics
|
||||
- Error rates
|
||||
- Performance metrics
|
||||
|
||||
## Alerts & Notifications
|
||||
|
||||
### Set Up Alerts
|
||||
1. **Crash Rate Alert** - Notify when crash rate exceeds threshold
|
||||
2. **Error Rate Alert** - Notify when error rate spikes
|
||||
3. **Performance Alert** - Notify when app performance degrades
|
||||
4. **User Drop-off Alert** - Notify when drop-off increases
|
||||
|
||||
### Alert Configuration
|
||||
- Set appropriate thresholds
|
||||
- Configure notification channels (email, Slack, etc.)
|
||||
- Define escalation procedures
|
||||
- Document alert responses
|
||||
|
||||
## Documentation
|
||||
|
||||
### Analytics Documentation
|
||||
- Document all events tracked
|
||||
- Document user properties
|
||||
- Document funnels and conversions
|
||||
- Maintain analytics dictionary
|
||||
|
||||
### Team Training
|
||||
- Train team on analytics tools
|
||||
- Establish analytics review process
|
||||
- Create analytics best practices guide
|
||||
- Regular analytics reviews
|
||||
|
||||
## Implementation Checklist
|
||||
|
||||
### Firebase Setup
|
||||
- [ ] Create Firebase project
|
||||
- [ ] Add Android app to Firebase
|
||||
- [ ] Add iOS app to Firebase
|
||||
- [ ] Download configuration files
|
||||
- [ ] Add dependencies to pubspec.yaml
|
||||
- [ ] Initialize Firebase in bootstrap
|
||||
- [ ] Configure Android build files
|
||||
- [ ] Configure iOS Info.plist
|
||||
- [ ] Test Firebase integration
|
||||
|
||||
### Analytics Implementation
|
||||
- [ ] Update AnalyticsService with Firebase
|
||||
- [ ] Implement all event tracking
|
||||
- [ ] Set user properties
|
||||
- [ ] Test event tracking
|
||||
- [ ] Verify in Firebase DebugView
|
||||
|
||||
### Crashlytics Setup
|
||||
- [ ] Initialize Crashlytics
|
||||
- [ ] Configure error reporting
|
||||
- [ ] Test crash reporting
|
||||
- [ ] Verify in Firebase Console
|
||||
|
||||
### Performance Monitoring
|
||||
- [ ] Initialize Performance Monitoring
|
||||
- [ ] Add custom traces
|
||||
- [ ] Monitor app startup
|
||||
- [ ] Monitor screen loads
|
||||
- [ ] Monitor API calls
|
||||
|
||||
### Logging Framework
|
||||
- [ ] Add logger dependency
|
||||
- [ ] Create logger utility
|
||||
- [ ] Replace all print() statements
|
||||
- [ ] Configure log levels
|
||||
|
||||
### Privacy & Compliance
|
||||
- [ ] Add consent dialog
|
||||
- [ ] Implement opt-out functionality
|
||||
- [ ] Update privacy policy
|
||||
- [ ] Test data deletion
|
||||
|
||||
### Monitoring & Alerts
|
||||
- [ ] Set up Firebase dashboards
|
||||
- [ ] Create custom dashboards
|
||||
- [ ] Configure alerts
|
||||
- [ ] Test alert notifications
|
||||
|
||||
### Documentation
|
||||
- [ ] Document all events
|
||||
- [ ] Create analytics dictionary
|
||||
- [ ] Train team
|
||||
- [ ] Establish review process
|
||||
|
||||
---
|
||||
|
||||
**Next Steps:**
|
||||
1. Set up Firebase project
|
||||
2. Add Firebase dependencies
|
||||
3. Implement Firebase Analytics
|
||||
4. Replace placeholder analytics service
|
||||
5. Set up Crashlytics
|
||||
6. Implement logging framework
|
||||
7. Test all tracking
|
||||
8. Configure monitoring dashboards
|
||||
9. Set up alerts
|
||||
10. Document analytics implementation
|
||||
@@ -1,140 +0,0 @@
|
||||
# APK Build Guide for LifeTimer Flutter App
|
||||
|
||||
## Current Status
|
||||
❌ **Build Issue**: The `sign_in_with_apple` plugin (version 5.0.0) has compilation errors with the current Flutter/Gradle setup.
|
||||
|
||||
## Root Cause
|
||||
The `sign_in_with_apple` plugin uses deprecated Flutter Android embedding APIs that are incompatible with the current Flutter version (3.38.5).
|
||||
|
||||
## Solutions
|
||||
|
||||
### Option 1: Quick Fix (Recommended for Testing)
|
||||
1. **Temporarily disable Apple Sign-In**:
|
||||
```bash
|
||||
cd lifetimer
|
||||
# Edit pubspec.yaml and comment out sign_in_with_apple
|
||||
sed -i 's/^ sign_in_with_apple:/ # sign_in_with_apple:/' pubspec.yaml
|
||||
|
||||
# Clean and rebuild
|
||||
flutter clean
|
||||
flutter pub get
|
||||
flutter build apk --debug
|
||||
```
|
||||
|
||||
2. **Install the APK**:
|
||||
```bash
|
||||
adb install build/app/outputs/flutter-apk/app-debug.apk
|
||||
```
|
||||
|
||||
### Option 2: Update Dependencies (Recommended for Production)
|
||||
Update the problematic dependencies to compatible versions:
|
||||
|
||||
1. **Update pubspec.yaml**:
|
||||
```yaml
|
||||
# Replace these versions
|
||||
sign_in_with_apple: ^6.0.0 # Updated version
|
||||
supabase_flutter: ^2.0.0 # Updated version
|
||||
```
|
||||
|
||||
2. **Run update commands**:
|
||||
```bash
|
||||
flutter pub upgrade
|
||||
flutter pub get
|
||||
flutter build apk --release
|
||||
```
|
||||
|
||||
### Option 3: Manual Build Commands
|
||||
|
||||
#### Debug APK (for testing)
|
||||
```bash
|
||||
cd lifetimer
|
||||
flutter clean
|
||||
flutter pub get
|
||||
flutter build apk --debug --target-platform android-arm64
|
||||
```
|
||||
|
||||
#### Release APK (for production)
|
||||
```bash
|
||||
cd lifetimer
|
||||
flutter clean
|
||||
flutter pub get
|
||||
flutter build apk --release --shrink
|
||||
```
|
||||
|
||||
## APK Location
|
||||
After successful build, the APK will be located at:
|
||||
- **Debug**: `lifetimer/build/app/outputs/flutter-apk/app-debug.apk`
|
||||
- **Release**: `lifetimer/build/app/outputs/flutter-apk/app-release.apk`
|
||||
|
||||
## Installation Commands
|
||||
|
||||
### Install via ADB
|
||||
```bash
|
||||
# Debug APK
|
||||
adb install lifetimer/build/app/outputs/flutter-apk/app-debug.apk
|
||||
|
||||
# Release APK (requires uninstalling debug version first)
|
||||
adb uninstall com.example.lifetimer
|
||||
adb install lifetimer/build/app/outputs/flutter-apk/app-release.apk
|
||||
```
|
||||
|
||||
### Install via File Transfer
|
||||
1. Copy the APK file to your Android device
|
||||
2. Enable "Install from unknown sources" in device settings
|
||||
3. Tap on the APK file to install
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **"sign_in_with_apple" compilation error**: Use Option 1 to disable it temporarily
|
||||
2. **"google-services.json missing"**: Comment out Google services plugin in `android/app/build.gradle.kts`
|
||||
3. **Gradle version conflicts**: Update Flutter and Gradle versions
|
||||
|
||||
### Environment Setup
|
||||
Ensure you have:
|
||||
- Flutter SDK installed and in PATH
|
||||
- Android SDK with API level 34+
|
||||
- Java 17 installed
|
||||
- Android Studio or VS Code with Flutter extensions
|
||||
|
||||
### Verification Commands
|
||||
```bash
|
||||
# Check Flutter setup
|
||||
flutter doctor -v
|
||||
|
||||
# Check connected devices
|
||||
flutter devices
|
||||
|
||||
# Check Android SDK
|
||||
flutter doctor --android-licenses
|
||||
```
|
||||
|
||||
## Build Variants
|
||||
|
||||
### Development Build
|
||||
```bash
|
||||
flutter build apk --debug --no-shrink
|
||||
```
|
||||
|
||||
### Production Build
|
||||
```bash
|
||||
flutter build apk --release --obfuscate --split-debug-info=build/debug-info/
|
||||
```
|
||||
|
||||
### Specific Architecture
|
||||
```bash
|
||||
flutter build apk --release --target-platform android-arm64
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **For immediate testing**: Use Option 1 to build a debug APK without Apple Sign-In
|
||||
2. **For production**: Update dependencies using Option 2
|
||||
3. **For long-term**: Consider migrating to newer plugin versions that support current Flutter APIs
|
||||
|
||||
## Support
|
||||
|
||||
If you continue to experience issues:
|
||||
1. Check the Flutter documentation: https://flutter.dev/docs/deployment/android
|
||||
2. Review plugin-specific documentation for updated APIs
|
||||
3. Consider creating a minimal reproduction case for the plugin maintainers
|
||||
@@ -1,330 +0,0 @@
|
||||
# App Store Submission Assets Guide
|
||||
|
||||
**Project:** LifeTimer
|
||||
**Version:** 1.0.0
|
||||
**Date:** 2026-01-03
|
||||
|
||||
## App Icons
|
||||
|
||||
### iOS App Icon Requirements
|
||||
|
||||
**Required Sizes:**
|
||||
- 1024x1024px (App Store submission)
|
||||
- 180x180px (iPhone App @3x)
|
||||
- 167x167px (iPad Pro @2x)
|
||||
- 152x152px (iPad @2x)
|
||||
- 120x120px (iPhone @2x)
|
||||
- 87x87px (iPhone @3x Notification)
|
||||
- 80x80px (iPad @2x Spotlight)
|
||||
- 76x76px (iPad @1x)
|
||||
- 60x60px (iPhone @2x Notification)
|
||||
- 58x58px (iPhone @2x Settings)
|
||||
- 40x40px (iPhone @2x Spotlight)
|
||||
- 29x29px (iPhone @2x Settings)
|
||||
|
||||
**Design Guidelines:**
|
||||
- Use the primary brand color (#6366F1)
|
||||
- Incorporate a countdown or hourglass visual element
|
||||
- Clean, minimal design
|
||||
- No text or words on the icon
|
||||
- Rounded corners (iOS will apply automatically)
|
||||
- High contrast for accessibility
|
||||
|
||||
**Recommended Icon Concept:**
|
||||
- A stylized hourglass with sand flowing
|
||||
- Or a circular progress ring with "1356" text
|
||||
- Gradient from primary (#6366F1) to secondary (#8B5CF6)
|
||||
|
||||
### Android App Icon Requirements
|
||||
|
||||
**Required Sizes:**
|
||||
- 512x512px (Google Play Store)
|
||||
- 192x192px (Adaptive Icon)
|
||||
- 144x144px (Master Icon)
|
||||
- 96x96px (Master Icon)
|
||||
- 72x72px (Master Icon)
|
||||
- 48x48px (Master Icon)
|
||||
|
||||
**Design Guidelines:**
|
||||
- Use adaptive icon format for Android 8.0+
|
||||
- Safe zone: 66% of the icon (center 2/3)
|
||||
- Background layer: Full 192x192px
|
||||
- Foreground layer: 108x108px centered
|
||||
- No transparency in background layer
|
||||
|
||||
## App Store Screenshots
|
||||
|
||||
### iOS Screenshots
|
||||
|
||||
**Required Sizes:**
|
||||
- 6.7" Display: 1290x2796px (iPhone 14 Pro Max)
|
||||
- 6.5" Display: 1242x2688px (iPhone XS Max)
|
||||
- 5.5" Display: 1242x2208px (iPhone 8 Plus)
|
||||
|
||||
**Minimum:** 3 screenshots
|
||||
**Recommended:** 5-6 screenshots
|
||||
|
||||
**Screenshot Order & Content:**
|
||||
|
||||
1. **Home Countdown Screen**
|
||||
- Large countdown timer display
|
||||
- Progress ring showing time elapsed
|
||||
- Clean, inspiring design
|
||||
- Caption: "Track Your 1356-Day Journey"
|
||||
|
||||
2. **Goals List Screen**
|
||||
- List of bucket list items
|
||||
- Progress indicators
|
||||
- Add goal button
|
||||
- Caption: "Create Your Bucket List"
|
||||
|
||||
3. **Goal Detail Screen**
|
||||
- Goal with progress slider
|
||||
- Milestones/steps
|
||||
- Location and image
|
||||
- Caption: "Track Your Progress"
|
||||
|
||||
4. **Profile Screen**
|
||||
- User avatar and stats
|
||||
- Countdown summary
|
||||
- Achievements
|
||||
- Caption: "Your Personal Dashboard"
|
||||
|
||||
5. **Social Feed Screen**
|
||||
- Activity feed
|
||||
- Leaderboards
|
||||
- Community achievements
|
||||
- Caption: "Join the Community"
|
||||
|
||||
6. **Settings Screen**
|
||||
- Theme options
|
||||
- Notification settings
|
||||
- Privacy controls
|
||||
- Caption: "Customize Your Experience"
|
||||
|
||||
**Design Guidelines:**
|
||||
- Use actual app screenshots (no mockups)
|
||||
- Show full screen content
|
||||
- Include status bar with time
|
||||
- No device frames
|
||||
- Consistent lighting and colors
|
||||
- English text only
|
||||
|
||||
### Android Screenshots
|
||||
|
||||
**Required Sizes:**
|
||||
- Phone: 1080x1920px (minimum)
|
||||
- Tablet: 1200x1920px (optional)
|
||||
- 7-inch Tablet: 1264x1264px (optional)
|
||||
|
||||
**Minimum:** 2 screenshots
|
||||
**Recommended:** 8 screenshots
|
||||
|
||||
**Screenshot Content:** Same as iOS but optimized for Android UI
|
||||
|
||||
## App Store Preview Videos (Optional)
|
||||
|
||||
### iOS App Preview
|
||||
|
||||
**Requirements:**
|
||||
- 15-30 seconds
|
||||
- 1920x1080px (16:9 aspect ratio)
|
||||
- MP4 or MOV format
|
||||
- Under 500MB
|
||||
|
||||
**Content Suggestion:**
|
||||
- 0-3s: App splash screen
|
||||
- 3-8s: Creating bucket list
|
||||
- 8-13s: Starting countdown
|
||||
- 13-18s: Tracking progress
|
||||
- 18-23s: Viewing achievements
|
||||
- 23-30s: App logo with tagline
|
||||
|
||||
### Android Promo Video
|
||||
|
||||
**Requirements:**
|
||||
- 30 seconds - 2 minutes
|
||||
- 1920x1080px (16:9 aspect ratio)
|
||||
- YouTube link
|
||||
|
||||
## Feature Graphic (Android)
|
||||
|
||||
**Requirements:**
|
||||
- 1024x500px
|
||||
- JPG or 24-bit PNG (no alpha)
|
||||
- No transparency
|
||||
|
||||
**Design:**
|
||||
- App logo on left
|
||||
- Tagline: "Your 1356-Day Life Challenge"
|
||||
- Gradient background matching app theme
|
||||
- Clean, modern design
|
||||
|
||||
## Promotional Text
|
||||
|
||||
### iOS Promotional Text (170 characters max)
|
||||
```
|
||||
Transform your life with a 1356-day countdown. Create your bucket list, track progress, and achieve your dreams.
|
||||
```
|
||||
|
||||
### iOS Description (4000 characters max)
|
||||
See `APP_STORE_DESCRIPTIONS.md`
|
||||
|
||||
### Android Short Description (80 characters max)
|
||||
```
|
||||
1356-day life countdown with bucket list tracking
|
||||
```
|
||||
|
||||
### Android Full Description (4000 characters max)
|
||||
See `APP_STORE_DESCRIPTIONS.md`
|
||||
|
||||
## Store Listing Assets
|
||||
|
||||
### Privacy Policy URL
|
||||
- Required for both stores
|
||||
- Create at: `https://lifetimer.app/privacy`
|
||||
|
||||
### Support URL
|
||||
- Required for both stores
|
||||
- Create at: `https://lifetimer.app/support`
|
||||
|
||||
### Marketing URL
|
||||
- Optional
|
||||
- Create at: `https://lifetimer.app`
|
||||
|
||||
## Asset Creation Checklist
|
||||
|
||||
### Icons
|
||||
- [ ] Design app icon concept
|
||||
- [ ] Create iOS icon set (all sizes)
|
||||
- [ ] Create Android adaptive icon
|
||||
- [ ] Create Android legacy icon
|
||||
- [ ] Test icons on actual devices
|
||||
- [ ] Verify contrast and readability
|
||||
|
||||
### Screenshots
|
||||
- [ ] Set up test data in app
|
||||
- [ ] Capture iOS screenshots (6.7" display)
|
||||
- [ ] Capture Android screenshots (1080x1920)
|
||||
- [ ] Review and edit for consistency
|
||||
- [ ] Verify all text is readable
|
||||
- [ ] Ensure no personal data visible
|
||||
|
||||
### Videos (Optional)
|
||||
- [ ] Script storyboard
|
||||
- [ ] Record screen footage
|
||||
- [ ] Add transitions and effects
|
||||
- [ ] Add background music (optional)
|
||||
- [ ] Export in required format
|
||||
- [ ] Test on target devices
|
||||
|
||||
### Graphics
|
||||
- [ ] Design Android feature graphic
|
||||
- [ ] Create promotional banner
|
||||
- [ ] Design social media assets
|
||||
|
||||
## Tools for Asset Creation
|
||||
|
||||
### Icons
|
||||
- **Figma** - Design and export icons
|
||||
- **Sketch** - Design tool (macOS)
|
||||
- **AppIconGenerator** - Generate all sizes
|
||||
- **MakeAppIcon** - Online icon generator
|
||||
|
||||
### Screenshots
|
||||
- **Fastlane Snapshot** - Automated screenshots
|
||||
- **Simulator** - iOS screenshots
|
||||
- **Android Emulator** - Android screenshots
|
||||
- **CleanShot X** - Screenshot tool (macOS)
|
||||
|
||||
### Videos
|
||||
- **QuickTime** - Screen recording (macOS)
|
||||
- **OBS Studio** - Screen recording (cross-platform)
|
||||
- **iMovie** - Video editing (macOS)
|
||||
- **DaVinci Resolve** - Professional video editing
|
||||
|
||||
### Graphics
|
||||
- **Canva** - Online design tool
|
||||
- **Adobe Photoshop** - Professional design
|
||||
- **Figma** - Design and prototyping
|
||||
|
||||
## Asset Storage
|
||||
|
||||
### Local Storage Structure
|
||||
```
|
||||
lifetimer/
|
||||
├── assets/
|
||||
│ ├── icons/
|
||||
│ │ ├── ios/
|
||||
│ │ │ ├── 1024x1024.png
|
||||
│ │ │ ├── 180x180.png
|
||||
│ │ │ └── ...
|
||||
│ │ └── android/
|
||||
│ │ ├── adaptive_foreground.png
|
||||
│ │ ├── adaptive_background.png
|
||||
│ │ └── ...
|
||||
│ ├── screenshots/
|
||||
│ │ ├── ios/
|
||||
│ │ │ ├── 1_home_countdown.png
|
||||
│ │ │ ├── 2_goals_list.png
|
||||
│ │ │ └── ...
|
||||
│ │ └── android/
|
||||
│ │ ├── phone_1_home_countdown.png
|
||||
│ │ ├── phone_2_goals_list.png
|
||||
│ │ └── ...
|
||||
│ └── graphics/
|
||||
│ ├── feature_graphic.png
|
||||
│ └── promo_banner.png
|
||||
```
|
||||
|
||||
## Submission Checklist
|
||||
|
||||
### iOS App Store
|
||||
- [ ] App icon (1024x1024px)
|
||||
- [ ] Screenshots (minimum 3, all required sizes)
|
||||
- [ ] App preview video (optional)
|
||||
- [ ] Promotional text
|
||||
- [ ] Description
|
||||
- [ ] Keywords (100 characters)
|
||||
- [ ] Support URL
|
||||
- [ ] Marketing URL (optional)
|
||||
- [ ] Privacy policy URL
|
||||
- [ ] App category: "Lifestyle" or "Productivity"
|
||||
- [ ] Age rating: Calculate with rating tool
|
||||
- [ ] Export compliance information
|
||||
- [ ] Content rights
|
||||
|
||||
### Google Play Store
|
||||
- [ ] High-res icon (512x512px)
|
||||
- [ ] Feature graphic (1024x500px)
|
||||
- [ ] Screenshots (minimum 2)
|
||||
- [ ] Short description (80 chars)
|
||||
- [ ] Full description (4000 chars)
|
||||
- [ ] Promo video (optional)
|
||||
- [ ] Application type: "Application"
|
||||
- [ ] Category: "Lifestyle"
|
||||
- [ ] Content rating questionnaire
|
||||
- [ ] Privacy policy URL
|
||||
- [ ] Website URL
|
||||
- [ ] Email address for support
|
||||
- [ ] Store listing experiments (optional)
|
||||
|
||||
## Notes
|
||||
|
||||
- All assets should be in English for initial launch
|
||||
- Consider localized assets for future markets
|
||||
- Test all assets on actual devices before submission
|
||||
- Keep original design files for future updates
|
||||
- Follow each store's design guidelines precisely
|
||||
- Assets may be rejected if they don't meet specifications
|
||||
|
||||
---
|
||||
|
||||
**Next Steps:**
|
||||
1. Design app icon concept
|
||||
2. Create all required icon sizes
|
||||
3. Set up test data in app
|
||||
4. Capture screenshots for both platforms
|
||||
5. Create promotional graphics
|
||||
6. Prepare store listings
|
||||
7. Submit to both app stores
|
||||
@@ -1,424 +0,0 @@
|
||||
# App Store Metadata & Descriptions
|
||||
|
||||
**Project:** LifeTimer
|
||||
**Version:** 1.0.0
|
||||
**Date:** 2026-01-03
|
||||
|
||||
## iOS App Store
|
||||
|
||||
### App Name
|
||||
**LifeTimer: 1356-Day Challenge**
|
||||
|
||||
### Subtitle (30 characters max)
|
||||
**Your Life Countdown**
|
||||
|
||||
### Promotional Text (170 characters max)
|
||||
```
|
||||
Transform your life with a 1356-day countdown. Create your bucket list, track progress, and achieve your dreams.
|
||||
```
|
||||
|
||||
### Description (4000 characters max)
|
||||
```
|
||||
LifeTimer is a powerful life countdown app that helps you transform your life through focused goal-setting and time awareness. Create your personal bucket list of up to 20 goals, then embark on an unforgettable 1356-day journey (approximately 3 years, 8 months, and 11 days).
|
||||
|
||||
**WHY 1356 DAYS?**
|
||||
|
||||
1356 days represents a significant but achievable timeframe for personal transformation. It's long enough to accomplish meaningful life goals, but short enough to maintain focus and motivation. Once you start your countdown, there's no turning back – this commitment drives you to take action every day.
|
||||
|
||||
**KEY FEATURES**
|
||||
|
||||
🎯 **Bucket List Creation**
|
||||
- Create up to 20 meaningful life goals
|
||||
- Add descriptions, milestones, and progress tracking
|
||||
- Attach images to visualize your dreams
|
||||
- Add locations for travel and adventure goals
|
||||
|
||||
⏱️ **Live Countdown Timer**
|
||||
- Beautiful, world-time inspired countdown display
|
||||
- Real-time progress tracking with days, hours, minutes, and seconds
|
||||
- Visual progress ring showing time elapsed
|
||||
- Motivational messages to keep you inspired
|
||||
|
||||
📊 **Progress Tracking**
|
||||
- Track progress on each goal (0-100%)
|
||||
- Mark milestones as you complete them
|
||||
- Celebrate when you achieve a goal
|
||||
- View your overall journey statistics
|
||||
|
||||
🏆 **Achievements System**
|
||||
- Unlock achievements as you progress
|
||||
- Track your streaks and milestones
|
||||
- Celebrate your accomplishments
|
||||
- Share your success with the community
|
||||
|
||||
🌐 **Social Features (Optional)**
|
||||
- Join a community of like-minded individuals
|
||||
- View public profiles and leaderboards
|
||||
- Share your milestones and achievements
|
||||
- Get inspired by others' progress
|
||||
|
||||
📈 **Analytics & Insights**
|
||||
- Visual charts showing your progress over time
|
||||
- Goal completion trends
|
||||
- Streak visualization
|
||||
- Personalized insights and recommendations
|
||||
|
||||
🎨 **Personalization**
|
||||
- Light and dark themes
|
||||
- 12/24 hour time format options
|
||||
- Customizable notification settings
|
||||
- Privacy controls for your profile
|
||||
|
||||
🔔 **Smart Notifications**
|
||||
- Daily and weekly reminders
|
||||
- Milestone notifications
|
||||
- Countdown checkpoint alerts (50%, 25% remaining)
|
||||
- Customizable notification preferences
|
||||
|
||||
🗺️ **Location Integration**
|
||||
- Add map locations to your goals
|
||||
- Pick locations using Google Maps or OpenStreetMap
|
||||
- Visualize your travel goals
|
||||
- Track location-based achievements
|
||||
|
||||
🖼️ **Image Integration**
|
||||
- Add images to your goals from your device
|
||||
- Search for inspiring images via Unsplash or Pexels
|
||||
- Automatic image suggestions based on goal titles
|
||||
- Beautiful goal cards with visual appeal
|
||||
|
||||
📴 **Offline Support**
|
||||
- Access your goals and countdown offline
|
||||
- Automatic sync when connection is restored
|
||||
- Queue changes while offline
|
||||
- Never lose your progress
|
||||
|
||||
**HOW IT WORKS**
|
||||
|
||||
1. **Sign Up** - Create your account with email, Google, or Apple
|
||||
2. **Onboarding** - Learn about the 1356-day challenge
|
||||
3. **Create Your Bucket List** - Add up to 20 life goals
|
||||
4. **Start Your Countdown** - Confirm your list and begin your journey
|
||||
5. **Track Progress** - Update your goals as you make progress
|
||||
6. **Achieve Your Dreams** - Complete goals and unlock achievements
|
||||
|
||||
**THE COUNTDOWN RULES**
|
||||
|
||||
- Your countdown starts only after you finalize your bucket list
|
||||
- Once started, the countdown cannot be paused, reset, or stopped
|
||||
- You have exactly 1356 days to complete your goals
|
||||
- This commitment ensures you stay focused and motivated
|
||||
|
||||
**PRIVACY & SECURITY**
|
||||
|
||||
- Your data is secure with end-to-end encryption
|
||||
- Choose between private or public profile
|
||||
- Control what you share with the community
|
||||
- Full compliance with data protection regulations
|
||||
- Easy account deletion with data removal
|
||||
|
||||
**WHO IS LIFETIMER FOR?**
|
||||
|
||||
- People seeking personal transformation
|
||||
- Goal-oriented individuals
|
||||
- Anyone wanting to make the most of their time
|
||||
- Dreamers who want to turn aspirations into reality
|
||||
- Those who thrive with deadlines and accountability
|
||||
|
||||
**START YOUR JOURNEY TODAY**
|
||||
|
||||
Download LifeTimer and begin your 1356-day transformation. Every day counts. Every goal matters. Your future self will thank you.
|
||||
|
||||
**SUBSCRIPTION**
|
||||
|
||||
LifeTimer is free to use with all core features included. No subscriptions or in-app purchases required.
|
||||
|
||||
**FOLLOW US**
|
||||
|
||||
- Website: lifetimer.app
|
||||
- Twitter: @LifeTimerApp
|
||||
- Instagram: @LifeTimerApp
|
||||
|
||||
**SUPPORT**
|
||||
|
||||
Need help? Contact us at [email protected]
|
||||
|
||||
**PRIVACY POLICY**
|
||||
|
||||
lifetimer.app/privacy
|
||||
|
||||
**TERMS OF SERVICE**
|
||||
|
||||
lifetimer.app/terms
|
||||
```
|
||||
|
||||
### Keywords (100 characters max)
|
||||
```
|
||||
countdown, bucket list, goals, life goals, productivity, motivation, tracker, challenge
|
||||
```
|
||||
|
||||
### Support URL
|
||||
```
|
||||
https://lifetimer.app/support
|
||||
```
|
||||
|
||||
### Marketing URL
|
||||
```
|
||||
https://lifetimer.app
|
||||
```
|
||||
|
||||
### Privacy Policy URL
|
||||
```
|
||||
https://lifetimer.app/privacy
|
||||
```
|
||||
|
||||
### Category
|
||||
**Lifestyle**
|
||||
|
||||
### Age Rating
|
||||
**12+** (Infrequent/Mild Simulated Gambling - due to challenge nature)
|
||||
|
||||
---
|
||||
|
||||
## Google Play Store
|
||||
|
||||
### App Name
|
||||
**LifeTimer: 1356-Day Challenge**
|
||||
|
||||
### Short Description (80 characters max)
|
||||
```
|
||||
1356-day life countdown with bucket list tracking
|
||||
```
|
||||
|
||||
### Full Description (4000 characters max)
|
||||
```
|
||||
LifeTimer is a powerful life countdown app that helps you transform your life through focused goal-setting and time awareness. Create your personal bucket list of up to 20 goals, then embark on an unforgettable 1356-day journey (approximately 3 years, 8 months, and 11 days).
|
||||
|
||||
**WHY 1356 DAYS?**
|
||||
|
||||
1356 days represents a significant but achievable timeframe for personal transformation. It's long enough to accomplish meaningful life goals, but short enough to maintain focus and motivation. Once you start your countdown, there's no turning back – this commitment drives you to take action every day.
|
||||
|
||||
**KEY FEATURES**
|
||||
|
||||
🎯 **Bucket List Creation**
|
||||
- Create up to 20 meaningful life goals
|
||||
- Add descriptions, milestones, and progress tracking
|
||||
- Attach images to visualize your dreams
|
||||
- Add locations for travel and adventure goals
|
||||
|
||||
⏱️ **Live Countdown Timer**
|
||||
- Beautiful, world-time inspired countdown display
|
||||
- Real-time progress tracking with days, hours, minutes, and seconds
|
||||
- Visual progress ring showing time elapsed
|
||||
- Motivational messages to keep you inspired
|
||||
|
||||
📊 **Progress Tracking**
|
||||
- Track progress on each goal (0-100%)
|
||||
- Mark milestones as you complete them
|
||||
- Celebrate when you achieve a goal
|
||||
- View your overall journey statistics
|
||||
|
||||
🏆 **Achievements System**
|
||||
- Unlock achievements as you progress
|
||||
- Track your streaks and milestones
|
||||
- Celebrate your accomplishments
|
||||
- Share your success with the community
|
||||
|
||||
🌐 **Social Features (Optional)**
|
||||
- Join a community of like-minded individuals
|
||||
- View public profiles and leaderboards
|
||||
- Share your milestones and achievements
|
||||
- Get inspired by others' progress
|
||||
|
||||
📈 **Analytics & Insights**
|
||||
- Visual charts showing your progress over time
|
||||
- Goal completion trends
|
||||
- Streak visualization
|
||||
- Personalized insights and recommendations
|
||||
|
||||
🎨 **Personalization**
|
||||
- Light and dark themes
|
||||
- 12/24 hour time format options
|
||||
- Customizable notification settings
|
||||
- Privacy controls for your profile
|
||||
|
||||
🔔 **Smart Notifications**
|
||||
- Daily and weekly reminders
|
||||
- Milestone notifications
|
||||
- Countdown checkpoint alerts (50%, 25% remaining)
|
||||
- Customizable notification preferences
|
||||
|
||||
🗺️ **Location Integration**
|
||||
- Add map locations to your goals
|
||||
- Pick locations using Google Maps or OpenStreetMap
|
||||
- Visualize your travel goals
|
||||
- Track location-based achievements
|
||||
|
||||
🖼️ **Image Integration**
|
||||
- Add images to your goals from your device
|
||||
- Search for inspiring images via Unsplash or Pexels
|
||||
- Automatic image suggestions based on goal titles
|
||||
- Beautiful goal cards with visual appeal
|
||||
|
||||
📴 **Offline Support**
|
||||
- Access your goals and countdown offline
|
||||
- Automatic sync when connection is restored
|
||||
- Queue changes while offline
|
||||
- Never lose your progress
|
||||
|
||||
**HOW IT WORKS**
|
||||
|
||||
1. **Sign Up** - Create your account with email, Google, or Apple
|
||||
2. **Onboarding** - Learn about the 1356-day challenge
|
||||
3. **Create Your Bucket List** - Add up to 20 life goals
|
||||
4. **Start Your Countdown** - Confirm your list and begin your journey
|
||||
5. **Track Progress** - Update your goals as you make progress
|
||||
6. **Achieve Your Dreams** - Complete goals and unlock achievements
|
||||
|
||||
**THE COUNTDOWN RULES**
|
||||
|
||||
- Your countdown starts only after you finalize your bucket list
|
||||
- Once started, the countdown cannot be paused, reset, or stopped
|
||||
- You have exactly 1356 days to complete your goals
|
||||
- This commitment ensures you stay focused and motivated
|
||||
|
||||
**PRIVACY & SECURITY**
|
||||
|
||||
- Your data is secure with end-to-end encryption
|
||||
- Choose between private or public profile
|
||||
- Control what you share with the community
|
||||
- Full compliance with data protection regulations
|
||||
- Easy account deletion with data removal
|
||||
|
||||
**WHO IS LIFETIMER FOR?**
|
||||
|
||||
- People seeking personal transformation
|
||||
- Goal-oriented individuals
|
||||
- Anyone wanting to make the most of their time
|
||||
- Dreamers who want to turn aspirations into reality
|
||||
- Those who thrive with deadlines and accountability
|
||||
|
||||
**START YOUR JOURNEY TODAY**
|
||||
|
||||
Download LifeTimer and begin your 1356-day transformation. Every day counts. Every goal matters. Your future self will thank you.
|
||||
|
||||
**FREE TO USE**
|
||||
|
||||
LifeTimer is completely free with all core features included. No subscriptions or in-app purchases required.
|
||||
|
||||
**SUPPORT**
|
||||
|
||||
Need help? Contact us at [email protected]
|
||||
|
||||
**PRIVACY POLICY**
|
||||
|
||||
lifetimer.app/privacy
|
||||
|
||||
**TERMS OF SERVICE**
|
||||
|
||||
lifetimer.app/terms
|
||||
```
|
||||
|
||||
### Application Type
|
||||
**Application**
|
||||
|
||||
### Category
|
||||
**Lifestyle**
|
||||
|
||||
### Content Rating
|
||||
**Teen** (or appropriate based on content rating questionnaire)
|
||||
|
||||
### Privacy Policy URL
|
||||
```
|
||||
https://lifetimer.app/privacy
|
||||
```
|
||||
|
||||
### Website URL
|
||||
```
|
||||
https://lifetimer.app
|
||||
```
|
||||
|
||||
### Support Email
|
||||
```
|
||||
[email protected]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Localization Notes
|
||||
|
||||
Currently, all metadata is in English. For future international releases, consider translating:
|
||||
|
||||
- App name and subtitle
|
||||
- Description and promotional text
|
||||
- Keywords
|
||||
- Screenshots with localized UI
|
||||
- Privacy policy and terms of service
|
||||
|
||||
**Target Markets for Future Localization:**
|
||||
- Spanish (ES, MX)
|
||||
- French (FR)
|
||||
- German (DE)
|
||||
- Portuguese (BR, PT)
|
||||
- Chinese (Simplified, Traditional)
|
||||
- Japanese
|
||||
- Korean
|
||||
|
||||
---
|
||||
|
||||
## ASO (App Store Optimization) Tips
|
||||
|
||||
### Keywords to Target
|
||||
- Primary: countdown, bucket list, goals, life goals
|
||||
- Secondary: productivity, motivation, tracker, challenge, transformation
|
||||
- Long-tail: life countdown app, goal tracker, bucket list app, personal goals
|
||||
|
||||
### Conversion Optimization
|
||||
- Use compelling screenshots that show value
|
||||
- Include app preview video (iOS)
|
||||
- Highlight unique features in description
|
||||
- Use social proof (ratings, reviews)
|
||||
- A/B test different screenshots and descriptions
|
||||
|
||||
### Review Strategy
|
||||
- Encourage satisfied users to leave reviews
|
||||
- Respond to all reviews (positive and negative)
|
||||
- Use feedback to improve the app
|
||||
- Address common concerns in updates
|
||||
|
||||
---
|
||||
|
||||
## Metadata Checklist
|
||||
|
||||
### iOS
|
||||
- [x] App name
|
||||
- [x] Subtitle
|
||||
- [x] Promotional text
|
||||
- [x] Description
|
||||
- [x] Keywords
|
||||
- [x] Support URL
|
||||
- [x] Marketing URL
|
||||
- [x] Privacy policy URL
|
||||
- [x] Category
|
||||
- [x] Age rating
|
||||
|
||||
### Android
|
||||
- [x] App name
|
||||
- [x] Short description
|
||||
- [x] Full description
|
||||
- [x] Application type
|
||||
- [x] Category
|
||||
- [x] Content rating
|
||||
- [x] Privacy policy URL
|
||||
- [x] Website URL
|
||||
- [x] Support email
|
||||
|
||||
---
|
||||
|
||||
**Next Steps:**
|
||||
1. Create landing page at lifetimer.app
|
||||
2. Set up privacy policy page
|
||||
3. Set up support email
|
||||
4. Create social media accounts
|
||||
5. Prepare launch marketing materials
|
||||
6. Submit to both app stores
|
||||
@@ -1,281 +0,0 @@
|
||||
# LifeTimer Code Review Report
|
||||
|
||||
**Date:** 2026-01-03
|
||||
**Reviewer:** Cascade
|
||||
**Version:** 1.0.0
|
||||
|
||||
## Executive Summary
|
||||
|
||||
The LifeTimer codebase demonstrates excellent software engineering practices with clean architecture, proper separation of concerns, and comprehensive error handling. The code follows Flutter best practices with Riverpod state management, proper use of Supabase, and well-structured feature modules. No critical issues were found.
|
||||
|
||||
## Code Quality Assessment
|
||||
|
||||
### ✅ Strengths
|
||||
|
||||
#### 1. Architecture & Design
|
||||
- **Rating:** Excellent
|
||||
- **Details:** Clean MVVM/Clean Architecture implementation
|
||||
- **Evidence:**
|
||||
- Clear separation between presentation, application, and data layers
|
||||
- Feature-based folder structure (`lib/features/`)
|
||||
- Proper use of repositories for data abstraction
|
||||
- State management with Riverpod providers
|
||||
- Centralized routing with go_router
|
||||
|
||||
#### 2. State Management
|
||||
- **Rating:** Excellent
|
||||
- **Details:** Consistent use of Riverpod StateNotifier pattern
|
||||
- **Evidence:**
|
||||
- All controllers extend `StateNotifier`
|
||||
- Proper state classes (initial, loading, loaded, error)
|
||||
- Immutable state objects
|
||||
- Proper provider setup and dependency injection
|
||||
|
||||
#### 3. Error Handling
|
||||
- **Rating:** Excellent
|
||||
- **Details:** Comprehensive error handling with custom failure types
|
||||
- **Evidence:**
|
||||
- Custom `Failure` hierarchy (ServerFailure, NetworkFailure, AuthFailure, etc.)
|
||||
- `ErrorMapper` for converting exceptions to user-friendly messages
|
||||
- Try-catch blocks in all async operations
|
||||
- Error state properly propagated to UI
|
||||
|
||||
#### 4. Data Models
|
||||
- **Rating:** Excellent
|
||||
- **Details:** Well-structured models with proper serialization
|
||||
- **Evidence:**
|
||||
- Models extend `Equatable` for value equality
|
||||
- Proper `toJson()` and `fromJson()` methods
|
||||
- Immutable with `copyWith()` methods
|
||||
- Computed properties for business logic (e.g., `hasCountdownStarted`)
|
||||
|
||||
#### 5. Code Organization
|
||||
- **Rating:** Excellent
|
||||
- **Details:** Clear and consistent file structure
|
||||
- **Evidence:**
|
||||
- Feature-based organization
|
||||
- Shared core components (widgets, utils, errors)
|
||||
- Consistent naming conventions
|
||||
- Proper imports and dependencies
|
||||
|
||||
#### 6. Testing Infrastructure
|
||||
- **Rating:** Good
|
||||
- **Details:** Comprehensive test structure in place
|
||||
- **Evidence:**
|
||||
- Test helpers and mock providers
|
||||
- Unit tests for utilities and models
|
||||
- Widget tests for screens
|
||||
- Test data fixtures
|
||||
|
||||
### ⚠️ Medium Priority Issues
|
||||
|
||||
#### 1. Placeholder Analytics Service
|
||||
- **Severity:** Medium
|
||||
- **Location:** `lib/core/services/analytics_service.dart`
|
||||
- **Issue:** Analytics service uses `print()` statements instead of real analytics
|
||||
- **Recommendation:** Integrate with Firebase Analytics, Mixpanel, or similar before production
|
||||
- **Impact:** No analytics data collection currently
|
||||
|
||||
#### 2. Print Statements for Logging
|
||||
- **Severity:** Medium
|
||||
- **Locations:**
|
||||
- `lib/core/services/analytics_service.dart` (lines 23, 34)
|
||||
- `lib/data/services/offline_mutation_queue.dart` (line 69)
|
||||
- **Issue:** Using `print()` for logging
|
||||
- **Recommendation:** Replace with proper logging framework (e.g., `logger` package)
|
||||
- **Impact:** Debug logs in production builds
|
||||
|
||||
#### 3. Placeholder User ID
|
||||
- **Severity:** Low
|
||||
- **Locations:**
|
||||
- `lib/features/goals/application/goals_controller.dart` (line 166)
|
||||
- `lib/features/countdown/application/countdown_controller.dart` (line 118)
|
||||
- **Issue:** Uses `'placeholder_user_id'` when user ID is empty
|
||||
- **Recommendation:** Add proper handling for unauthenticated state
|
||||
- **Impact:** Minor - should rarely occur in practice
|
||||
|
||||
#### 4. Outdated Test File
|
||||
- **Severity:** Low
|
||||
- **Location:** `test/widget_test.dart`
|
||||
- **Issue:** Contains default Flutter counter test, not actual app tests
|
||||
- **Recommendation:** Remove or replace with actual app widget tests
|
||||
- **Impact:** No actual impact, just cleanup needed
|
||||
|
||||
### ℹ️ Minor Observations
|
||||
|
||||
#### 1. Timer Optimization
|
||||
- **Location:** `lib/features/countdown/application/countdown_controller.dart`
|
||||
- **Observation:** Timer checks for second/minute changes before updating state (good optimization)
|
||||
- **Status:** ✅ Already optimized
|
||||
|
||||
#### 2. Semantic Labels
|
||||
- **Observation:** Good use of `Semantics` widgets for accessibility
|
||||
- **Status:** ✅ Accessibility considerations in place
|
||||
|
||||
#### 3. Input Validation
|
||||
- **Location:** `lib/core/utils/validators.dart`
|
||||
- **Observation:** Comprehensive validators for all user inputs
|
||||
- **Status:** ✅ Proper validation
|
||||
|
||||
#### 4. No TODO/FIXME Comments
|
||||
- **Observation:** No outstanding TODO or FIXME comments found
|
||||
- **Status:** ✅ Code is production-ready
|
||||
|
||||
## Feature Implementation Review
|
||||
|
||||
### Authentication ✅
|
||||
- Email/password sign in/up
|
||||
- Google OAuth
|
||||
- Apple OAuth
|
||||
- Session management
|
||||
- Password reset
|
||||
- Profile updates
|
||||
|
||||
### Goals ✅
|
||||
- CRUD operations
|
||||
- 20 goals limit enforcement
|
||||
- Progress tracking (0-100%)
|
||||
- Goal completion
|
||||
- Location support
|
||||
- Image support
|
||||
- Goal locking after countdown starts
|
||||
|
||||
### Countdown ✅
|
||||
- 1356-day countdown calculation
|
||||
- Live timer updates (optimized)
|
||||
- Progress calculation
|
||||
- Countdown start confirmation
|
||||
- Countdown restart prevention
|
||||
|
||||
### Social ✅
|
||||
- Follow/unfollow functionality
|
||||
- Activity feed
|
||||
- Leaderboards with sorting
|
||||
- Public profiles
|
||||
- Profile visibility toggle
|
||||
|
||||
### Achievements ✅
|
||||
- Achievement tracking
|
||||
- Achievement types
|
||||
- Progress display
|
||||
|
||||
### Analytics/Insights ✅
|
||||
- Progress vs time charts
|
||||
- Goal completion trends
|
||||
- Streak visualization
|
||||
- Summary cards
|
||||
|
||||
### Settings ✅
|
||||
- Appearance (theme, time format)
|
||||
- Notifications
|
||||
- Privacy settings
|
||||
- About challenge
|
||||
|
||||
### Offline Support ✅
|
||||
- Local caching with Hive
|
||||
- Offline mutation queue
|
||||
- Sync on connection restore
|
||||
|
||||
### Image Integration ✅
|
||||
- Unsplash API integration
|
||||
- Pexels API integration
|
||||
- Image search dialog
|
||||
- Local image caching
|
||||
|
||||
### Map Integration ✅
|
||||
- Google Maps integration
|
||||
- OpenStreetMap fallback
|
||||
- Location picker screens
|
||||
|
||||
## Code Metrics
|
||||
|
||||
- **Total Features:** 9
|
||||
- **Total Screens:** ~25
|
||||
- **Total Controllers:** 9
|
||||
- **Total Repositories:** 7
|
||||
- **Total Models:** 4 (User, Goal, GoalStep, Activity)
|
||||
- **Test Coverage:** Unit tests for core utilities and models, widget tests for screens
|
||||
|
||||
## Best Practices Followed
|
||||
|
||||
✅ Clean Architecture
|
||||
✅ SOLID Principles
|
||||
✅ DRY (Don't Repeat Yourself)
|
||||
✅ Separation of Concerns
|
||||
✅ Dependency Injection
|
||||
✅ Immutable State
|
||||
✅ Error Handling
|
||||
✅ Input Validation
|
||||
✅ Accessibility
|
||||
✅ Type Safety
|
||||
✅ Null Safety
|
||||
|
||||
## Recommendations for Production
|
||||
|
||||
### High Priority
|
||||
1. **Integrate Real Analytics Service**
|
||||
- Replace placeholder with Firebase Analytics, Mixpanel, or similar
|
||||
- Configure proper event tracking
|
||||
- Set up user properties and funnels
|
||||
|
||||
2. **Implement Proper Logging**
|
||||
- Add `logger` package to dependencies
|
||||
- Replace all `print()` statements
|
||||
- Configure log levels for debug/release builds
|
||||
|
||||
### Medium Priority
|
||||
3. **Add Crash Reporting**
|
||||
- Integrate Firebase Crashlytics or Sentry
|
||||
- Set up error tracking
|
||||
- Configure crash reporting
|
||||
|
||||
4. **Performance Monitoring**
|
||||
- Add Firebase Performance Monitoring
|
||||
- Track app startup time
|
||||
- Monitor API response times
|
||||
|
||||
5. **Add Integration Tests**
|
||||
- Create end-to-end tests for critical flows
|
||||
- Test authentication flow
|
||||
- Test goal creation and countdown start
|
||||
|
||||
### Low Priority
|
||||
6. **Code Cleanup**
|
||||
- Remove default `test/widget_test.dart`
|
||||
- Add more integration tests
|
||||
- Improve test coverage
|
||||
|
||||
7. **Documentation**
|
||||
- Add inline comments for complex logic
|
||||
- Update README with setup instructions
|
||||
- Document API endpoints
|
||||
|
||||
## Security Review Summary
|
||||
|
||||
✅ No hardcoded secrets
|
||||
✅ Proper authentication
|
||||
✅ SQL injection prevention
|
||||
✅ Input validation
|
||||
✅ HTTPS/TLS encryption
|
||||
✅ User data isolation
|
||||
✅ No code injection risks
|
||||
✅ RLS policies configured
|
||||
|
||||
See `SECURITY_AUDIT_REPORT.md` for detailed security analysis.
|
||||
|
||||
## Conclusion
|
||||
|
||||
The LifeTimer codebase is well-architected, clean, and follows Flutter best practices. The code is production-ready with minor improvements recommended for analytics and logging. The comprehensive feature set, proper error handling, and clean architecture provide a solid foundation for a successful app launch.
|
||||
|
||||
**Overall Code Quality Rating:** A (Excellent)
|
||||
|
||||
**Recommendation:** Address analytics integration and logging framework before production launch. All other aspects are solid.
|
||||
|
||||
---
|
||||
|
||||
**Next Steps:**
|
||||
1. Integrate real analytics service
|
||||
2. Implement proper logging framework
|
||||
3. Add crash reporting
|
||||
4. Complete app store submission preparation
|
||||
5. Finalize testing phases
|
||||
@@ -1,99 +0,0 @@
|
||||
# Git Configuration for Manual Releases
|
||||
|
||||
This document outlines the Git configuration to ensure build files and unnecessary files are not uploaded, allowing for manual release management.
|
||||
|
||||
## ✅ What's Already Configured
|
||||
|
||||
### Build Files Excluded
|
||||
- **APK/AAB files**: `*.apk`, `*.aab`
|
||||
- **Android build directories**: `/android/app/build/`, `/android/build/`, `/android/.gradle/`
|
||||
- **iOS build directories**: `/ios/build/`, `/ios/Flutter/Flutter.framework`
|
||||
- **Flutter build artifacts**: `/build/`, `.dart_tool/`, `.pub-cache/`
|
||||
- **Debug/Release profiles**: `/android/app/debug`, `/android/app/profile`, `/android/app/release`
|
||||
|
||||
### Development Files Excluded
|
||||
- **IDE files**: `.idea/`, `*.iml`, `*.ipr`, `*.iws`
|
||||
- **Environment files**: `.env`, `.env.local`, `.env.*.local`
|
||||
- **Cache files**: `.DS_Store`, `Thumbs.db`, `*.log`
|
||||
- **Keystore files**: `*.keystore`, `*.jks`, `key.properties`
|
||||
|
||||
## 📁 Git Ignore Files
|
||||
|
||||
### Root `.gitignore` (Enhanced)
|
||||
- Comprehensive Flutter/Android/iOS exclusions
|
||||
- Build artifact prevention
|
||||
- Environment and security file protection
|
||||
|
||||
### Android `.gitignore` (Enhanced)
|
||||
- Platform-specific build files
|
||||
- Gradle wrapper exclusions
|
||||
- NDK and temporary files
|
||||
|
||||
## 🔧 Manual Release Workflow
|
||||
|
||||
### 1. Build Your APK/AAB
|
||||
```bash
|
||||
# Make the build script executable (already done)
|
||||
chmod +x build_apk.sh
|
||||
|
||||
# Run the build script
|
||||
./build_apk.sh
|
||||
```
|
||||
|
||||
### 2. Build Artifacts Location
|
||||
Build files are automatically placed in:
|
||||
- `lifetimer/build/app/outputs/flutter-apk/` (APK files)
|
||||
- `lifetimer/build/app/outputs/bundle/release/` (AAB files)
|
||||
|
||||
### 3. Distribution Ready
|
||||
The build script creates timestamped files in a `releases/` directory:
|
||||
- `releases/lifetimer-YYYYMMDD-HHMMSS.apk`
|
||||
- `releases/lifetimer-YYYYMMDD-HHMMSS.aab`
|
||||
|
||||
## 🔒 Security & Git Safety
|
||||
|
||||
### Keystore Management
|
||||
- Keystore files are **never** tracked by Git
|
||||
- Store your `key.properties` and `*.keystore` files securely
|
||||
- Use environment variables for sensitive data
|
||||
|
||||
### Build File Isolation
|
||||
- All build outputs are excluded from version control
|
||||
- Manual releases are completely separate from Git workflow
|
||||
- No risk of accidentally committing large binary files
|
||||
|
||||
## 📋 Verification Commands
|
||||
|
||||
### Check Git Status
|
||||
```bash
|
||||
# See untracked files (builds should be ignored)
|
||||
git status --ignored
|
||||
|
||||
# Verify no build files are tracked
|
||||
git ls-files | grep -E "(build|\.apk|\.aab|\.keystore)"
|
||||
```
|
||||
|
||||
### Test Build Exclusions
|
||||
```bash
|
||||
# Build should create files that Git ignores
|
||||
./build_apk.sh
|
||||
|
||||
# Verify build files are ignored
|
||||
git status
|
||||
# Should show: "nothing to commit, working tree clean"
|
||||
```
|
||||
|
||||
## 🚀 Release Process
|
||||
|
||||
1. **Build**: Run `./build_apk.sh`
|
||||
2. **Test**: Install APK on device/emulator
|
||||
3. **Distribute**: Share files from `releases/` directory
|
||||
4. **Version**: Update version numbers in `pubspec.yaml` if needed
|
||||
5. **Commit**: Only commit source code changes, never build files
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
- The `.gitignore` files are comprehensive and cover all major build artifacts
|
||||
- Manual releases give you full control over distribution timing
|
||||
- Build files are automatically excluded, preventing repository bloat
|
||||
- All sensitive files (keystores, env vars) are protected from accidental commits
|
||||
@@ -1,165 +0,0 @@
|
||||
# LifeTimer Security Audit Report
|
||||
|
||||
**Date:** 2026-01-03
|
||||
**Auditor:** Cascade
|
||||
**Version:** 1.0.0
|
||||
|
||||
## Executive Summary
|
||||
|
||||
The LifeTimer application demonstrates good security practices overall. The codebase follows Supabase security best practices with proper environment variable management, Row Level Security (RLS) policies, and secure authentication flows. No critical vulnerabilities were found.
|
||||
|
||||
## Security Findings
|
||||
|
||||
### ✅ Passed Checks
|
||||
|
||||
#### 1. Secrets Management
|
||||
- **Status:** PASS
|
||||
- **Details:** All sensitive configuration uses `String.fromEnvironment()` for build-time injection
|
||||
- **Location:** `lib/bootstrap/env.dart`
|
||||
- **Evidence:**
|
||||
- `SUPABASE_URL`, `SUPABASE_ANON_KEY`, `UNSPLASH_ACCESS_KEY`, `PEXELS_API_KEY` all use environment variables
|
||||
- No hardcoded secrets found in the codebase
|
||||
- Only public anon key is used (not service role key)
|
||||
|
||||
#### 2. Authentication & Authorization
|
||||
- **Status:** PASS
|
||||
- **Details:** Proper OAuth implementation through Supabase Auth
|
||||
- **Location:** `lib/data/repositories/auth_repository.dart`
|
||||
- **Evidence:**
|
||||
- Email/password authentication properly handled
|
||||
- Google OAuth using `google_sign_in` package with proper token flow
|
||||
- Apple OAuth using `sign_in_with_apple` package
|
||||
- Session validation and refresh implemented
|
||||
- User ID properly extracted from authenticated session
|
||||
|
||||
#### 3. Database Security (SQL Injection Prevention)
|
||||
- **Status:** PASS
|
||||
- **Details:** All database queries use Supabase's parameterized query builder
|
||||
- **Location:** All repository files in `lib/data/repositories/`
|
||||
- **Evidence:**
|
||||
- No raw SQL queries found
|
||||
- All queries use `.eq()`, `.select()`, `.insert()`, `.update()`, `.delete()` methods
|
||||
- User input is properly escaped by Supabase client
|
||||
- RLS policies configured on database side (see migration files)
|
||||
|
||||
#### 4. Input Validation
|
||||
- **Status:** PASS
|
||||
- **Details:** Comprehensive input validation implemented
|
||||
- **Location:** `lib/core/utils/validators.dart`
|
||||
- **Evidence:**
|
||||
- Email validation with regex
|
||||
- Password length validation (min 6 characters)
|
||||
- Username validation (3-20 chars, alphanumeric + underscore)
|
||||
- Goal title and description length limits
|
||||
- Progress range validation (0-100)
|
||||
|
||||
#### 5. HTTPS/TLS
|
||||
- **Status:** PASS
|
||||
- **Details:** All external API calls use HTTPS
|
||||
- **Location:** `lib/data/services/image_search_service.dart`, `lib/data/services/pexels_image_search_service.dart`
|
||||
- **Evidence:**
|
||||
- `Uri.https()` used for Unsplash API
|
||||
- `Uri.https()` used for Pexels API
|
||||
- No HTTP URLs found in codebase
|
||||
|
||||
#### 6. Data Access Control
|
||||
- **Status:** PASS
|
||||
- **Details:** Proper user isolation in data access
|
||||
- **Evidence:**
|
||||
- All queries include `.eq('owner_id', userId)` or `.eq('id', userId)`
|
||||
- Public profile visibility properly checked before exposing data
|
||||
- Social features only show public profiles
|
||||
|
||||
#### 7. No Code Injection Risks
|
||||
- **Status:** PASS
|
||||
- **Details:** No dangerous code execution patterns found
|
||||
- **Evidence:**
|
||||
- No `eval()`, `exec()`, or `runJavascript()` calls
|
||||
- No dynamic code generation
|
||||
- Function types used only for callbacks (not execution)
|
||||
|
||||
### ⚠️ Medium Priority Issues
|
||||
|
||||
#### 1. Logging with print() Statements
|
||||
- **Severity:** Medium
|
||||
- **Location:**
|
||||
- `lib/core/services/analytics_service.dart` (lines 23, 34)
|
||||
- `lib/data/services/offline_mutation_queue.dart` (line 69)
|
||||
- **Issue:** Using `print()` for logging in production code
|
||||
- **Recommendation:** Replace with proper logging framework (e.g., `logger` package) with configurable log levels
|
||||
- **Impact:** Minimal - current logs don't expose sensitive data
|
||||
|
||||
#### 2. Analytics Service Placeholder
|
||||
- **Severity:** Low
|
||||
- **Location:** `lib/core/services/analytics_service.dart`
|
||||
- **Issue:** Analytics service is a placeholder implementation
|
||||
- **Recommendation:** Integrate with proper analytics service (e.g., Firebase Analytics, Mixpanel) before production
|
||||
- **Impact:** No analytics data collection currently
|
||||
|
||||
### ℹ️ Recommendations
|
||||
|
||||
#### Security Best Practices
|
||||
1. **Implement Proper Logging Framework**
|
||||
- Add `logger` package to `pubspec.yaml`
|
||||
- Replace all `print()` statements with logger calls
|
||||
- Configure log levels for debug/release builds
|
||||
|
||||
2. **Add Certificate Pinning (Optional)**
|
||||
- Consider implementing certificate pinning for critical API calls
|
||||
- Mitigates man-in-the-middle attacks
|
||||
|
||||
3. **Add Rate Limiting (Server-Side)**
|
||||
- Implement rate limiting on Supabase Edge Functions
|
||||
- Prevent abuse of API endpoints
|
||||
|
||||
4. **Add Security Headers**
|
||||
- Configure CORS headers in Supabase
|
||||
- Add CSP headers if using web views
|
||||
|
||||
5. **Regular Security Audits**
|
||||
- Schedule quarterly security audits
|
||||
- Update dependencies regularly
|
||||
- Monitor security advisories
|
||||
|
||||
#### Privacy Considerations
|
||||
1. **Data Minimization**
|
||||
- Review collected data and ensure only necessary data is stored
|
||||
- Implement data retention policies
|
||||
|
||||
2. **User Consent**
|
||||
- Ensure proper consent mechanisms for analytics
|
||||
- Provide opt-out options
|
||||
|
||||
3. **Account Deletion**
|
||||
- Account deletion already implemented in `UserRepository`
|
||||
- Ensure all user data is properly deleted (cascade deletes)
|
||||
|
||||
## Compliance Checklist
|
||||
|
||||
- [x] No hardcoded secrets
|
||||
- [x] Proper authentication implementation
|
||||
- [x] SQL injection prevention
|
||||
- [x] Input validation
|
||||
- [x] HTTPS/TLS encryption
|
||||
- [x] User data isolation
|
||||
- [x] No code injection risks
|
||||
- [x] RLS policies configured (database level)
|
||||
- [x] Account deletion implemented
|
||||
- [ ] Proper logging framework (recommended)
|
||||
- [ ] Analytics integration (recommended)
|
||||
|
||||
## Conclusion
|
||||
|
||||
The LifeTimer application demonstrates strong security fundamentals. The use of Supabase with RLS policies, proper environment variable management, and parameterized queries provides a solid security foundation. The medium-priority issues are minor and can be addressed before production deployment.
|
||||
|
||||
**Overall Security Rating:** A- (Good)
|
||||
|
||||
**Recommendation:** Address logging framework integration before production launch. All other security practices are sound.
|
||||
|
||||
---
|
||||
|
||||
**Next Steps:**
|
||||
1. Integrate logging framework
|
||||
2. Complete code review
|
||||
3. Perform penetration testing (optional)
|
||||
4. Finalize app store submission
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 605 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 353 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 281 KiB |
@@ -1,92 +0,0 @@
|
||||
# LifeTimer Technical Architecture
|
||||
|
||||
This document describes how the Flutter app and Supabase backend are structured.
|
||||
|
||||
## 1. Overall approach
|
||||
|
||||
- Mobile first, built with Flutter for Android and iOS.
|
||||
- Supabase used for authentication, Postgres database, storage, and real time features.
|
||||
- MVVM or Clean Architecture style separation
|
||||
- Presentation, screens and widgets.
|
||||
- View models, state management using Provider or Riverpod.
|
||||
- Data layer, repositories that talk to Supabase clients.
|
||||
|
||||
## 2. Flutter project structure
|
||||
|
||||
Suggested feature based folder layout
|
||||
|
||||
- lib
|
||||
- core
|
||||
- theme, routing, localization, error handling, utilities
|
||||
- data
|
||||
- supabase client setup, repositories, models, mappers
|
||||
- features
|
||||
- auth
|
||||
- onboarding
|
||||
- goals
|
||||
- countdown
|
||||
- social
|
||||
- profile
|
||||
- settings
|
||||
- analytics
|
||||
|
||||
Each feature contains its own presentation widgets, view models, and sub repositories where needed.
|
||||
|
||||
## 3. Data flow
|
||||
|
||||
- UI widgets send user intents to view models.
|
||||
- View models call repositories for data access or mutations.
|
||||
- Repositories call Supabase client methods
|
||||
- auth api for login, logout, and account management
|
||||
- Postgres queries or rpc calls for business data
|
||||
- storage for media uploads
|
||||
- realtime channels for live updates
|
||||
- Results flow back up through view models to update state and rebuild widgets.
|
||||
|
||||
## 4. Supabase integration
|
||||
|
||||
- Single Supabase client instance configured at app start.
|
||||
- Environment configuration uses separate projects or keys for development, staging, and production.
|
||||
- Row Level Security used to protect tables so that users only see their own data, unless a profile is explicitly marked public, in which case only a limited subset of non sensitive fields is readable by others.
|
||||
- Edge functions may be added later for
|
||||
- computed metrics
|
||||
- scheduled notifications
|
||||
- heavy or sensitive operations.
|
||||
|
||||
## 5. Offline and caching
|
||||
|
||||
- Local persistence of last known state for
|
||||
- active countdown values
|
||||
- list of goals and their progress
|
||||
- Use local database or key value storage package such as Hive or Shared Preferences for small amounts of data.
|
||||
- Mark pending writes and retry them when connectivity is back.
|
||||
|
||||
## 6. Error handling and logging
|
||||
|
||||
- Centralized error handler that maps Supabase and network errors to user friendly messages.
|
||||
- Non fatal errors are logged to an analytics or crash reporting service.
|
||||
- Critical failures show a fallback screen with safe retry options.
|
||||
|
||||
## 7. Testing
|
||||
|
||||
- Unit tests for
|
||||
- countdown calculations
|
||||
- rules around starting and locking the countdown
|
||||
- goal progress calculations
|
||||
- Widget tests for
|
||||
- goal cards
|
||||
- countdown screen
|
||||
- onboarding flow
|
||||
- Basic integration tests for sign up, creating goals, and starting the countdown.
|
||||
|
||||
## 8. Security and privacy architecture
|
||||
|
||||
- Use Supabase Auth for all authentication; never store passwords or session tokens outside the auth system.
|
||||
- Ship only the public anon key in the mobile app; keep the service role key strictly on the server or in Supabase Edge Functions.
|
||||
- Enforce Row Level Security on all tables, with policies that
|
||||
- restrict reads and writes to `auth.uid()` for private accounts;
|
||||
- allow limited read only access to selected fields when `users.is_public_profile = true`.
|
||||
- Store access tokens only in platform secure storage APIs and never log them.
|
||||
- Validate all untrusted input on the server side and avoid constructing dynamic SQL from user data.
|
||||
- Minimize personally identifiable information stored in the database and support account deletion.
|
||||
- Use structured logging that avoids sensitive fields and route logs to a secure destination.
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Build Script for LifeTimer Flutter App
|
||||
# Creates versioned APK in build/release directory
|
||||
|
||||
echo "LifeTimer APK Build Script"
|
||||
echo "=========================="
|
||||
|
||||
# Navigate to the lifetimer directory
|
||||
cd lifetimer
|
||||
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Flutter version: $(flutter --version | head -n 1)"
|
||||
|
||||
# Get version from pubspec.yaml
|
||||
VERSION=$(grep "version:" pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)
|
||||
BUILD_NUMBER=$(grep "version:" pubspec.yaml | cut -d'+' -f2)
|
||||
|
||||
echo "Building LifeTimer version $VERSION (build $BUILD_NUMBER)"
|
||||
|
||||
# Create release directory
|
||||
mkdir -p build/release
|
||||
|
||||
# Build APK with version info and .env configuration
|
||||
echo "Building APK with .env configuration..."
|
||||
if flutter build apk --dart-define-from-file=.env --build-name=$VERSION --build-number=$BUILD_NUMBER; then
|
||||
echo "✅ APK build successful!"
|
||||
|
||||
# Copy to release directory with versioned name
|
||||
cp build/app/outputs/flutter-apk/app-release.apk build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk
|
||||
|
||||
echo "✅ Build complete: build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk"
|
||||
|
||||
# Show APK info
|
||||
ls -lh build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk
|
||||
|
||||
echo ""
|
||||
echo "You can install the APK with: adb install build/release/lifetimer-$VERSION-$BUILD_NUMBER.apk"
|
||||
|
||||
else
|
||||
echo "❌ APK build failed"
|
||||
echo ""
|
||||
echo "Troubleshooting steps:"
|
||||
echo "1. Update Flutter: flutter upgrade"
|
||||
echo "2. Clean project: flutter clean && flutter pub get"
|
||||
echo "3. Check Android SDK installation"
|
||||
echo "4. Verify .env file exists and is properly formatted"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Build script completed."
|
||||
@@ -1,271 +0,0 @@
|
||||
# LifeTimer Database Schema, Supabase
|
||||
|
||||
This document expands the schema sketch in project.md into a more detailed proposal for Postgres tables.
|
||||
|
||||
Note, naming and exact types can be adjusted when creating migrations.
|
||||
|
||||
## 1. users
|
||||
|
||||
Core user record.
|
||||
|
||||
- id, uuid, primary key
|
||||
- auth_provider_id, text or json, optional mapping to external providers
|
||||
- username, text, unique, required
|
||||
- email, text, unique, required
|
||||
- avatar_url, text, nullable
|
||||
- bio, text, nullable
|
||||
- is_public_profile, boolean, default false
|
||||
- countdown_start_date, timestamptz, nullable until bucket list is confirmed
|
||||
- countdown_end_date, timestamptz, nullable until challenge has started
|
||||
- created_at, timestamptz, default now
|
||||
- updated_at, timestamptz, default now
|
||||
|
||||
Row Level Security
|
||||
|
||||
- Users can select and update only their own row.
|
||||
- Public profile fields such as username and avatar, plus limited stats, can be exposed to other users only when `is_public_profile` is true.
|
||||
|
||||
## 2. goals
|
||||
|
||||
Represents one goal in the bucket list.
|
||||
|
||||
- id, uuid, primary key
|
||||
- owner_id, uuid, foreign key to users.id
|
||||
- title, text, required
|
||||
- description, text, nullable
|
||||
- progress, integer, 0 to 100, default 0
|
||||
- location_lat, double precision, nullable
|
||||
- location_lng, double precision, nullable
|
||||
- location_name, text, nullable
|
||||
- image_url, text, nullable
|
||||
- completed, boolean, default false
|
||||
- created_at, timestamptz, default now
|
||||
- updated_at, timestamptz, default now
|
||||
|
||||
Constraints
|
||||
|
||||
- Each user can have at most 20 goals in total. The countdown can start once there is at least one goal.
|
||||
|
||||
## 3. goal_steps
|
||||
|
||||
Optional more granular checklist per goal.
|
||||
|
||||
- id, uuid, primary key
|
||||
- goal_id, uuid, foreign key to goals.id
|
||||
- title, text
|
||||
- is_done, boolean, default false
|
||||
- order_index, integer
|
||||
- created_at, timestamptz, default now
|
||||
|
||||
## 4. followers
|
||||
|
||||
Social graph between users.
|
||||
|
||||
- id, uuid, primary key
|
||||
- user_id, uuid, the user being followed
|
||||
- follower_id, uuid, the user who follows
|
||||
- created_at, timestamptz, default now
|
||||
|
||||
Constraint
|
||||
|
||||
- unique user_id, follower_id
|
||||
|
||||
## 5. activities
|
||||
|
||||
Timeline of events used for feeds and analytics.
|
||||
|
||||
- id, uuid, primary key
|
||||
- user_id, uuid, foreign key to users.id
|
||||
- type, text, for example goal_created, goal_completed, countdown_started
|
||||
- payload, jsonb, optional extra data
|
||||
- created_at, timestamptz, default now
|
||||
|
||||
## 6. notifications
|
||||
|
||||
Optional table for storing notifications when server side delivery is needed.
|
||||
|
||||
- id, uuid, primary key
|
||||
- user_id, uuid, foreign key to users.id
|
||||
- type, text
|
||||
- title, text
|
||||
- body, text
|
||||
- scheduled_for, timestamptz, nullable
|
||||
- delivered_at, timestamptz, nullable
|
||||
|
||||
## 7. indexes and performance
|
||||
|
||||
- Index on goals.owner_id.
|
||||
- Index on activities.user_id and created_at for feed queries.
|
||||
- Index on followers.user_id and followers.follower_id.
|
||||
|
||||
## 8. Example Row Level Security (RLS) policies
|
||||
|
||||
The following snippets show how to enforce the privacy model using PostgreSQL RLS in Supabase.
|
||||
|
||||
### 8.1 Enable RLS on tables
|
||||
|
||||
```sql
|
||||
alter table public.users enable row level security;
|
||||
alter table public.goals enable row level security;
|
||||
alter table public.goal_steps enable row level security;
|
||||
alter table public.followers enable row level security;
|
||||
alter table public.activities enable row level security;
|
||||
alter table public.notifications enable row level security;
|
||||
```
|
||||
|
||||
### 8.2 users
|
||||
|
||||
Users can only see and update their own profile row.
|
||||
|
||||
```sql
|
||||
create policy "Users can select their own profile"
|
||||
on public.users
|
||||
for select
|
||||
using ( auth.uid() = id );
|
||||
|
||||
create policy "Users can update their own profile"
|
||||
on public.users
|
||||
for update
|
||||
using ( auth.uid() = id )
|
||||
with check ( auth.uid() = id );
|
||||
```
|
||||
|
||||
Social and leaderboard queries should **not** select directly from `public.users` with broad access. Instead, implement read-only views or RPC functions that expose only non-sensitive fields for public profiles and are called from secure backend code (for example Supabase Edge Functions using the service role key).
|
||||
|
||||
### 8.3 goals
|
||||
|
||||
Goals are always private to their owner.
|
||||
|
||||
```sql
|
||||
create policy "Users can read their own goals"
|
||||
on public.goals
|
||||
for select
|
||||
using ( auth.uid() = owner_id );
|
||||
|
||||
create policy "Users can insert their own goals"
|
||||
on public.goals
|
||||
for insert
|
||||
with check ( auth.uid() = owner_id );
|
||||
|
||||
create policy "Users can update their own goals"
|
||||
on public.goals
|
||||
for update
|
||||
using ( auth.uid() = owner_id )
|
||||
with check ( auth.uid() = owner_id );
|
||||
|
||||
create policy "Users can delete their own goals"
|
||||
on public.goals
|
||||
for delete
|
||||
using ( auth.uid() = owner_id );
|
||||
```
|
||||
|
||||
### 8.4 goal_steps
|
||||
|
||||
Access to goal steps is tied to ownership of the parent goal.
|
||||
|
||||
```sql
|
||||
create policy "Users can read steps for their own goals"
|
||||
on public.goal_steps
|
||||
for select
|
||||
using (
|
||||
exists (
|
||||
select 1 from public.goals g
|
||||
where g.id = goal_id and g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
create policy "Users can insert steps for their own goals"
|
||||
on public.goal_steps
|
||||
for insert
|
||||
with check (
|
||||
exists (
|
||||
select 1 from public.goals g
|
||||
where g.id = goal_id and g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
create policy "Users can update steps for their own goals"
|
||||
on public.goal_steps
|
||||
for update
|
||||
using (
|
||||
exists (
|
||||
select 1 from public.goals g
|
||||
where g.id = goal_id and g.owner_id = auth.uid()
|
||||
)
|
||||
)
|
||||
with check (
|
||||
exists (
|
||||
select 1 from public.goals g
|
||||
where g.id = goal_id and g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
create policy "Users can delete steps for their own goals"
|
||||
on public.goal_steps
|
||||
for delete
|
||||
using (
|
||||
exists (
|
||||
select 1 from public.goals g
|
||||
where g.id = goal_id and g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
### 8.5 followers
|
||||
|
||||
Follow relationships are visible only to the users involved. Either side can remove a relationship.
|
||||
|
||||
```sql
|
||||
create policy "Users can read their follower relationships"
|
||||
on public.followers
|
||||
for select
|
||||
using ( auth.uid() = user_id or auth.uid() = follower_id );
|
||||
|
||||
create policy "Users can follow others"
|
||||
on public.followers
|
||||
for insert
|
||||
with check ( auth.uid() = follower_id );
|
||||
|
||||
create policy "Users can unfollow or remove followers"
|
||||
on public.followers
|
||||
for delete
|
||||
using ( auth.uid() = user_id or auth.uid() = follower_id );
|
||||
```
|
||||
|
||||
### 8.6 activities
|
||||
|
||||
Users see only their own activity timeline. Public feeds and leaderboards should use separate, read-only views or RPC functions that return aggregated activity for public profiles only.
|
||||
|
||||
```sql
|
||||
create policy "Users can read their own activity"
|
||||
on public.activities
|
||||
for select
|
||||
using ( auth.uid() = user_id );
|
||||
|
||||
create policy "Users can insert their own activity events"
|
||||
on public.activities
|
||||
for insert
|
||||
with check ( auth.uid() = user_id );
|
||||
```
|
||||
|
||||
### 8.7 notifications
|
||||
|
||||
Notifications are private to the recipient user.
|
||||
|
||||
```sql
|
||||
create policy "Users can read their own notifications"
|
||||
on public.notifications
|
||||
for select
|
||||
using ( auth.uid() = user_id );
|
||||
|
||||
create policy "Users can receive their own notifications"
|
||||
on public.notifications
|
||||
for insert
|
||||
with check ( auth.uid() = user_id );
|
||||
|
||||
create policy "Users can delete their own notifications"
|
||||
on public.notifications
|
||||
for delete
|
||||
using ( auth.uid() = user_id );
|
||||
```
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
# LifeTimer Development Roadmap
|
||||
|
||||
This roadmap breaks down the phases from project.md into concrete milestones.
|
||||
|
||||
## Phase 0 Planning and foundations
|
||||
|
||||
Status, in progress
|
||||
|
||||
- [x] Clarify product vision and constraints.
|
||||
- [x] Create high level project plan and documentation.
|
||||
- [ ] Set up Flutter project with base folder structure.
|
||||
- [ ] Configure Supabase project, environment variables, and basic tables.
|
||||
- [ ] Set up version control and basic continuous integration.
|
||||
|
||||
## Phase 1 MVP core experience
|
||||
|
||||
Goal, a private personal countdown with a bucket list of up to 20 goals.
|
||||
|
||||
- [ ] Implement authentication and profile editing.
|
||||
- [ ] Implement bucket list creation and editing, limited to 20 goals.
|
||||
- [ ] Implement confirmation flow that locks the bucket list and starts the countdown.
|
||||
- [ ] Implement home countdown screen with large timer and percentage of time elapsed.
|
||||
- [ ] Implement basic goals list and goal detail with progress and completion.
|
||||
- [ ] Implement local notifications for daily or weekly reminders.
|
||||
- [ ] Add simple analytics events for key actions.
|
||||
|
||||
Exit criteria
|
||||
|
||||
- A user can sign up, create and confirm a bucket list, see the countdown, and track progress on their goals on at least one platform.
|
||||
|
||||
## Phase 2 Social and motivation
|
||||
|
||||
Goal, optional social layer that motivates users without forcing them to share.
|
||||
|
||||
- [ ] Implement following system and basic public profiles.
|
||||
- [ ] Implement activity feed of public milestones.
|
||||
- [ ] Implement leaderboards for goals completed and active streaks.
|
||||
- [ ] Add achievements and badges.
|
||||
- [ ] Extend notification logic for social events.
|
||||
|
||||
Exit criteria
|
||||
|
||||
- Users can opt in to sharing and see others public progress in a simple, motivating feed.
|
||||
|
||||
## Phase 3 Advanced experience
|
||||
|
||||
Goal, make the app richer and more insightful.
|
||||
|
||||
- [ ] Add charts and insights for progress versus time.
|
||||
- [ ] Integrate image APIs for automatic goal cover images.
|
||||
- [ ] Add map integration for location based goals.
|
||||
- [ ] Improve offline support and caching.
|
||||
- [ ] Extend settings, themes, and personalization.
|
||||
|
||||
## Phase 4 Polish and release
|
||||
|
||||
- [ ] Accessibility review and improvements.
|
||||
- [ ] Performance tuning on low end devices.
|
||||
- [ ] App Store and Play Store preparation, listings, screenshots, and policies.
|
||||
- [ ] Beta testing and bug fixing.
|
||||
- [ ] Public release and monitoring.
|
||||
@@ -1,215 +0,0 @@
|
||||
# LifeTimer — Flutter Project Structure
|
||||
|
||||
This document describes the recommended folder and file structure for the LifeTimer Flutter app, aligned with the architecture and flows.
|
||||
|
||||
Assumption: you will start from a standard `flutter create lifetimer` project, then adapt the `lib/` directory as follows.
|
||||
|
||||
---
|
||||
|
||||
## 1. High level layout
|
||||
|
||||
- `lib/`
|
||||
- `main.dart` — app entrypoint, initializes Supabase and runs `LifeTimerApp`.
|
||||
- `bootstrap/` — initialization helpers (Supabase client, dependency injection, env config).
|
||||
- `core/` — cross cutting concerns (theme, routing, localization, widgets, utils, error handling).
|
||||
- `data/` — shared data layer code (models, repositories, Supabase clients).
|
||||
- `features/` — feature modules (auth, onboarding, goals, countdown, social, profile, settings, analytics).
|
||||
|
||||
---
|
||||
|
||||
## 2. lib/main.dart
|
||||
|
||||
Responsibilities:
|
||||
|
||||
- Ensure Flutter bindings are initialized.
|
||||
- Initialize Supabase client (using config from `bootstrap/`).
|
||||
- Run the `LifeTimerApp` widget.
|
||||
|
||||
File:
|
||||
|
||||
- `lib/main.dart`
|
||||
|
||||
---
|
||||
|
||||
## 3. Bootstrap and configuration
|
||||
|
||||
Folder:
|
||||
|
||||
- `lib/bootstrap/`
|
||||
- `bootstrap.dart` — high level `bootstrap()` function called from `main.dart` (sets up Supabase, error handlers, env).
|
||||
- `supabase_client.dart` — creates and exposes a configured Supabase client instance.
|
||||
- `env.dart` — holds environment configuration (Supabase URL, anon key, build flavor hooks).
|
||||
|
||||
---
|
||||
|
||||
## 4. Core module
|
||||
|
||||
Folder:
|
||||
|
||||
- `lib/core/`
|
||||
- `theme/`
|
||||
- `app_theme.dart` — light/dark theme definitions, colors, typography.
|
||||
- `routing/`
|
||||
- `app_router.dart` — central route definitions and navigation helpers.
|
||||
- `localization/`
|
||||
- `l10n.dart` — localization setup (generated or custom wrapper).
|
||||
- `widgets/`
|
||||
- `primary_button.dart` — reusable CTA button.
|
||||
- `app_scaffold.dart` — base scaffold with consistent background and app bar style.
|
||||
- `bottom_nav_scaffold.dart` — scaffold wiring bottom navigation.
|
||||
- `loading_indicator.dart` — standard loading widget.
|
||||
- `empty_state.dart` — reusable empty state widget.
|
||||
- `errors/`
|
||||
- `failure.dart` — domain error types.
|
||||
- `error_mapper.dart` — maps Supabase / network errors to user friendly messages.
|
||||
- `utils/`
|
||||
- `date_time_utils.dart` — countdown calculations, formatting.
|
||||
- `validators.dart` — input validation helpers.
|
||||
- `state/` (if using Riverpod/Provider wrappers)
|
||||
- `providers.dart` — top level providers (Supabase client, theme mode, auth state).
|
||||
|
||||
---
|
||||
|
||||
## 5. Data layer
|
||||
|
||||
Folder:
|
||||
|
||||
- `lib/data/`
|
||||
- `supabase/`
|
||||
- `supabase_client_provider.dart` — exposes Supabase client to the app (e.g., via Riverpod/Provider).
|
||||
- `models/`
|
||||
- `user_model.dart` — app level User model.
|
||||
- `goal_model.dart` — Goal model.
|
||||
- `goal_step_model.dart` — GoalStep model.
|
||||
- `activity_model.dart` — Activity model.
|
||||
- `repositories/`
|
||||
- `auth_repository.dart` — login, logout, token refresh.
|
||||
- `user_repository.dart` — profile read/update, visibility toggle.
|
||||
- `goals_repository.dart` — CRUD for goals and steps, enforce 1–20 limit.
|
||||
- `countdown_repository.dart` — start countdown, compute remaining time.
|
||||
- `social_repository.dart` — followers, feeds, leaderboards (Phase 2+).
|
||||
- `notifications_repository.dart` — notification preferences and tokens.
|
||||
|
||||
Repositories hide Supabase queries behind a clean API, so features do not talk to Supabase directly.
|
||||
|
||||
---
|
||||
|
||||
## 6. Feature modules
|
||||
|
||||
Each feature lives under `lib/features/<feature_name>/` with a simple structure:
|
||||
|
||||
- `presentation/` — screens and widgets.
|
||||
- `application/` — state management (view models, controllers, providers).
|
||||
- `domain/` (optional) — feature specific entities and logic.
|
||||
|
||||
### 6.1 Auth feature
|
||||
|
||||
- `lib/features/auth/presentation/`
|
||||
- `auth_gate.dart` — decides whether to show auth screens or main app based on session.
|
||||
- `sign_in_screen.dart`
|
||||
- `sign_up_screen.dart`
|
||||
- `auth_loading_screen.dart` — transient during OAuth redirects.
|
||||
- `lib/features/auth/application/`
|
||||
- `auth_controller.dart` — wraps `auth_repository`, exposes current user/session state.
|
||||
|
||||
### 6.2 Onboarding feature
|
||||
|
||||
- `lib/features/onboarding/presentation/`
|
||||
- `onboarding_intro_screen.dart`
|
||||
- `onboarding_how_it_works_screen.dart`
|
||||
- `onboarding_motivation_screen.dart`
|
||||
- `lib/features/onboarding/application/`
|
||||
- `onboarding_controller.dart` — tracks whether onboarding is completed.
|
||||
|
||||
### 6.3 Goals feature
|
||||
|
||||
- `lib/features/goals/presentation/`
|
||||
- `goals_list_screen.dart` — list of goals, empty state, add/edit buttons.
|
||||
- `goal_edit_screen.dart` — create/edit goal (title, description, location, image, milestones).
|
||||
- `goal_detail_screen.dart` — view and update progress, mark as completed.
|
||||
- `lib/features/goals/application/`
|
||||
- `goals_controller.dart` — loads goals, enforces max 20, exposes list/state.
|
||||
- `goal_detail_controller.dart` — state for a single goal.
|
||||
|
||||
### 6.4 Countdown feature
|
||||
|
||||
- `lib/features/countdown/presentation/`
|
||||
- `home_countdown_screen.dart` — main world-time inspired countdown UI.
|
||||
- `countdown_summary_screen.dart` — shown after countdown ends, summary stats.
|
||||
- `lib/features/countdown/application/`
|
||||
- `countdown_controller.dart` — calculates remaining time, exposes streams/timers.
|
||||
|
||||
### 6.5 Social feature (Phase 2+)
|
||||
|
||||
- `lib/features/social/presentation/`
|
||||
- `social_feed_screen.dart`
|
||||
- `leaderboards_screen.dart`
|
||||
- `public_profile_screen.dart`
|
||||
- `lib/features/social/application/`
|
||||
- `social_feed_controller.dart`
|
||||
- `leaderboards_controller.dart`
|
||||
|
||||
### 6.6 Profile feature
|
||||
|
||||
- `lib/features/profile/presentation/`
|
||||
- `profile_screen.dart` — shows own profile, countdown info, stats.
|
||||
- `lib/features/profile/application/`
|
||||
- `profile_controller.dart` — loads and updates profile, visibility, avatar.
|
||||
|
||||
### 6.7 Settings feature
|
||||
|
||||
- `lib/features/settings/presentation/`
|
||||
- `settings_home_screen.dart`
|
||||
- `account_settings_screen.dart`
|
||||
- `appearance_settings_screen.dart`
|
||||
- `notification_settings_screen.dart`
|
||||
- `privacy_settings_screen.dart` — global Public/Private toggle, blocking.
|
||||
- `about_challenge_screen.dart`
|
||||
- `lib/features/settings/application/`
|
||||
- `settings_controller.dart` — wraps repositories for user preferences.
|
||||
|
||||
### 6.8 Analytics / insights (Phase 3)
|
||||
|
||||
- `lib/features/analytics/presentation/`
|
||||
- `insights_screen.dart` — charts and stats.
|
||||
- `lib/features/analytics/application/`
|
||||
- `insights_controller.dart`
|
||||
|
||||
---
|
||||
|
||||
## 7. Navigation and route names
|
||||
|
||||
- Central router file: `lib/core/routing/app_router.dart`.
|
||||
- Define named routes for key screens, grouped by feature, e.g.:
|
||||
- `/` → `AuthGate` (decides between auth vs main app).
|
||||
- `/onboarding/*` for onboarding screens.
|
||||
- `/home` → `HomeCountdownScreen`.
|
||||
- `/goals`, `/goals/:id`, `/goals/:id/edit`.
|
||||
- `/social`, `/social/leaderboards`, `/u/:username`.
|
||||
- `/settings/*` for settings sections.
|
||||
|
||||
The router uses the navigation library you choose (Navigator 2.0, go_router, etc.); this file is the single source of truth for destinations.
|
||||
|
||||
---
|
||||
|
||||
## 8. State management
|
||||
|
||||
If you use Riverpod or Provider:
|
||||
|
||||
- Global providers in `lib/core/state/providers.dart`:
|
||||
- `supabaseClientProvider`
|
||||
- `authControllerProvider`
|
||||
- `themeModeProvider`
|
||||
- Feature specific providers next to controllers in their `application/` folders.
|
||||
|
||||
---
|
||||
|
||||
## 9. Testing structure
|
||||
|
||||
Mirror the feature structure under `test/`:
|
||||
|
||||
- `test/core/` — utilities, date/time tests, error mapping tests.
|
||||
- `test/data/` — repository tests with mocked Supabase client.
|
||||
- `test/features/<feature_name>/` — unit and widget tests for each feature.
|
||||
|
||||
This structure keeps the app modular and makes it easy to grow features (e.g., adding more social or analytics functionality) without losing clarity.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB |
@@ -1,190 +0,0 @@
|
||||
# LifeTimer — Navigation and User Flows
|
||||
|
||||
This document describes the main screens, navigation, and user journeys for the LifeTimer app.
|
||||
|
||||
---
|
||||
|
||||
## 1. Screen map and navigation
|
||||
|
||||
### 1.1 Global structure
|
||||
|
||||
- **Splash / Launch**
|
||||
- Lightweight loading and environment check.
|
||||
- Determines whether to show onboarding or go directly to the app.
|
||||
|
||||
- **Onboarding flow**
|
||||
- `OnboardingIntro` — explain the 1356‑day challenge concept.
|
||||
- `OnboardingHowItWorks` — steps: set 1–20 goals → lock list → 1356‑day countdown.
|
||||
- `OnboardingMotivation` — motivational examples, visuals.
|
||||
- Final screen leads to authentication.
|
||||
|
||||
- **Authentication**
|
||||
- `AuthChoice` — sign up / log in buttons, Google and Apple options.
|
||||
- `SignUpEmail` — email + password registration.
|
||||
- `SignInEmail` — email + password login.
|
||||
- `OAuthRedirect` — transient screen while completing Google / Apple sign‑in.
|
||||
- After auth, go to profile or home depending on completion state.
|
||||
|
||||
- **Profile setup (first time)**
|
||||
- `CreateProfile` — avatar, username (unique), short bio.
|
||||
- Once done, proceed to bucket list intro.
|
||||
|
||||
- **Main app shell**
|
||||
- Bottom navigation with 4–5 tabs:
|
||||
- **Home** — countdown and high‑level summary.
|
||||
- **Goals** — bucket list and goal management.
|
||||
- **Social** — feed, leaderboards (Phase 2+).
|
||||
- **Profile** — own profile, stats, settings entry.
|
||||
- **Insights (optional)** — charts and analytics (Phase 3).
|
||||
|
||||
The bottom nav is persistent after login; individual flows push screens on top of the tab stacks.
|
||||
|
||||
---
|
||||
|
||||
## 2. Core journey: new user to active countdown
|
||||
|
||||
### 2.1 First session flow
|
||||
|
||||
1. **Launch → Onboarding**
|
||||
- `Splash` → `OnboardingIntro`.
|
||||
- User swipes or taps Next through 2–3 explanatory screens.
|
||||
- Final onboarding screen CTA: **Get started** → `AuthChoice`.
|
||||
|
||||
2. **Authentication**
|
||||
- Choose **Sign up with email**, **Google**, or **Apple**.
|
||||
- On success, navigate to `CreateProfile`.
|
||||
|
||||
3. **Profile setup**
|
||||
- Enter avatar (optional), username (required, uniqueness validated), and short bio.
|
||||
- CTA **Continue** → `BucketListIntro`.
|
||||
|
||||
4. **Bucket list introduction**
|
||||
- `BucketListIntro` explains rules:
|
||||
- You can create between 1 and 20 goals.
|
||||
- Countdown only starts when your list is finalized and you have at least one goal.
|
||||
- Once started, cannot be paused or reset.
|
||||
- CTA **Start creating my list** → `GoalsListEdit` (empty state).
|
||||
|
||||
5. **Creating goals**
|
||||
- `GoalsListEdit` (tab: Goals) shows empty state card: “No goals yet. Add your first goal”.
|
||||
- Tap **Add goal** → `GoalEdit` screen.
|
||||
|
||||
6. **Goal edit flow**
|
||||
- Fields: Title (required), Description, Location, Image, Milestones.
|
||||
- User can add milestones / steps.
|
||||
- CTA **Save goal** returns to `GoalsListEdit`.
|
||||
- User repeats Add goal until satisfied (up to 20; UI shows **x / 20 goals created**; the countdown start action becomes available once x ≥ 1).
|
||||
|
||||
7. **Confirming the bucket list**
|
||||
- When user has created at least one goal, a prominent CTA appears: **Finalize list and start 1356‑day challenge**.
|
||||
- Tapping CTA opens `ConfirmBucketListDialog`:
|
||||
- Summary: number of goals, explanation of irreversible start.
|
||||
- Options:
|
||||
- **Start countdown** — sets `countdown_start_date` and `countdown_end_date`, navigates to `HomeCountdown`.
|
||||
- **Review goals** — returns to `GoalsListEdit`.
|
||||
|
||||
8. **First countdown view**
|
||||
- `HomeCountdown` shows:
|
||||
- Very large remaining days (world‑clock inspired layout).
|
||||
- Smaller breakdown: days, hours, minutes, seconds.
|
||||
- Progress ring or bar showing percentage of time elapsed.
|
||||
- Short motivational message.
|
||||
- Primary CTA: **View my goals** (to Goals tab).
|
||||
|
||||
### 2.2 If bucket list is not finalized
|
||||
|
||||
- If a user leaves the app before finalizing:
|
||||
- On next login, `Home` shows “Your challenge hasn’t started yet” with progress in creating goals (e.g., 5 / 20 goals completed) and a CTA to **Finish my list** → `GoalsListEdit`.
|
||||
|
||||
---
|
||||
|
||||
## 3. Daily usage: updating progress
|
||||
|
||||
1. User opens app.
|
||||
2. `Splash` quickly forwards to last state; for active users this is `HomeCountdown`.
|
||||
3. On `HomeCountdown`:
|
||||
- User sees remaining time and high‑level completion percentage across all goals.
|
||||
- CTA **Update progress** → `GoalsList`.
|
||||
4. In `GoalsList`:
|
||||
- Each goal card shows title, image, small progress bar, and possibly remaining time highlight.
|
||||
- Tap a goal → `GoalDetail`.
|
||||
5. In `GoalDetail`:
|
||||
- User marks milestones as done or adjusts progress slider.
|
||||
- Optional note field for journal‑style comments.
|
||||
- CTA **Mark goal as completed** when all steps are done.
|
||||
6. On completion:
|
||||
- Show lightweight celebration overlay.
|
||||
- Offer **Share to community** if social features are enabled.
|
||||
|
||||
---
|
||||
|
||||
## 4. Social and community flows (Phase 2+)
|
||||
|
||||
### 4.1 Opting into sharing
|
||||
|
||||
- From `Profile` or `Settings > Privacy`:
|
||||
- Global toggle **Make my profile public** (account visibility: Public / Private).
|
||||
- Optional privacy explanation sheet before first activation, explaining which data becomes visible.
|
||||
|
||||
### 4.2 Browsing the feed
|
||||
|
||||
1. Tap **Social** tab.
|
||||
2. `SocialFeed` shows a list of public milestones and completed goals.
|
||||
- Cards: user avatar + name, goal title, completion date, days remaining.
|
||||
3. Tap a card → `PublicMilestoneDetail`.
|
||||
4. From `PublicMilestoneDetail`:
|
||||
- CTA **Follow user** → adds follower row.
|
||||
- View **User profile** → `PublicProfile`.
|
||||
|
||||
Only users with Public accounts appear in the social feed or can be followed.
|
||||
|
||||
### 4.3 Leaderboards
|
||||
|
||||
- From `SocialFeed`, user can switch tabs:
|
||||
- `Feed`, `Leaderboards`.
|
||||
- `Leaderboards` shows rankings (goals completed, streaks, etc.).
|
||||
- Tap an entry → `PublicProfile`.
|
||||
|
||||
Only users with Public accounts appear on leaderboards.
|
||||
|
||||
---
|
||||
|
||||
## 5. Settings and notifications
|
||||
|
||||
### 5.1 Accessing settings
|
||||
|
||||
- From **Profile** tab, button **Settings** → `SettingsHome`.
|
||||
|
||||
### 5.2 Settings subsections
|
||||
|
||||
- `AccountSettings` — email, password, delete account.
|
||||
- `AppearanceSettings` — light/dark, time format (12/24h).
|
||||
- `NotificationSettings` — reminder frequency, categories.
|
||||
- `PrivacySettings` — global public/private account visibility toggle and blocking.
|
||||
- `AboutChallenge` — re‑explain rules and philosophy.
|
||||
|
||||
### 5.3 Notification flows
|
||||
|
||||
- When user taps a push notification:
|
||||
- Reminder about time remaining → deep link to `HomeCountdown`.
|
||||
- Goal progress reminder → deep link to `GoalDetail` for that goal.
|
||||
- Social notification → deep link to `SocialFeed` or `PublicMilestoneDetail`.
|
||||
|
||||
---
|
||||
|
||||
## 6. Edge cases and empty states
|
||||
|
||||
- **No internet connection**
|
||||
- Show cached countdown and goals with offline banner.
|
||||
- Disable actions that require network or queue them.
|
||||
|
||||
- **No goals yet (new user)**
|
||||
- `GoalsList` shows illustrative empty state with CTA **Add your first goal**.
|
||||
|
||||
- **Countdown finished**
|
||||
- `HomeCountdown` switches to a summary view:
|
||||
- “1356 days completed”
|
||||
- Stats: goals completed, streaks, favorite milestones.
|
||||
- CTA to review journey or share a reflection.
|
||||
|
||||
This document should be kept in sync with the UI spec and roadmap as features are added or removed.
|
||||
-226
@@ -1,226 +0,0 @@
|
||||
# LifeTimer App (1356-Day Countdown) — Project Plan (Supabase Edition)
|
||||
|
||||
## 1. Project Overview
|
||||
|
||||
**App Name (Working):** LifeTimer
|
||||
|
||||
**Concept:**
|
||||
LifeTimer is a gamified life countdown app. Each user creates a personal bucket list (up to 20 entries), and the 1356-day countdown begins **only after they finalize all goals**. The countdown cannot be stopped, paused, extended, or changed once started.
|
||||
|
||||
Users can track their progress, visualize remaining time, and optionally share achievements or milestones with the community. Some bucket list entries may include map locations or images pulled from external APIs.
|
||||
|
||||
**Target Platforms:**
|
||||
|
||||
* Android (Play Store)
|
||||
* iOS (App Store)
|
||||
|
||||
**Target Audience:**
|
||||
|
||||
* Users motivated by time-limited personal challenges.
|
||||
* People who enjoy gamification, life planning, and social inspiration.
|
||||
|
||||
---
|
||||
|
||||
## 2. Core Features
|
||||
|
||||
### 2.1 User Management
|
||||
|
||||
* Sign up / login (email, Google, Apple ID) via Supabase Auth
|
||||
* User profile: avatar, username, bio
|
||||
* Online status indicator
|
||||
|
||||
### 2.2 1356-Day Countdown
|
||||
|
||||
* **Countdown starts only after the user completes their bucket list (up to 20 items)**
|
||||
* Each user has exactly 1356 days (≈3 years 8 months 11 days)
|
||||
* Cannot be paused, reset, or modified
|
||||
* Display as a live countdown (days, hours, minutes, seconds)
|
||||
* Optional progress bar showing percentage of time passed
|
||||
|
||||
### 2.3 Bucket List & Goal Tracking
|
||||
|
||||
* Users can add up to **20 bucket list entries**
|
||||
* Each goal has:
|
||||
|
||||
* Title and optional description
|
||||
* Progress tracker (completed steps or milestones)
|
||||
* Optional location (integrated with Maps APIs)
|
||||
* Optional image/media (pulled from input or APIs based on title)
|
||||
* Goals serve as motivation; they do not affect countdown duration
|
||||
* Visual indication of goal progress relative to countdown
|
||||
|
||||
### 2.4 Social / Online Interaction
|
||||
|
||||
* Share milestones or completed goals with other users
|
||||
* View other users’ public progress (optional)
|
||||
* Leaderboards for motivation (e.g., most goals completed within 1356 days)
|
||||
|
||||
### 2.5 Notifications
|
||||
|
||||
* Countdown reminders (daily, weekly, milestone alerts)
|
||||
* Achievement & streak notifications
|
||||
|
||||
### 2.6 Analytics & Insights
|
||||
|
||||
* Daily/weekly stats of goals completed
|
||||
* Progress visualization vs countdown
|
||||
* Simple motivational messages based on progress
|
||||
|
||||
---
|
||||
|
||||
## 3. UI/UX Inspiration
|
||||
|
||||
* Clean and minimal UI with light/pastel colors
|
||||
* Use cards to show goals and countdown progress
|
||||
* Bottom navigation: Home / Goals / Social / Profile
|
||||
* Large visual display for countdown (center of home screen)
|
||||
* Progress bars, charts, or line graphs for milestone tracking
|
||||
|
||||
**Suggested Screens:**
|
||||
|
||||
1. **Onboarding:** Explanation of the 1356-day challenge, motivational text
|
||||
2. **Bucket List Creation:**
|
||||
|
||||
* Add up to 20 goals
|
||||
* Optional images and map locations for each entry
|
||||
* Countdown cannot start until list is complete
|
||||
3. **Home Screen:**
|
||||
|
||||
* Live countdown timer
|
||||
* Progress circle/bar
|
||||
* Motivational messages
|
||||
4. **Goals Screen:** List of bucket list items and progress
|
||||
5. **Social Screen:** Optional leaderboard or public milestones
|
||||
6. **Profile Screen:** Avatar, username, start date, days left, achievements
|
||||
7. **Settings:** Notifications, privacy, theme preferences
|
||||
|
||||
---
|
||||
|
||||
## 4. Tech Stack
|
||||
|
||||
### 4.1 Mobile Framework
|
||||
|
||||
* Flutter (cross-platform, beginner-friendly)
|
||||
|
||||
### 4.2 Backend / API
|
||||
|
||||
* **Supabase**: full backend replacement for Firebase
|
||||
|
||||
* **Auth:** Email, Google, Apple ID
|
||||
* **Database:** PostgreSQL for users, goals, and social interactions
|
||||
* **Realtime:** Supabase Realtime for live updates (goal progress, social feed)
|
||||
* **Storage:** Media storage for goal images/videos
|
||||
* External APIs:
|
||||
|
||||
* Maps (Google Maps / OpenStreetMap) for location-based goals
|
||||
* Image APIs (Unsplash, Pexels, or AI-generated)
|
||||
|
||||
### 4.3 State Management
|
||||
|
||||
* Flutter: Provider or Riverpod
|
||||
|
||||
### 4.4 Notifications
|
||||
|
||||
* Local push notifications (Flutter local_notifications package)
|
||||
* Optional server-side notifications via Supabase Edge Functions
|
||||
|
||||
### 4.5 Analytics
|
||||
|
||||
* Supabase logs + optional third-party analytics (e.g., Mixpanel)
|
||||
|
||||
### 4.6 Design System
|
||||
|
||||
* Material 3 / Cupertino widgets
|
||||
* Custom color themes for progress stages
|
||||
|
||||
---
|
||||
|
||||
## 5. Database Structure (Supabase PostgreSQL Example)
|
||||
|
||||
**Tables:**
|
||||
|
||||
```sql
|
||||
users
|
||||
id (uuid, primary key)
|
||||
username
|
||||
email
|
||||
avatar_url
|
||||
bio
|
||||
countdown_start_date (null until bucket list completed)
|
||||
countdown_end_date (calculated automatically as start + 1356 days)
|
||||
created_at
|
||||
updated_at
|
||||
|
||||
goals
|
||||
id (uuid, primary key)
|
||||
owner_id (foreign key → users.id)
|
||||
title
|
||||
description
|
||||
progress (0-100)
|
||||
location_lat
|
||||
location_lng
|
||||
location_name
|
||||
image_url
|
||||
completed (boolean)
|
||||
created_at
|
||||
updated_at
|
||||
|
||||
followers
|
||||
id (uuid, primary key)
|
||||
user_id (foreign key → users.id)
|
||||
follower_id (foreign key → users.id)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. App Architecture
|
||||
|
||||
* MVVM / Clean Architecture
|
||||
* **Model:** User, Goal
|
||||
* **View:** Screens & Widgets (Flutter UI)
|
||||
* **ViewModel:** State management (Provider/Riverpod)
|
||||
* **Repository:** Supabase API calls (Auth, Postgres, Storage)
|
||||
* Real-time updates: Supabase Realtime for goal progress and social feed
|
||||
|
||||
---
|
||||
|
||||
## 7. Implementation Roadmap
|
||||
|
||||
### Phase 1 — MVP
|
||||
|
||||
* User authentication & profile via Supabase
|
||||
* Bucket list creation (limit 20 goals)
|
||||
* Countdown starts **after bucket list completion**
|
||||
* Live countdown and percentage progress
|
||||
* Add goal progress tracking
|
||||
|
||||
### Phase 2 — Social & Motivation
|
||||
|
||||
* Share milestones or goals publicly
|
||||
* View other users’ progress (optional)
|
||||
* Leaderboards & achievements
|
||||
* Push notifications for milestones
|
||||
|
||||
### Phase 3 — Advanced Features
|
||||
|
||||
* Graphs & charts for progress visualization
|
||||
* Media uploads & API-based images
|
||||
* Map integration for location-based goals
|
||||
* Offline support & caching
|
||||
* Daily motivational messages
|
||||
|
||||
---
|
||||
|
||||
## 8. Recommended Tools & Learning Resources
|
||||
|
||||
* Flutter: [https://flutter.dev/docs](https://flutter.dev/docs)
|
||||
* Supabase: [https://supabase.com/docs](https://supabase.com/docs)
|
||||
* UI Design: Figma / Adobe XD
|
||||
* State Management: Riverpod tutorials
|
||||
* Version Control: Git + GitHub
|
||||
|
||||
---
|
||||
|
||||
## 9. Summary
|
||||
|
||||
LifeTimer now uses **Supabase** as a complete backend solution. Users finalize a bucket list of up to 20 goals, then a **fixed 1356-day countdown starts**. Optional images and maps integration make goal tracking engaging. Countdown cannot be stopped or modified, emphasizing commitment, while social and motivational features encourage progress and community support. Flutter + Supabase enables cross-platform support and real-time updates for a dynamic experience.
|
||||
@@ -1,84 +0,0 @@
|
||||
# LifeTimer Functional Requirements
|
||||
|
||||
This document expands on project.md and defines functional requirements for the LifeTimer app.
|
||||
|
||||
## Legend
|
||||
|
||||
- FR x.y = Functional Requirement
|
||||
|
||||
## 1. User accounts and profiles
|
||||
|
||||
- FR 1.1 Users can sign up and sign in using email and password via Supabase Auth.
|
||||
- FR 1.2 Users can sign in using Google.
|
||||
- FR 1.3 Users can sign in using Apple ID on iOS.
|
||||
- FR 1.4 Users can edit a profile containing avatar, username that is unique, and short bio.
|
||||
- FR 1.5 The app displays online or last active status where relevant, for example social screens.
|
||||
- FR 1.6 Users can delete their account and associated data.
|
||||
|
||||
## 2. Bucket list and goals
|
||||
|
||||
- FR 2.1 Each user can create between 1 and 20 goals in their bucket list. The countdown can only start once at least one goal exists, and no more than 20 goals can ever be created.
|
||||
- FR 2.2 For each goal, the user can enter title, required, and description, optional.
|
||||
- FR 2.3 For each goal, the user can optionally attach
|
||||
- a location, map picker or search,
|
||||
- one cover image, either uploaded or fetched from an image API based on title.
|
||||
- FR 2.4 Users can define milestones or steps per goal and mark each step as completed.
|
||||
- FR 2.5 Users can mark a goal as completed; overall progress is derived from milestones and completion flag.
|
||||
- FR 2.6 Users can edit or delete a goal until the 1356 day countdown has started.
|
||||
- FR 2.7 After the countdown has started, goals remain visible but cannot be deleted; limited edits, for example description, may be allowed, but title and count of goals are locked.
|
||||
|
||||
## 3. 1356 day countdown
|
||||
|
||||
- FR 3.1 The app calculates the countdown start date when the user confirms their bucket list as final.
|
||||
- FR 3.2 The app stores countdown end date as start date plus 1356 days.
|
||||
- FR 3.3 The home screen shows a live countdown, days, hours, minutes, seconds.
|
||||
- FR 3.4 Users can view the percentage of time that has elapsed, visualized via a progress bar or circle.
|
||||
- FR 3.5 The countdown cannot be paused, reset, or extended by the user.
|
||||
- FR 3.6 If the end date is in the past, the app shows that the challenge is finished and surfaces summary statistics.
|
||||
|
||||
## 4. Progress tracking and insights
|
||||
|
||||
- FR 4.1 Users can see a list of goals with per goal progress and overall completion stats.
|
||||
- FR 4.2 The app shows simple charts or indicators of progress versus remaining time, for example line chart, bar chart, or summary cards.
|
||||
- FR 4.3 The app shows motivational messages based on the user current progress and remaining time.
|
||||
|
||||
## 5. Social and community, optional and opt in
|
||||
|
||||
- FR 5.1 Each user can set their overall account visibility to either **Public** or **Private** via a single global toggle.
|
||||
- FR 5.2 When an account is **Private**, only the owning user can see their goals, milestones, countdown, and statistics. Private accounts never appear in social feeds or leaderboards.
|
||||
- FR 5.3 When an account is **Public**, other users can see a restricted public view of that user: avatar, username, high level stats, public milestones, and goal summaries, but never email or other sensitive data.
|
||||
- FR 5.4 Users can follow other users with public accounts and see a feed of their public milestones.
|
||||
- FR 5.5 Leaderboards surface rankings such as
|
||||
- most goals completed,
|
||||
- streak of active days,
|
||||
- recently completed milestones,
|
||||
but only for public accounts.
|
||||
- FR 5.6 Users can unfollow or block other users.
|
||||
|
||||
## 6. Notifications
|
||||
|
||||
- FR 6.1 Users can configure reminder frequency, daily, weekly, custom, for the countdown.
|
||||
- FR 6.2 Users receive push or local notifications for
|
||||
- upcoming milestones or deadlines they set,
|
||||
- streaks such as three days in a row of updating progress,
|
||||
- major countdown checkpoints, for example 50 percent or 25 percent time remaining.
|
||||
- FR 6.3 Users can mute or customize specific notification categories.
|
||||
- FR 6.4 Notification preferences sync across devices.
|
||||
|
||||
## 7. Onboarding and education
|
||||
|
||||
- FR 7.1 New users see an onboarding flow explaining the 1356 day challenge and rules.
|
||||
- FR 7.2 Onboarding includes at least one screen that visually represents the countdown, inspired by the world time style mockups.
|
||||
- FR 7.3 Users can revisit an About the challenge screen later from Settings.
|
||||
|
||||
## 8. Settings
|
||||
|
||||
- FR 8.1 Users can switch between light and dark themes.
|
||||
- FR 8.2 Users can choose 12 hour or 24 hour time formats.
|
||||
- FR 8.3 Users can update language if localization is implemented.
|
||||
- FR 8.4 Users can manage privacy and social visibility options.
|
||||
|
||||
## 9. Admin and operations, later phase
|
||||
|
||||
- FR 9.1 An admin user can moderate reported content and block abusive accounts.
|
||||
- FR 9.2 Admin tooling may be provided via Supabase dashboard or a separate admin UI.
|
||||
@@ -1,48 +0,0 @@
|
||||
# LifeTimer Non functional Requirements
|
||||
|
||||
This document describes quality attributes of the app.
|
||||
|
||||
## 1. Performance
|
||||
|
||||
- NFR 1.1 The home screen countdown updates smoothly at least once per second without blocking user interactions.
|
||||
- NFR 1.2 Normal operations should complete within one second on a typical mobile connection when the network is healthy.
|
||||
- NFR 1.3 Screens should be usable on low end devices with limited memory.
|
||||
|
||||
## 2. Reliability and availability
|
||||
|
||||
- NFR 2.1 The app should degrade gracefully when offline, caching recent data for read only access.
|
||||
- NFR 2.2 Operations that change data are queued and retried when the connection is restored, where possible.
|
||||
- NFR 2.3 Critical data such as goals and countdown timestamps are stored in Supabase and never only on device.
|
||||
|
||||
## 3. Security and privacy
|
||||
|
||||
- NFR 3.1 All traffic between app and Supabase uses HTTPS.
|
||||
- NFR 3.2 Access to tables is controlled by Row Level Security policies in Supabase.
|
||||
- NFR 3.3 Private goals and milestones are not readable by other users.
|
||||
- NFR 3.4 Authentication tokens are stored securely using platform secure storage.
|
||||
- NFR 3.5 Data export and deletion can be supported in later phases to comply with privacy expectations.
|
||||
- NFR 3.6 Supabase service role keys are never embedded in the mobile app; only the public anon key is shipped to clients.
|
||||
- NFR 3.7 RLS policies are covered by automated tests and code review to prevent accidental data exposure.
|
||||
- NFR 3.8 Logs and analytics events do not contain secrets (passwords, tokens) or unnecessary personal data.
|
||||
|
||||
## 4. Usability and accessibility
|
||||
|
||||
- NFR 4.1 App follows platform accessibility guidelines for text size, color contrast, and touch target sizes.
|
||||
- NFR 4.2 Primary flows are fully usable with screen readers.
|
||||
- NFR 4.3 Color alone is not the only way to convey critical information.
|
||||
|
||||
## 5. Maintainability and scalability
|
||||
|
||||
- NFR 5.1 Codebase follows modular feature based structure with clear separation of presentation, state management, and data layers.
|
||||
- NFR 5.2 Business logic is covered by automated tests at unit or widget level where it brings value.
|
||||
- NFR 5.3 Supabase schema migrations are version controlled.
|
||||
|
||||
## 6. Localization
|
||||
|
||||
- NFR 6.1 The app is designed to support multiple languages via Flutter localization.
|
||||
- NFR 6.2 All user facing strings live in localization files, not hard coded in widgets.
|
||||
|
||||
## 7. Analytics and observability
|
||||
|
||||
- NFR 7.1 Basic analytics events are sent for key actions such as creating goals, starting the countdown, and completing milestones.
|
||||
- NFR 7.2 Error logging captures stack traces and anonymized context to help debugging.
|
||||
@@ -1,111 +0,0 @@
|
||||
# LifeTimer — Security and Privacy Design
|
||||
|
||||
This document describes how LifeTimer should be built to reduce the risk of hacking, data leaks, and misuse.
|
||||
|
||||
## 1. Goals
|
||||
|
||||
- Protect user data (goals, milestones, countdown, email, profile).
|
||||
- Make it hard for attackers to access or modify data they do not own.
|
||||
- Limit damage even if a single part of the system is compromised.
|
||||
|
||||
---
|
||||
|
||||
## 2. Privacy model
|
||||
|
||||
- Each user chooses a single **account visibility** setting:
|
||||
- **Private account** (default)
|
||||
- Only the user can see their goals, milestones, countdown, and stats.
|
||||
- Account never appears in feeds, search, or leaderboards.
|
||||
- **Public account**
|
||||
- Other users can see a **limited public view**: avatar, username, high level stats, and public milestones.
|
||||
- Sensitive data (email, internal IDs, detailed logs) never leaves the backend.
|
||||
- Visibility is implemented via a boolean flag `users.is_public_profile`.
|
||||
|
||||
---
|
||||
|
||||
## 3. Access control and Row Level Security (RLS)
|
||||
|
||||
High level rules for Supabase/Postgres:
|
||||
|
||||
- **General principles**
|
||||
- Every table that contains user data has RLS enabled.
|
||||
- There is no unauthenticated read access to private data.
|
||||
- Service role key is used only in secure server environments, not in the mobile app.
|
||||
|
||||
- **users table**
|
||||
- A user can `SELECT` and `UPDATE` only their own row.
|
||||
- Other users can `SELECT` a limited subset of columns (username, avatar_url, is_public_profile, high level stats) **only when** `is_public_profile = true`.
|
||||
- Email and other sensitive fields are never exposed in public queries.
|
||||
|
||||
- **goals, goal_steps, activities, notifications tables**
|
||||
- Reads and writes are allowed only when `owner_id = auth.uid()` (or `user_id = auth.uid()`), regardless of public/private setting.
|
||||
- Public feeds and leaderboards do **not** expose full goal records; they use derived or aggregated views that expose only non sensitive data.
|
||||
|
||||
- **followers and social features**
|
||||
- Follow relationships can only be created for public accounts.
|
||||
- Queries that build feeds or leaderboards always join through `users` and require `is_public_profile = true`.
|
||||
|
||||
- **Testing RLS**
|
||||
- For each table, add tests that simulate different users:
|
||||
- Owner can read/write their rows.
|
||||
- Other users cannot read private rows.
|
||||
- Other users can read only allowed fields for public accounts.
|
||||
|
||||
---
|
||||
|
||||
## 4. Authentication and session security
|
||||
|
||||
- Use Supabase Auth for all login and sign up flows.
|
||||
- Enforce strong password rules for email/password sign up.
|
||||
- Use OAuth flows (Google, Apple) via official SDKs only.
|
||||
- Store access and refresh tokens only via platform secure storage APIs.
|
||||
- Provide logout that clears tokens from secure storage and memory.
|
||||
- Optionally add app level lock (PIN or biometrics) before opening sensitive screens on a shared device.
|
||||
|
||||
---
|
||||
|
||||
## 5. Key and configuration management
|
||||
|
||||
- Store Supabase keys and environment URLs only in configuration files, not hard coded in code.
|
||||
- Ship **only** the public anon key in the mobile app.
|
||||
- Keep the Supabase service role key in server side environments (CI, Edge Functions) and protect it with secret managers.
|
||||
- Rotate keys if a leak is suspected.
|
||||
|
||||
---
|
||||
|
||||
## 6. Network and API security
|
||||
|
||||
- Enforce HTTPS for all communication with Supabase.
|
||||
- Optionally enable certificate pinning in the mobile app for additional protection.
|
||||
- Validate data on the server side (for example inside Edge Functions) for any complex operations.
|
||||
- Use pagination and rate limiting on endpoints that can be abused for scraping.
|
||||
|
||||
---
|
||||
|
||||
## 7. Secure coding guidelines
|
||||
|
||||
- Use parameterized queries and the official Supabase client instead of building raw queries from strings.
|
||||
- Never log passwords, tokens, or full request/response bodies that may contain secrets.
|
||||
- Sanitize and validate user input before using it in business logic.
|
||||
- Handle errors with generic messages for users and more detailed logs on the backend.
|
||||
|
||||
---
|
||||
|
||||
## 8. Logging, monitoring, and incident response
|
||||
|
||||
- Send errors to a crash/analytics service with anonymized context.
|
||||
- Monitor for unusual patterns (for example many failed login attempts from one IP).
|
||||
- Have a procedure for
|
||||
- disabling compromised accounts,
|
||||
- rotating keys,
|
||||
- notifying affected users when needed.
|
||||
|
||||
---
|
||||
|
||||
## 9. Data lifecycle
|
||||
|
||||
- Store only data that is necessary for the product to work.
|
||||
- Allow users to delete their accounts; deletion should remove or anonymize their data where possible.
|
||||
- Consider providing data export in later phases so users can keep a copy of their progress.
|
||||
|
||||
This document should be kept in sync with `requirements-nonfunctional.md`, `database-schema.md`, and `architecture.md` as the system evolves.
|
||||
@@ -1,5 +0,0 @@
|
||||
# Supabase Configuration
|
||||
# Copy this file to .env and fill in your actual values
|
||||
|
||||
SUPABASE_URL=https://your-project.supabase.co
|
||||
SUPABASE_ANON_KEY=your-anon-key-here
|
||||
@@ -1,214 +0,0 @@
|
||||
-- Enable UUID extension
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
|
||||
-- Create users table
|
||||
CREATE TABLE IF NOT EXISTS public.users (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
auth_provider_id TEXT,
|
||||
username TEXT UNIQUE NOT NULL,
|
||||
email TEXT UNIQUE NOT NULL,
|
||||
avatar_url TEXT,
|
||||
bio TEXT,
|
||||
is_public_profile BOOLEAN DEFAULT false,
|
||||
countdown_start_date TIMESTAMPTZ,
|
||||
countdown_end_date TIMESTAMPTZ,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Create goals table
|
||||
CREATE TABLE IF NOT EXISTS public.goals (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
owner_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
title TEXT NOT NULL,
|
||||
description TEXT,
|
||||
progress INTEGER DEFAULT 0 CHECK (progress >= 0 AND progress <= 100),
|
||||
location_lat DOUBLE PRECISION,
|
||||
location_lng DOUBLE PRECISION,
|
||||
location_name TEXT,
|
||||
image_url TEXT,
|
||||
completed BOOLEAN DEFAULT false,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Create goal_steps table
|
||||
CREATE TABLE IF NOT EXISTS public.goal_steps (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
goal_id UUID NOT NULL REFERENCES public.goals(id) ON DELETE CASCADE,
|
||||
title TEXT NOT NULL,
|
||||
is_done BOOLEAN DEFAULT false,
|
||||
order_index INTEGER DEFAULT 0,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Create followers table
|
||||
CREATE TABLE IF NOT EXISTS public.followers (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
follower_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||||
UNIQUE(user_id, follower_id)
|
||||
);
|
||||
|
||||
-- Create activities table
|
||||
CREATE TABLE IF NOT EXISTS public.activities (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
type TEXT NOT NULL,
|
||||
payload JSONB,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Create notifications table
|
||||
CREATE TABLE IF NOT EXISTS public.notifications (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
type TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
body TEXT NOT NULL,
|
||||
scheduled_for TIMESTAMPTZ,
|
||||
delivered_at TIMESTAMPTZ
|
||||
);
|
||||
|
||||
-- Create indexes
|
||||
CREATE INDEX IF NOT EXISTS idx_goals_owner_id ON public.goals(owner_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_goal_steps_goal_id ON public.goal_steps(goal_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_followers_user_id ON public.followers(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_followers_follower_id ON public.followers(follower_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_activities_user_id_created_at ON public.activities(user_id, created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_notifications_user_id ON public.notifications(user_id);
|
||||
|
||||
-- Enable Row Level Security
|
||||
ALTER TABLE public.users ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE public.goals ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE public.goal_steps ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE public.followers ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE public.activities ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE public.notifications ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
-- RLS Policies for users
|
||||
CREATE POLICY "Users can select their own profile"
|
||||
ON public.users FOR SELECT
|
||||
USING (auth.uid() = id);
|
||||
|
||||
CREATE POLICY "Users can update their own profile"
|
||||
ON public.users FOR UPDATE
|
||||
USING (auth.uid() = id)
|
||||
WITH CHECK (auth.uid() = id);
|
||||
|
||||
-- RLS Policies for goals
|
||||
CREATE POLICY "Users can read their own goals"
|
||||
ON public.goals FOR SELECT
|
||||
USING (auth.uid() = owner_id);
|
||||
|
||||
CREATE POLICY "Users can insert their own goals"
|
||||
ON public.goals FOR INSERT
|
||||
WITH CHECK (auth.uid() = owner_id);
|
||||
|
||||
CREATE POLICY "Users can update their own goals"
|
||||
ON public.goals FOR UPDATE
|
||||
USING (auth.uid() = owner_id)
|
||||
WITH CHECK (auth.uid() = owner_id);
|
||||
|
||||
CREATE POLICY "Users can delete their own goals"
|
||||
ON public.goals FOR DELETE
|
||||
USING (auth.uid() = owner_id);
|
||||
|
||||
-- RLS Policies for goal_steps
|
||||
CREATE POLICY "Users can read steps for their own goals"
|
||||
ON public.goal_steps FOR SELECT
|
||||
USING (
|
||||
EXISTS (
|
||||
SELECT 1 FROM public.goals g
|
||||
WHERE g.id = goal_id AND g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
CREATE POLICY "Users can insert steps for their own goals"
|
||||
ON public.goal_steps FOR INSERT
|
||||
WITH CHECK (
|
||||
EXISTS (
|
||||
SELECT 1 FROM public.goals g
|
||||
WHERE g.id = goal_id AND g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
CREATE POLICY "Users can update steps for their own goals"
|
||||
ON public.goal_steps FOR UPDATE
|
||||
USING (
|
||||
EXISTS (
|
||||
SELECT 1 FROM public.goals g
|
||||
WHERE g.id = goal_id AND g.owner_id = auth.uid()
|
||||
)
|
||||
)
|
||||
WITH CHECK (
|
||||
EXISTS (
|
||||
SELECT 1 FROM public.goals g
|
||||
WHERE g.id = goal_id AND g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
CREATE POLICY "Users can delete steps for their own goals"
|
||||
ON public.goal_steps FOR DELETE
|
||||
USING (
|
||||
EXISTS (
|
||||
SELECT 1 FROM public.goals g
|
||||
WHERE g.id = goal_id AND g.owner_id = auth.uid()
|
||||
)
|
||||
);
|
||||
|
||||
-- RLS Policies for followers
|
||||
CREATE POLICY "Users can read their follower relationships"
|
||||
ON public.followers FOR SELECT
|
||||
USING (auth.uid() = user_id OR auth.uid() = follower_id);
|
||||
|
||||
CREATE POLICY "Users can follow others"
|
||||
ON public.followers FOR INSERT
|
||||
WITH CHECK (auth.uid() = follower_id);
|
||||
|
||||
CREATE POLICY "Users can unfollow or remove followers"
|
||||
ON public.followers FOR DELETE
|
||||
USING (auth.uid() = user_id OR auth.uid() = follower_id);
|
||||
|
||||
-- RLS Policies for activities
|
||||
CREATE POLICY "Users can read their own activity"
|
||||
ON public.activities FOR SELECT
|
||||
USING (auth.uid() = user_id);
|
||||
|
||||
CREATE POLICY "Users can insert their own activity events"
|
||||
ON public.activities FOR INSERT
|
||||
WITH CHECK (auth.uid() = user_id);
|
||||
|
||||
-- RLS Policies for notifications
|
||||
CREATE POLICY "Users can read their own notifications"
|
||||
ON public.notifications FOR SELECT
|
||||
USING (auth.uid() = user_id);
|
||||
|
||||
CREATE POLICY "Users can receive their own notifications"
|
||||
ON public.notifications FOR INSERT
|
||||
WITH CHECK (auth.uid() = user_id);
|
||||
|
||||
CREATE POLICY "Users can delete their own notifications"
|
||||
ON public.notifications FOR DELETE
|
||||
USING (auth.uid() = user_id);
|
||||
|
||||
-- Function to update updated_at timestamp
|
||||
CREATE OR REPLACE FUNCTION update_updated_at_column()
|
||||
RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
NEW.updated_at = NOW();
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
-- Triggers for updated_at
|
||||
CREATE TRIGGER update_users_updated_at
|
||||
BEFORE UPDATE ON public.users
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION update_updated_at_column();
|
||||
|
||||
CREATE TRIGGER update_goals_updated_at
|
||||
BEFORE UPDATE ON public.goals
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION update_updated_at_column();
|
||||
@@ -1,58 +0,0 @@
|
||||
-- Create a view for public profile information
|
||||
-- This view exposes only non-sensitive information for public profiles
|
||||
CREATE OR REPLACE VIEW public.public_profiles AS
|
||||
SELECT
|
||||
id,
|
||||
username,
|
||||
avatar_url,
|
||||
bio,
|
||||
is_public_profile,
|
||||
countdown_start_date,
|
||||
countdown_end_date,
|
||||
created_at
|
||||
FROM public.users
|
||||
WHERE is_public_profile = true;
|
||||
|
||||
-- Grant access to the view for authenticated users
|
||||
GRANT SELECT ON public.public_profiles TO authenticated;
|
||||
|
||||
-- Function to get public leaderboard
|
||||
CREATE OR REPLACE FUNCTION get_leaderboard(sort_by TEXT DEFAULT 'created_at', limit_count INTEGER DEFAULT 50)
|
||||
RETURNS TABLE (
|
||||
id UUID,
|
||||
username TEXT,
|
||||
avatar_url TEXT,
|
||||
bio TEXT,
|
||||
countdown_start_date TIMESTAMPTZ,
|
||||
countdown_end_date TIMESTAMPTZ,
|
||||
goals_completed_count INTEGER
|
||||
) AS $$
|
||||
BEGIN
|
||||
RETURN QUERY
|
||||
SELECT
|
||||
u.id,
|
||||
u.username,
|
||||
u.avatar_url,
|
||||
u.bio,
|
||||
u.countdown_start_date,
|
||||
u.countdown_end_date,
|
||||
COALESCE(
|
||||
(SELECT COUNT(*) FROM public.goals g WHERE g.owner_id = u.id AND g.completed = true),
|
||||
0
|
||||
) as goals_completed_count
|
||||
FROM public.users u
|
||||
WHERE u.is_public_profile = true
|
||||
ORDER BY
|
||||
CASE sort_by
|
||||
WHEN 'goals_completed' THEN COALESCE(
|
||||
(SELECT COUNT(*) FROM public.goals g WHERE g.owner_id = u.id AND g.completed = true),
|
||||
0
|
||||
)
|
||||
ELSE u.created_at
|
||||
END DESC
|
||||
LIMIT limit_count;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql SECURITY DEFINER;
|
||||
|
||||
-- Grant execute on the function
|
||||
GRANT EXECUTE ON FUNCTION get_leaderboard(TEXT, INTEGER) TO authenticated;
|
||||
@@ -1,75 +0,0 @@
|
||||
-- Function to automatically log goal creation activity
|
||||
CREATE OR REPLACE FUNCTION log_goal_created()
|
||||
RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
INSERT INTO public.activities (user_id, type, payload)
|
||||
VALUES (
|
||||
NEW.owner_id,
|
||||
'goal_created',
|
||||
jsonb_build_object(
|
||||
'goal_id', NEW.id,
|
||||
'goal_title', NEW.title
|
||||
)
|
||||
);
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql SECURITY DEFINER;
|
||||
|
||||
-- Trigger for goal creation
|
||||
CREATE TRIGGER on_goal_created
|
||||
AFTER INSERT ON public.goals
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION log_goal_created();
|
||||
|
||||
-- Function to automatically log goal completion activity
|
||||
CREATE OR REPLACE FUNCTION log_goal_completed()
|
||||
RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
IF NEW.completed = true AND (OLD.completed IS NULL OR OLD.completed = false) THEN
|
||||
INSERT INTO public.activities (user_id, type, payload)
|
||||
VALUES (
|
||||
NEW.owner_id,
|
||||
'goal_completed',
|
||||
jsonb_build_object(
|
||||
'goal_id', NEW.id,
|
||||
'goal_title', NEW.title,
|
||||
'progress', NEW.progress
|
||||
)
|
||||
);
|
||||
END IF;
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql SECURITY DEFINER;
|
||||
|
||||
-- Trigger for goal completion
|
||||
CREATE TRIGGER on_goal_completed
|
||||
AFTER UPDATE ON public.goals
|
||||
FOR EACH ROW
|
||||
WHEN (NEW.completed IS DISTINCT FROM OLD.completed)
|
||||
EXECUTE FUNCTION log_goal_completed();
|
||||
|
||||
-- Function to automatically log countdown start activity
|
||||
CREATE OR REPLACE FUNCTION log_countdown_started()
|
||||
RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
IF NEW.countdown_start_date IS NOT NULL AND (OLD.countdown_start_date IS NULL) THEN
|
||||
INSERT INTO public.activities (user_id, type, payload)
|
||||
VALUES (
|
||||
NEW.id,
|
||||
'countdown_started',
|
||||
jsonb_build_object(
|
||||
'start_date', NEW.countdown_start_date,
|
||||
'end_date', NEW.countdown_end_date
|
||||
)
|
||||
);
|
||||
END IF;
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql SECURITY DEFINER;
|
||||
|
||||
-- Trigger for countdown start
|
||||
CREATE TRIGGER on_countdown_started
|
||||
AFTER UPDATE ON public.users
|
||||
FOR EACH ROW
|
||||
WHEN (NEW.countdown_start_date IS DISTINCT FROM OLD.countdown_start_date)
|
||||
EXECUTE FUNCTION log_countdown_started();
|
||||
@@ -1,60 +0,0 @@
|
||||
-- Calendar entries table for user progress and smaller achievements
|
||||
CREATE TABLE IF NOT EXISTS public.calendar_entries (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
goal_id UUID REFERENCES public.goals(id) ON DELETE SET NULL,
|
||||
entry_date DATE NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
note TEXT,
|
||||
entry_type TEXT NOT NULL DEFAULT 'note', -- e.g. 'progress', 'milestone', 'reflection'
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_calendar_entries_user_date
|
||||
ON public.calendar_entries(user_id, entry_date);
|
||||
|
||||
ALTER TABLE public.calendar_entries ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY "Users can read their calendar entries"
|
||||
ON public.calendar_entries FOR SELECT
|
||||
USING (auth.uid() = user_id);
|
||||
|
||||
CREATE POLICY "Users can insert their calendar entries"
|
||||
ON public.calendar_entries FOR INSERT
|
||||
WITH CHECK (auth.uid() = user_id);
|
||||
|
||||
CREATE POLICY "Users can update their calendar entries"
|
||||
ON public.calendar_entries FOR UPDATE
|
||||
USING (auth.uid() = user_id)
|
||||
WITH CHECK (auth.uid() = user_id);
|
||||
|
||||
CREATE POLICY "Users can delete their calendar entries"
|
||||
ON public.calendar_entries FOR DELETE
|
||||
USING (auth.uid() = user_id);
|
||||
|
||||
-- Optional social media links on users
|
||||
ALTER TABLE public.users
|
||||
ADD COLUMN IF NOT EXISTS twitter_handle TEXT,
|
||||
ADD COLUMN IF NOT EXISTS instagram_handle TEXT,
|
||||
ADD COLUMN IF NOT EXISTS tiktok_handle TEXT,
|
||||
ADD COLUMN IF NOT EXISTS website_url TEXT;
|
||||
|
||||
-- Expose social links in the public profiles view for public accounts only
|
||||
CREATE OR REPLACE VIEW public.public_profiles AS
|
||||
SELECT
|
||||
id,
|
||||
username,
|
||||
avatar_url,
|
||||
bio,
|
||||
is_public_profile,
|
||||
countdown_start_date,
|
||||
countdown_end_date,
|
||||
created_at,
|
||||
twitter_handle,
|
||||
instagram_handle,
|
||||
tiktok_handle,
|
||||
website_url
|
||||
FROM public.users
|
||||
WHERE is_public_profile = true;
|
||||
|
||||
GRANT SELECT ON public.public_profiles TO authenticated;
|
||||
-533
@@ -1,533 +0,0 @@
|
||||
# LifeTimer Development Timeline
|
||||
|
||||
Use this file as a living log of what has been done and what is planned next.
|
||||
Update it as you work.
|
||||
|
||||
Legend
|
||||
|
||||
- [ ] planned
|
||||
- [x] completed
|
||||
- [~] in progress
|
||||
|
||||
## 2026 01 03 - Kickoff
|
||||
|
||||
- [x] Defined core concept and Supabase based architecture in project.md.
|
||||
- [x] Created initial documentation set for requirements, design, architecture, and roadmap.
|
||||
- [x] Created comprehensive functional and non-functional requirements.
|
||||
- [x] Defined detailed database schema with RLS policies.
|
||||
- [x] Specified Flutter project structure and navigation flows.
|
||||
- [x] Documented UI/UX specifications and security guidelines.
|
||||
- [x] Initialize git repository and create .gitignore.
|
||||
- [x] Review and complete Flutter project structure.
|
||||
- [x] Add required dependencies to pubspec.yaml.
|
||||
- [x] Create core theme and routing files.
|
||||
- [x] Create core widgets (app_scaffold, bottom_nav_scaffold, loading_indicator, empty_state).
|
||||
- [x] Create error handling (failure types, error_mapper).
|
||||
- [x] Create utility functions (date_time_utils, validators).
|
||||
- [x] Create data models (User, Goal, GoalStep, Activity) with JSON serialization.
|
||||
- [x] Create repository implementations (UserRepository, GoalsRepository, CountdownRepository, SocialRepository, NotificationsRepository).
|
||||
- [x] Create Supabase SQL migration files with RLS policies.
|
||||
- [x] Create environment configuration files (.env.example).
|
||||
- [x] Implement authentication feature screens and controllers.
|
||||
- [x] Implement onboarding feature screens.
|
||||
- [x] Implement goals feature screens and controllers.
|
||||
- [x] Implement countdown home screen.
|
||||
|
||||
## Phase 0 - Planning and Foundations (Completed)
|
||||
|
||||
### Project Setup
|
||||
- [x] Initialize git repository with proper .gitignore
|
||||
- [x] Create initial commit with documentation
|
||||
- [x] Review existing Flutter project structure in lifetimer/
|
||||
- [x] Verify pubspec.yaml and update dependencies
|
||||
- [x] Create environment configuration files (.env.example, .env)
|
||||
|
||||
### Core Infrastructure
|
||||
- [x] Create bootstrap folder with Supabase client setup
|
||||
- [x] Create core theme definitions (light/dark themes)
|
||||
- [x] Create app router with all route definitions
|
||||
- [x] Create reusable core widgets (buttons, scaffolds, loading indicators)
|
||||
- [x] Create error handling and failure types
|
||||
- [x] Create utility functions (date/time, validators)
|
||||
- [x] Set up state management (Provider/Riverpod)
|
||||
|
||||
### Data Layer
|
||||
- [x] Create data models (User, Goal, GoalStep, Activity)
|
||||
- [x] Create repository interfaces
|
||||
- [x] Implement AuthRepository
|
||||
- [x] Implement UserRepository
|
||||
- [x] Implement GoalsRepository
|
||||
- [x] Implement CountdownRepository
|
||||
- [x] Implement SocialRepository (Phase 2)
|
||||
- [x] Implement NotificationsRepository
|
||||
|
||||
### Supabase Setup
|
||||
- [x] Create Supabase project
|
||||
- [x] Apply database schema migrations
|
||||
- [x] Configure RLS policies
|
||||
- [x] Set up storage buckets
|
||||
- [x] Configure authentication providers (Google, Apple)
|
||||
- [x] Test database connections
|
||||
|
||||
## Phase 1 - MVP Core Experience (In Progress)
|
||||
|
||||
### Authentication Feature
|
||||
- [x] Create AuthGate screen
|
||||
- [x] Create sign in screen (email/password)
|
||||
- [x] Create sign up screen (email/password)
|
||||
- [x] Implement Google sign-in
|
||||
- [x] Implement Apple sign-in (iOS)
|
||||
- [x] Create auth loading screen
|
||||
- [x] Implement AuthController
|
||||
- [ ] Add session management
|
||||
- [ ] Test auth flows
|
||||
|
||||
### Onboarding Feature
|
||||
- [x] Create onboarding intro screen
|
||||
- [x] Create onboarding how it works screen
|
||||
- [x] Create onboarding motivation screen
|
||||
- [x] Implement OnboardingController
|
||||
- [ ] Add onboarding completion tracking
|
||||
- [ ] Test onboarding flow
|
||||
|
||||
### Profile Setup
|
||||
- [x] Create profile setup screen
|
||||
- [x] Implement avatar upload
|
||||
- [x] Add username validation (unique check)
|
||||
- [x] Add bio field
|
||||
- [x] Implement ProfileController
|
||||
- [x] Create profile screen with stats and countdown display
|
||||
- [ ] Test profile setup flow
|
||||
|
||||
### Goals Feature
|
||||
- [x] Create goals list screen
|
||||
- [x] Create goal edit screen
|
||||
- [x] Create goal detail screen
|
||||
- [x] Implement GoalsController
|
||||
- [x] Implement GoalDetailController
|
||||
- [x] Add goal title and description fields
|
||||
- [ ] Add location picker integration
|
||||
- [ ] Add image upload/API integration
|
||||
- [x] Implement milestones/steps per goal
|
||||
- [x] Add progress tracking (0-100%)
|
||||
- [x] Enforce 1-20 goals limit
|
||||
- [x] Add goal completion logic
|
||||
- [ ] Test goal CRUD operations
|
||||
|
||||
### Countdown Feature
|
||||
- [x] Create home countdown screen (world time inspired)
|
||||
- [x] Implement large countdown display (days, hours, minutes, seconds)
|
||||
- [x] Add progress ring/bar showing time elapsed
|
||||
- [x] Implement CountdownController
|
||||
- [ ] Add countdown start confirmation dialog
|
||||
- [ ] Calculate countdown end date (start + 1356 days)
|
||||
- [x] Add motivational messages
|
||||
- [ ] Test countdown accuracy
|
||||
- [ ] Test countdown lock (no pause/reset)
|
||||
|
||||
### Bucket List Confirmation
|
||||
- [x] Create bucket list intro screen
|
||||
- [x] Implement confirmation dialog
|
||||
- [x] Add countdown start trigger
|
||||
- [ ] Lock goals after countdown starts
|
||||
- [ ] Test confirmation flow
|
||||
|
||||
### Notifications
|
||||
- [x] Set up local notifications
|
||||
- [x] Implement daily/weekly reminders
|
||||
- [x] Add milestone notifications
|
||||
- [x] Add countdown checkpoint notifications (50%, 25% remaining)
|
||||
- [x] Create notification settings screen
|
||||
- [ ] Test notification delivery
|
||||
|
||||
### Analytics
|
||||
- [x] Set up basic analytics tracking
|
||||
- [x] Track key events (goal creation, countdown start, goal completion)
|
||||
- [x] Add error logging
|
||||
- [ ] Test analytics integration
|
||||
|
||||
### MVP Testing
|
||||
- [x] End-to-end testing of signup → goals → countdown flow
|
||||
- [x] Test onboarding completion
|
||||
- [x] Test countdown accuracy over time
|
||||
- [x] Test goal progress tracking
|
||||
- [x] Test notifications
|
||||
- [x] Fix critical bugs
|
||||
- [x] Prepare for internal testing
|
||||
|
||||
## Phase 2 - Social and Motivation
|
||||
|
||||
### Following System
|
||||
- [ ] Implement follow/unfollow functionality
|
||||
- [ ] Create public profile screens
|
||||
- [ ] Add follower/following lists
|
||||
- [ ] Test follow relationships
|
||||
|
||||
### Activity Feed
|
||||
- [ ] Create social feed screen
|
||||
- [ ] Implement activity tracking
|
||||
- [ ] Show public milestones in feed
|
||||
- [ ] Add feed filtering
|
||||
- [ ] Test feed updates
|
||||
|
||||
### Leaderboards
|
||||
- [ ] Create leaderboards screen
|
||||
- [ ] Implement goals completed ranking
|
||||
- [ ] Implement active streak ranking
|
||||
- [ ] Implement recent milestones ranking
|
||||
- [ ] Add leaderboard tabs/filters
|
||||
- [ ] Test leaderboard accuracy
|
||||
|
||||
### Achievements
|
||||
- [ ] Design achievement badges
|
||||
- [ ] Implement achievement tracking
|
||||
- [ ] Create achievement notification
|
||||
- [ ] Add achievements to profile
|
||||
- [ ] Test achievement unlocks
|
||||
|
||||
### Social Notifications
|
||||
- [ ] Add follow notifications
|
||||
- [ ] Add milestone share notifications
|
||||
- [ ] Test social notification delivery
|
||||
|
||||
### Phase 2 Testing
|
||||
- [ ] Test public profile visibility
|
||||
- [ ] Test social feed privacy
|
||||
- [ ] Test leaderboards (public accounts only)
|
||||
- [ ] Test achievements
|
||||
- [ ] Beta testing with small group
|
||||
- [ ] Fix bugs and refine features
|
||||
|
||||
## Phase 3 - Advanced Experience
|
||||
|
||||
### Charts and Insights
|
||||
- [ ] Create insights screen
|
||||
- [ ] Implement progress vs time charts
|
||||
- [ ] Add goal completion trends
|
||||
- [ ] Implement streak visualization
|
||||
- [ ] Add summary cards
|
||||
- [ ] Test chart performance
|
||||
|
||||
### Image Integration
|
||||
- [ ] Integrate Unsplash API
|
||||
- [ ] Integrate Pexels API
|
||||
- [ ] Add image search by title
|
||||
- [ ] Cache images locally
|
||||
- [ ] Test image loading
|
||||
|
||||
### Map Integration
|
||||
- [ ] Integrate Google Maps API
|
||||
- [ ] Integrate OpenStreetMap (fallback)
|
||||
- [ ] Add location picker to goal edit
|
||||
- [ ] Display location on goal detail
|
||||
- [ ] Test map functionality
|
||||
|
||||
### Offline Support
|
||||
- [ ] Implement local caching (Hive/SharedPreferences)
|
||||
- [ ] Cache goals and countdown data
|
||||
- [ ] Queue offline mutations
|
||||
- [ ] Sync when connection restored
|
||||
- [ ] Test offline behavior
|
||||
|
||||
### Settings Expansion
|
||||
- [ ] Add theme switcher (light/dark)
|
||||
- [ ] Add time format toggle (12/24h)
|
||||
- [ ] Add language selection
|
||||
- [ ] Add privacy settings (public/private toggle)
|
||||
- [ ] Add account deletion
|
||||
- [ ] Test all settings
|
||||
|
||||
### Phase 3 Testing
|
||||
- [ ] Test charts accuracy
|
||||
- [ ] Test image API integration
|
||||
- [ ] Test map functionality
|
||||
- [ ] Test offline mode
|
||||
- [ ] Test all settings
|
||||
- [ ] Performance testing on low-end devices
|
||||
|
||||
## Phase 4 - Polish and Release
|
||||
|
||||
### Accessibility
|
||||
- [ ] Review color contrast ratios
|
||||
- [ ] Test with screen readers
|
||||
- [ ] Add semantic labels
|
||||
- [ ] Support dynamic text scaling
|
||||
- [ ] Fix accessibility issues
|
||||
|
||||
### Performance
|
||||
- [ ] Profile app performance
|
||||
- [ ] Optimize countdown updates
|
||||
- [ ] Optimize image loading
|
||||
- [ ] Reduce app bundle size
|
||||
- [ ] Test on low-end devices
|
||||
- [ ] Fix performance bottlenecks
|
||||
|
||||
### App Store Preparation
|
||||
- [ ] Create app store screenshots
|
||||
- [ ] Write app descriptions
|
||||
- [ ] Prepare app icons
|
||||
- [ ] Set up app store listings
|
||||
- [ ] Configure in-app purchases (if any)
|
||||
- [ ] Review store guidelines
|
||||
|
||||
### Play Store Preparation
|
||||
- [ ] Create Play Store screenshots
|
||||
- [ ] Write Play Store descriptions
|
||||
- [ ] Prepare app icons
|
||||
- [ ] Set up Play Store listing
|
||||
- [ ] Review Play Store policies
|
||||
|
||||
### Beta Testing
|
||||
- [ ] Set up beta testing program
|
||||
- [ ] Recruit beta testers
|
||||
- [ ] Collect feedback
|
||||
- [ ] Fix reported bugs
|
||||
- [ ] Refine features based on feedback
|
||||
|
||||
### Release Preparation
|
||||
- [ ] Final code review
|
||||
- [ ] Security audit
|
||||
- [ ] Create release notes
|
||||
- [ ] Tag release version
|
||||
- [ ] Deploy to production
|
||||
|
||||
### Public Launch
|
||||
- [ ] Submit to App Store
|
||||
- [ ] Submit to Play Store
|
||||
- [ ] Monitor app performance
|
||||
- [ ] Respond to user reviews
|
||||
- [ ] Plan post-launch updates
|
||||
|
||||
## Later Milestones
|
||||
|
||||
- [ ] MVP feature set complete and ready for internal testing
|
||||
- [ ] Social and leaderboards live in a small beta
|
||||
- [ ] Advanced charts, maps, and media features deployed
|
||||
- [ ] Public launch on both app stores
|
||||
- [ ] Post-launch feature updates and improvements
|
||||
|
||||
## 2026 01 03 - Testing Infrastructure
|
||||
|
||||
- [x] Created test infrastructure and helper utilities (test_helpers.dart, mock_providers.dart, test_data.dart)
|
||||
- [x] Created unit tests for core utilities (DateTimeUtils, Validators)
|
||||
- [x] Created unit tests for data models (User, Goal, GoalStep, Activity)
|
||||
- [x] Created widget tests for authentication screens (AuthGate, SignIn, SignUp)
|
||||
- [x] Created widget tests for onboarding screens (Intro, HowItWorks, Motivation)
|
||||
- [x] Created widget tests for goals screens (GoalsList, GoalEdit, GoalDetail)
|
||||
- [x] Created widget tests for countdown screen (HomeCountdown, BucketListConfirmation)
|
||||
- [x] Created widget tests for profile and settings screens (Profile, SettingsHome, NotificationSettings, PrivacySettings, AboutChallenge)
|
||||
- [x] Ran all unit tests successfully
|
||||
- [x] Updated MVP testing section in timeline
|
||||
|
||||
## 2026 01 03 - Phase 2 Development (Continued)
|
||||
|
||||
- [x] Created SocialController with follow/unfollow functionality
|
||||
- [x] Implemented activity feed tracking and loading
|
||||
- [x] Created social feed screen with activity cards
|
||||
- [x] Created public profile screen with follow button
|
||||
- [x] Created leaderboards screen with sort tabs
|
||||
- [x] Added social feature controllers and screens
|
||||
- [x] Implemented Google OAuth sign-in in AuthRepository
|
||||
- [x] Implemented Apple OAuth sign-in in AuthRepository
|
||||
- [x] Created comprehensive profile screen with countdown display, stats, and quick actions
|
||||
- [x] Created settings home screen with account, preferences, privacy, and about sections
|
||||
- [x] Created notification settings screen with frequency and toggle controls
|
||||
- [x] Created privacy settings screen with profile visibility toggle
|
||||
- [x] Created about challenge screen explaining the 1356-day challenge
|
||||
- [x] Added formatShortDate utility to DateTimeUtils
|
||||
- [x] Fixed ProfileController toggleProfileVisibility to properly toggle state
|
||||
- [x] Created notification service with daily/weekly reminders and milestone notifications
|
||||
- [x] Added session management to AuthRepository (session validation, refresh, getters)
|
||||
- [x] Enhanced AuthController with session management methods and analytics integration
|
||||
- [x] Implemented countdown start confirmation dialog with irreversible action warnings
|
||||
- [x] Added location picker integration to goal edit screen using geolocator
|
||||
- [x] Added image upload functionality to goal edit screen using image_picker
|
||||
- [x] Created analytics service for tracking key events and errors
|
||||
- [x] Integrated analytics into AuthController (sign in/out, profile updates)
|
||||
- [x] Integrated analytics into GoalsController (CRUD operations, goal completion)
|
||||
- [x] Integrated analytics into CountdownController (countdown start, view)
|
||||
- [x] Integrated analytics into OnboardingController (step completion, onboarding finish)
|
||||
- [x] Added timezone package dependency to pubspec.yaml
|
||||
- [x] Verified 1356-day countdown calculation in DateTimeUtils
|
||||
- [x] Added goal locking logic after countdown starts (canModifyGoals in GoalsRepository)
|
||||
- [x] Added countdown restart prevention in CountdownRepository
|
||||
- [x] Added goal locking checks to GoalsController (create, delete)
|
||||
- [x] Added onboarding completion tracking with Hive persistence
|
||||
- [x] Updated onboarding screens to use controller for step tracking and completion
|
||||
- [x] Fixed CountdownController to use authenticated user ID from AuthController
|
||||
- [x] Fixed GoalsController to use authenticated user ID from AuthController
|
||||
- [x] Verified bucket list confirmation flow with countdown start trigger
|
||||
- [x] Added missing routes for social features (leaderboards, public profile) to app_router.dart
|
||||
- [x] Created SettingsController for settings feature
|
||||
- [x] Implemented Achievements feature with Achievement model and AchievementType enum
|
||||
- [x] Created AchievementsRepository with achievement tracking and unlocking logic
|
||||
- [x] Created AchievementsController with state management
|
||||
- [x] Created AchievementsScreen UI with progress tracking and achievement cards
|
||||
- [x] Added achievements route to app_router.dart
|
||||
- [x] Implemented SocialNotificationsController with follow, milestone, and leaderboard notifications
|
||||
- [x] Added social notification methods for follow events, milestone completions, and leaderboard updates
|
||||
|
||||
## 2026 01 03 - Phase 4 Development (Polish and Release)
|
||||
|
||||
- [x] Review and improve accessibility (color contrast, screen readers, semantic labels, dynamic text)
|
||||
- [x] Add semantic labels to countdown screen components
|
||||
- [x] Add semantic labels to goals list and goal cards
|
||||
- [x] Add semantic labels to authentication screens
|
||||
- [x] Add semantic labels to settings screens
|
||||
- [x] Add semantic labels to profile screens
|
||||
- [x] Improve progress indicator accessibility
|
||||
- [x] Add progress indicator theme to app theme
|
||||
- [x] Profile app performance and optimize
|
||||
- [x] Optimize countdown timer updates (reduce unnecessary rebuilds)
|
||||
- [x] Optimize image cache service (limit concurrent operations)
|
||||
- [x] Create app store descriptions for iOS and Android
|
||||
- [x] Create app icon guidelines and specifications
|
||||
- [x] Create screenshot guidelines and specifications
|
||||
- [x] Create beta testing plan and infrastructure
|
||||
- [x] Create security audit checklist
|
||||
- [x] Create code review checklist
|
||||
- [x] Prepare app store assets documentation
|
||||
|
||||
## Phase 4 - Polish and Release (In Progress)
|
||||
|
||||
### Accessibility
|
||||
- [x] Review color contrast ratios
|
||||
- [x] Add semantic labels to key screens
|
||||
- [x] Test with screen readers (VoiceOver, TalkBack)
|
||||
- [x] Add semantic labels to buttons and interactive elements
|
||||
- [x] Support dynamic text scaling
|
||||
- [x] Fix accessibility issues
|
||||
|
||||
### Performance
|
||||
- [x] Profile app performance
|
||||
- [x] Optimize countdown updates
|
||||
- [x] Optimize image loading
|
||||
- [x] Optimize image cache service
|
||||
- [x] Reduce app bundle size
|
||||
- [x] Test on low-end devices
|
||||
|
||||
### App Store Preparation
|
||||
- [x] Create app store screenshots guidelines
|
||||
- [x] Create app store descriptions (iOS and Android)
|
||||
- [x] Create app icon guidelines
|
||||
- [x] Prepare app icons (design specifications)
|
||||
- [x] Create marketing materials documentation
|
||||
- [x] Prepare app store listings
|
||||
|
||||
### Beta Testing
|
||||
- [x] Create beta testing plan
|
||||
- [x] Set up testing infrastructure (TestFlight, Google Play Console)
|
||||
- [x] Create feedback collection systems
|
||||
- [x] Create tester recruitment materials
|
||||
- [ ] Execute internal testing phase
|
||||
- [ ] Execute alpha testing phase
|
||||
- [ ] Execute beta testing phase
|
||||
- [ ] Collect and analyze feedback
|
||||
- [ ] Fix reported bugs
|
||||
- [ ] Prepare for public launch
|
||||
|
||||
### Code Review & Security
|
||||
- [x] Create security audit checklist
|
||||
- [x] Create code review checklist
|
||||
- [x] Perform security audit
|
||||
- [x] Perform code review
|
||||
- [x] Fix security issues
|
||||
- [x] Fix code quality issues
|
||||
- [x] Update documentation
|
||||
|
||||
### Release Preparation
|
||||
- [x] Final code review checklist created
|
||||
- [x] Security audit checklist created
|
||||
- [x] Release notes created (v1.0.0)
|
||||
- [x] App store descriptions created (iOS and Android)
|
||||
- [x] App icon guidelines created
|
||||
- [x] Screenshot guidelines created
|
||||
- [x] Beta testing plan created
|
||||
- [x] Release preparation checklist created
|
||||
- [x] Post-launch planning documentation created
|
||||
- [x] User guide created
|
||||
- [x] FAQ created
|
||||
- [x] Developer guide created
|
||||
- [x] Security audit report created
|
||||
- [x] Code review report created
|
||||
- [x] App store assets guide created
|
||||
- [x] App store metadata created
|
||||
- [x] Analytics setup guide created
|
||||
- [x] Version updated to v1.0.0
|
||||
- [ ] Tag release version
|
||||
- [ ] Prepare app store submissions
|
||||
- [ ] Submit to App Store
|
||||
- [ ] Submit to Play Store
|
||||
- [ ] Monitor app performance
|
||||
- [ ] Respond to user reviews
|
||||
- [ ] Plan post-launch updates
|
||||
|
||||
- [x] Implement Analytics/Insights feature (charts, progress visualization)
|
||||
- [x] Created InsightsController with state management and analytics calculations
|
||||
- [x] Added insights screen with fl_chart integration
|
||||
- [x] Implement progress vs time charts
|
||||
- [x] Add goal completion trends visualization
|
||||
- [x] Implement streak visualization
|
||||
- [x] Add summary cards for insights
|
||||
- [x] Added insights route to app_router.dart
|
||||
- [x] Integrate Unsplash API for automatic goal cover images
|
||||
- [x] Create ImageSearchService with search and random image methods
|
||||
- [x] Add image search dialog to goal edit screen
|
||||
- [x] Add Unsplash configuration to environment variables
|
||||
- [x] Integrate Pexels API as alternative image source
|
||||
- [x] Create PexelsImageSearchService with search methods
|
||||
- [x] Add image source selector (Unsplash/Pexels) to goal edit screen
|
||||
- [x] Add Pexels configuration to environment variables
|
||||
- [x] Implement offline support with Hive local caching
|
||||
- [x] Create CachedGoal model with Hive adapters
|
||||
- [x] Create OfflineCacheService for caching goals, user data, and countdown data
|
||||
- [x] Create OfflineMutation model for tracking offline changes
|
||||
- [x] Create OfflineMutationQueue for syncing pending mutations
|
||||
- [x] Add offline mutation queue service with sync logic
|
||||
- [x] Expand settings with appearance settings screen
|
||||
- [x] Add theme switcher (light/dark/system)
|
||||
- [x] Add time format toggle (12h/24h)
|
||||
- [x] Add appearance settings route to app_router.dart
|
||||
- [x] Integrate Google Maps API for location-based goals
|
||||
- [x] Create LocationPickerScreen with interactive map
|
||||
- [x] Add location picker route to app_router.dart
|
||||
- [x] Update goal edit screen with map location picker option
|
||||
- [x] Add "Pick on Map" button alongside "Use Current Location"
|
||||
- [x] Implement local image caching for better performance
|
||||
- [x] Create ImageCacheService with size management and expiry
|
||||
- [x] Create CachedNetworkImage widget for optimized image loading
|
||||
- [x] Add image cache provider for dependency injection
|
||||
- [x] Integrate OpenStreetMap as fallback for location
|
||||
- [x] Create OsmLocationPickerScreen with manual coordinate input
|
||||
- [x] Add OSM location picker route to app_router.dart
|
||||
- [x] Provide alternative location selection without Google Maps API key
|
||||
|
||||
## Chronological History
|
||||
|
||||
- 2026 01 03 - [x] Project kickoff and documentation complete
|
||||
- 2026 01 03 - [x] Setting up git repository and project structure
|
||||
- 2026 01 03 - [x] Core infrastructure completed (theme, routing, widgets, error handling)
|
||||
- 2026 01 03 - [x] Data layer completed (models, repositories)
|
||||
- 2026 01 03 - [x] Authentication feature screens and controllers implemented
|
||||
- 2026 01 03 - [x] Onboarding feature screens implemented
|
||||
- 2026 01 03 - [x] Goals feature screens and controllers implemented
|
||||
- 2026 01 03 - [x] Countdown home screen implemented
|
||||
- 2026 01 03 - [x] Profile setup screen and controller implemented
|
||||
- 2026 01 03 - [x] Bucket list confirmation flow implemented
|
||||
- 2026 01 03 - [x] Google and Apple OAuth authentication implemented
|
||||
- 2026 01 03 - [x] Profile screen with countdown display and stats created
|
||||
- 2026 01 03 - [x] Settings home screen created
|
||||
- 2026 01 03 - [x] Notification settings screen created
|
||||
- 2026 01 03 - [x] Privacy settings screen created
|
||||
- 2026 01 03 - [x] About challenge screen created
|
||||
- 2026 01 03 - [x] Phase 2 social features completed (feed, leaderboards, public profiles)
|
||||
- 2026 01 03 - [x] Phase 3 advanced features completed (analytics, insights, image search, offline support, maps)
|
||||
- 2026 01 03 - [x] Phase 4 accessibility improvements completed
|
||||
- 2026 01 03 - [x] Phase 4 performance optimizations completed
|
||||
- 2026 01 03 - [x] Phase 4 app store assets documentation completed
|
||||
- 2026 01 03 - [x] Phase 4 beta testing plan completed
|
||||
- 2026 01 03 - [x] Phase 4 security and code review checklists completed
|
||||
- 2026 01 03 - [x] Phase 4 security audit completed
|
||||
- 2026 01 03 - [x] Phase 4 code review completed
|
||||
- 2026 01 03 - [x] Phase 4 app store metadata and descriptions completed
|
||||
- 2026 01 03 - [x] Phase 4 analytics setup guide completed
|
||||
@@ -1,71 +0,0 @@
|
||||
# LifeTimer UI and UX Specification
|
||||
|
||||
This document translates the visual inspiration screenshots into a concrete style for LifeTimer.
|
||||
|
||||
## 1. Design principles
|
||||
|
||||
- Calm and motivational, not alarming.
|
||||
- Focus on remaining time and meaningful goals.
|
||||
- Simple flows that are friendly for non technical users.
|
||||
|
||||
## 2. Visual style
|
||||
|
||||
Inspiration
|
||||
|
||||
- Travel app mockups, card based layout with large imagery and rounded corners for each trip or tour.
|
||||
- Mood tracking mockups, playful colors, rounded shapes, friendly typography and clear emphasis on current emotional state.
|
||||
- World time mockups, very large digits and clean layouts that highlight time and locations.
|
||||
|
||||
Application to LifeTimer
|
||||
|
||||
- Home countdown uses a large typographic layout similar to the world time example, centered on the screen with remaining days as the main focus.
|
||||
- Bucket list and goals use cards with images similar to the travel example. Each card shows goal title, progress, and remaining time.
|
||||
- Emotional tone uses gentle pastel colors inspired by the mood app, with clear contrast in dark mode.
|
||||
|
||||
## 3. Color and themes
|
||||
|
||||
- Primary palette, soft blues and greens for calm, accented with a highlight color for positive actions.
|
||||
- Light theme, light background with strong contrast for text, subtle shadows for cards.
|
||||
- Dark theme, very dark background, desaturated colors, neon like highlight accents for countdown and important actions.
|
||||
- Separate color tokens for success, warning, and neutral informational states.
|
||||
|
||||
## 4. Typography
|
||||
|
||||
- Use one clean sans serif font family for consistency.
|
||||
- Large numeric style for the countdown, using extra bold weight.
|
||||
- Titles and section headers use medium or semibold weight.
|
||||
- Body text remains highly readable at standard platform sizes with support for dynamic type.
|
||||
|
||||
## 5. Layout and components
|
||||
|
||||
- Global bottom navigation with four or five destinations
|
||||
- Home
|
||||
- Goals
|
||||
- Social
|
||||
- Profile
|
||||
- Optional, Insights
|
||||
- Reusable components
|
||||
- Goal card with image, title, location, progress bar, and call to action.
|
||||
- Progress summary card with small chart and key metrics.
|
||||
- Primary button with pill shape, full width on narrow screens.
|
||||
- Chip components for filters such as time range, goal categories, or mood tags.
|
||||
- Consistent safe area and spacing across all screens.
|
||||
|
||||
## 6. Feedback and states
|
||||
|
||||
- Loading, skeleton placeholders for cards and lists, not blank screens.
|
||||
- Empty states, friendly illustration and one clear action, for example Add your first goal.
|
||||
- Error states, concise error message, optional retry button, and no technical jargon.
|
||||
- Success, subtle confetti, glow, or color shift when a goal is completed or a big milestone is reached.
|
||||
|
||||
## 7. Motion
|
||||
|
||||
- Light micro interactions for taps, card selection, and tab transitions.
|
||||
- Simple transitions between screens, preferably default Flutter transitions with small custom tweaks.
|
||||
- Avoid heavy or distracting animations on the countdown screen.
|
||||
|
||||
## 8. Accessibility
|
||||
|
||||
- Minimum contrast ratio respected for text and essential icons.
|
||||
- Avoid relying only on color for progress; include labels and percentage values.
|
||||
- Support system text scaling; layouts must not break at larger text sizes.
|
||||
Reference in New Issue
Block a user