Skip to content

uumair327/guardiancare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

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

Repository files navigation

πŸ₯ GuardianCare - Flutter Application

A comprehensive educational and support application for guardians and children, built with Clean Architecture principles.


πŸ“‹ Project Overview

GuardianCare is a Flutter application designed to provide educational resources, community support, and safety features for guardians and children. The application has been refactored to follow Clean Architecture principles, ensuring maintainability, testability, and scalability.


πŸ—οΈ Architecture

This project follows Clean Architecture with three distinct layers:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       PRESENTATION LAYER                β”‚
β”‚  (UI, BLoC, Pages, Widgets)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚ depends on
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         DOMAIN LAYER                    β”‚
β”‚  (Entities, Use Cases, Repositories)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚ implemented by
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          DATA LAYER                     β”‚
β”‚  (Models, Data Sources, Repositories)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Principles

  • Dependency Rule: Dependencies point inward
  • Single Responsibility: Each class has one job
  • Dependency Inversion: Depend on abstractions
  • Testability: Each layer independently testable

✨ Features

βœ… Implemented (Production Ready)

1. Authentication

  • Email/password authentication
  • Google OAuth integration
  • Password reset functionality
  • User profile management
  • Real-time auth state management

2. Forum

  • Real-time forum updates
  • Comment system with streams
  • Category support (Parent/Children)
  • User details integration
  • CRUD operations

⏳ In Progress

  • Home Dashboard
  • User Profile
  • Learning Resources
  • Interactive Quizzes
  • Emergency Contacts
  • Reporting System
  • Content Exploration
  • Consent Management

πŸš€ Getting Started

Prerequisites

  • Flutter SDK (>=3.4.0 <4.0.0)
  • Dart SDK
  • Firebase account
  • Android Studio / VS Code

Installation

  1. Clone the repository
git clone <repository-url>
cd guardiancare
  1. Install dependencies
flutter pub get
  1. Configure Firebase
  • Add your google-services.json to android/app/
  • Add your GoogleService-Info.plist to ios/Runner/
  • Update firebase_options.dart with your configuration
  1. Run the app
flutter run

πŸ“š Documentation

Quick Links

Document Description
DOCUMENTATION_INDEX.md Main navigation hub
CLEAN_ARCHITECTURE_IMPLEMENTATION.md Architecture overview
.kiro/specs/clean-architecture/MIGRATION_GUIDE.md Feature migration guide
.kiro/specs/clean-architecture/TESTING_GUIDE.md Testing guide
.kiro/specs/clean-architecture/FINAL_STATUS.md Current status

Full Documentation

All documentation is located in .kiro/specs/clean-architecture/:

  • Architecture guides
  • Implementation guides
  • Testing guides
  • Migration guides
  • Progress reports

πŸ§ͺ Testing

Run Tests

# Run all tests
flutter test

# Run specific test
flutter test test/features/authentication/domain/usecases/sign_in_with_email_test.dart

# Run with coverage
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html

Generate Mocks

flutter pub run build_runner build --delete-conflicting-outputs

πŸ“‚ Project Structure

lib/
β”œβ”€β”€ core/                       # Core functionality
β”‚   β”œβ”€β”€ error/                  # Error handling
β”‚   β”œβ”€β”€ usecases/               # Base use case
β”‚   β”œβ”€β”€ network/                # Network utilities
β”‚   └── di/                     # Dependency injection
β”‚
β”œβ”€β”€ features/                   # Feature modules
β”‚   β”œβ”€β”€ authentication/         # βœ… Complete
β”‚   β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── presentation/
β”‚   β”‚
β”‚   β”œβ”€β”€ forum/                  # βœ… Complete
β”‚   β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── presentation/
β”‚   β”‚
β”‚   └── [other features]/       # ⏳ In progress
β”‚
└── main.dart                   # App entry point

πŸ› οΈ Tech Stack

Core

  • Flutter - UI framework
  • Dart - Programming language
  • Clean Architecture - Architecture pattern

State Management

  • flutter_bloc - BLoC pattern implementation
  • equatable - Value equality

Functional Programming

  • dartz - Either type for error handling

Dependency Injection

  • get_it - Service locator
  • injectable - Code generation

Backend

  • Firebase Auth - Authentication
  • Cloud Firestore - Database
  • Firebase Crashlytics - Crash reporting
  • Firebase Analytics - Analytics

UI/UX

  • google_fonts - Custom fonts
  • cached_network_image - Image caching
  • shimmer - Loading effects

Testing

  • mockito - Mocking framework
  • bloc_test - BLoC testing
  • fake_cloud_firestore - Firestore mocking

🎯 Development Guidelines

Adding a New Feature

  1. Follow the Migration Guide

    • See .kiro/specs/clean-architecture/MIGRATION_GUIDE.md
  2. Create Domain Layer

    • Define entities
    • Create repository interface
    • Create use cases
  3. Create Data Layer

    • Create models
    • Create data sources
    • Implement repository
  4. Create Presentation Layer

    • Create BLoC
    • Define events and states
    • Update UI
  5. Register Dependencies

    • Add to lib/core/di/injection_container.dart
  6. Write Tests

    • Use case tests
    • Repository tests
    • BLoC tests

πŸ“ String Constants Usage Guidelines

All hardcoded strings in the application are centralized into organized constant classes following Clean Architecture principles. This ensures consistency, maintainability, and easier localization support.

String Constant Classes

Class Purpose Location
AppStrings Core app info, URLs, storage keys, route names lib/core/constants/app_strings.dart
ErrorStrings Error messages (network, auth, cache, server) lib/core/constants/error_strings.dart
ValidationStrings Input validation messages lib/core/constants/validation_strings.dart
UIStrings UI text (buttons, labels, titles, placeholders) lib/core/constants/ui_strings.dart
FeedbackStrings SnackBar/toast messages (success, error, warning) lib/core/constants/feedback_strings.dart
FirebaseStrings Firebase collection/document names lib/core/constants/firebase_strings.dart
ApiStrings API URLs, endpoints, headers lib/core/constants/api_strings.dart

Feature-Specific Strings

For strings used only within a single feature, create a feature-specific strings file:

lib/features/{feature}/presentation/constants/strings.dart

Examples:

  • ForumStrings - Forum feature strings
  • VideoPlayerStrings - Video player feature strings

Usage Examples

Single Import (Recommended)

// Import all constants with a single import
import 'package:guardiancare/core/constants/constants.dart';

// Usage
Text(UIStrings.signIn);
Text(ErrorStrings.network);
Text(FeedbackStrings.saveSuccess);

Error Messages

// Use ErrorStrings for technical/system errors
throw ServerException(ErrorStrings.server);
return Left(Failure(ErrorStrings.networkError));

// Template methods for dynamic errors
ErrorStrings.failedTo('load data'); // "Failed to load data."
ErrorStrings.failedToWithReason('save', 'disk full'); // "Failed to save: disk full"

Validation Messages

// Use ValidationStrings for form validation
if (email.isEmpty) return ValidationStrings.emailRequired;
if (!isValidEmail(email)) return ValidationStrings.emailInvalid;

// Template methods for dynamic validation
ValidationStrings.minLength(6); // "Must be at least 6 characters."
ValidationStrings.maxLength(100); // "Must be at most 100 characters."

UI Text

// Use UIStrings for buttons, labels, titles
ElevatedButton(
  onPressed: onSubmit,
  child: Text(UIStrings.submit),
);

// Time-based greetings
Text(UIStrings.goodMorning);

// Template methods for dynamic text
UIStrings.minutesAgo(5); // "5m ago"
UIStrings.itemCount(3, 'item'); // "3 items"

Feedback Messages

// Use FeedbackStrings for SnackBars and toasts
ScaffoldMessenger.of(context).showSnackBar(
  SnackBar(content: Text(FeedbackStrings.saveSuccess)),
);

// Template methods for dynamic feedback
FeedbackStrings.itemSaved('Profile'); // "Profile saved successfully!"
FeedbackStrings.confirmAction('delete'); // "Are you sure you want to delete?"

Firebase Constants

// Use FirebaseStrings for collection/document names
final collection = FirebaseFirestore.instance.collection(FirebaseStrings.users);
final data = {
  FirebaseStrings.fieldName: name,
  FirebaseStrings.fieldEmail: email,
  FirebaseStrings.fieldCreatedAt: FieldValue.serverTimestamp(),
};

When to Use Constants vs. AppLocalizations

Use Case Use This
User-facing text that needs translation AppLocalizations (l10n)
Technical identifiers (collection names, API endpoints) String Constants
Error codes and technical messages ErrorStrings
Asset paths and URLs AppStrings
Strings that are the same in all languages String Constants
Button labels, titles (if not localized) UIStrings

Adding New String Constants

  1. Identify the category - Determine which string class the constant belongs to
  2. Add to appropriate file - Add the constant to the correct file
  3. Use descriptive names - Use clear, descriptive constant names
  4. Group related constants - Keep related constants together with section comments
  5. Add template methods - For dynamic strings, add template methods

Example:

// In error_strings.dart
class ErrorStrings {
  // ==================== New Category ====================
  static const String newError = 'New error message.';
  
  // Template method for dynamic errors
  static String customError(String detail) => 'Error: $detail';
}

Best Practices

  1. Never hardcode strings - Always use constants or localization
  2. Single import - Use import 'package:guardiancare/core/constants/constants.dart';
  3. Feature isolation - Keep feature-specific strings in feature folders
  4. Consistent naming - Follow existing naming conventions
  5. Document new categories - Add section comments for new constant groups

Code Style

  • Follow Effective Dart
  • Use flutter analyze before committing
  • Write tests for new features
  • Document complex logic
  • Keep functions small and focused

πŸ“Š Project Status

Metric Status
Features Complete 2 of 10 (20%)
Production Files 38
Documentation Files 18+
Code Quality ⭐⭐⭐⭐⭐
Test Coverage In Progress
Production Ready βœ… Yes (2 features)

Screenshots of Application [APK]

Home and Explore Pages

Home Page Explore Page
Home Page Explore Page

Forum Page

Forum Page 1 Forum Page 2 Forum Page 3
Forum Page Forum Page 2 Forum Page 3

Learn Page

Learn Page 1 Learn Page 2 Learn Page 3
Learn Page Learn Page 2 Learn Page 3

Quiz Page

Quiz Page 1 Quiz Page 2
Quiz Page Quiz Page 2

Emergency Page

Emergency Page
Emergency Page

Profile Page

Profile Page
Profile Page

Web View

Web View
Web View

Testing and Feedback

We value your input and strive to make our app the best it can be. If you're interested in helping us test new features and provide feedback, we invite you to join our list of testers.

By becoming a tester, you'll get the opportunity to experience beta testing and try out upcoming features before they're released to the public. Meanwhile, stable releases can be found in the Releases section . You can also contribute by building the app locally and testing specific functionalities to help us find and fix bugs. Alternatively, you can join our testing app group to access beta releases and provide feedback directly.

To join our testing program, click here and become a part of shaping the future of our app!

🀝 Contributing

Development Workflow

  1. Create a feature branch
  2. Follow Clean Architecture patterns
  3. Write tests
  4. Update documentation
  5. Submit pull request

Code Review Checklist

  • Follows Clean Architecture
  • All layers implemented
  • Tests written
  • Documentation updated
  • No compilation errors
  • No diagnostic issues

πŸ“ License

[Add your license here]


πŸ‘₯ Team

[Add team members here]


πŸ“ž Support

For questions or issues:

  1. Check the documentation in .kiro/specs/clean-architecture/
  2. Review code examples in lib/features/authentication/ and lib/features/forum/
  3. Follow the migration guide for new features

πŸŽ‰ Acknowledgments

  • Clean Architecture by Robert C. Martin
  • Flutter team for the amazing framework
  • Firebase for backend services
  • All contributors to this project

πŸ“ˆ Roadmap

Phase 1: Foundation βœ…

  • Core infrastructure
  • Authentication feature
  • Forum feature
  • Documentation
  • Testing infrastructure

Phase 2: Core Features ⏳

  • Home dashboard
  • User profile
  • Learning resources
  • Interactive quizzes

Phase 3: Advanced Features ⏳

  • Emergency contacts
  • Reporting system
  • Content exploration
  • Consent management

Phase 4: Polish & Launch πŸ“…

  • Performance optimization
  • Comprehensive testing
  • UI/UX refinement
  • Production deployment

Built with ❀️ using Flutter and Clean Architecture


Last Updated: November 22, 2025
Version: 1.0.0+16
Status: Active Development

About

A Flutter-based cross-platform mobile application that provides resources, support to combat online sexual exploitation of children.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •