A comprehensive educational and support application for guardians and children, engineered with Clean Architecture principles for scalability, testability, and maintainability.
- Overview
- Architecture
- Tech Stack
- Project Structure
- Getting Started
- Environment Configuration
- Security
- Build & Run
- Current Status
- Roadmap
- Contributing
- Screenshots
- License
GuardianCare is a production-grade Flutter application designed to provide educational resources, community support, and safety features for guardians and children. The application has been meticulously refactored to follow Clean Architecture principles, ensuring a separation of concerns that facilitates independent testing and feature expansion.
This project follows Clean Architecture with three distinct, loosely coupled layers:
graph TD
Presentation[Presentation Layer<br>UI, BLoC, Widgets] --> Domain[Domain Layer<br>Entities, Use Cases, Repositories]
Data[Data Layer<br>Models, Data Sources, Repositories Impl] --> Domain
Data --> Remote[Remote Data Sources<br>Firebase, Supabase, API]
Data --> Local[Local Data Sources<br>Hive, SQLite, SecureStorage]
- Dependency Rule: Source code dependencies only point inwards. The Domain layer is independent of framework, UI, and external agencies.
- Single Responsibility: Each class has one job and one reason to change.
- Dependency Inversion: High-level modules do not depend on low-level modules; both depend on abstractions.
- Testability: The business logic can be tested without UI, Database, or Web Server.
- Flutter: UI Toolkit (SDK >=3.19.0)
- Dart: Programming Language
- Clean Architecture: Structural Pattern
- flutter_bloc: Predictable state management (BLoC pattern)
- equatable: Value equality for efficient state comparison
- Firebase: (Auth, Firestore, Crashlytics, Analytics)
- Supabase: (Alternative Backend support via polymorphism)
- Hive: Lightweight local NoSQL database
- sqflite: SQLite plugin for Flutter
- go_router: Declarative routing package
- get_it: Service Locator
- injectable: Code generation for DI
- mockito: Mocking framework
- bloc_test: Testing library for BLoC
- fake_cloud_firestore: In-memory Cloud Firestore for testing
lib/
βββ core/ # Core functionality & Shared Kernel
β βββ config/ # Environment & Config
β βββ error/ # Error handling (Failures, Exceptions)
β βββ usecases/ # Base UseCase definitions
β βββ util/ # Utilities (Logger, Validators)
β βββ di/ # Dependency Injection setup
β
βββ features/ # Feature-based modular structure
β βββ authentication/ # β
Admin & User Auth
β β βββ domain/ # Entities, Repositories, UseCases
β β βββ data/ # Models, DataSources, Repo Impl
β β βββ presentation/ # BLoC, Pages, Widgets
β β
β βββ forum/ # β
Community Forum
β β βββ domain/
β β βββ data/
β β βββ presentation/
β β
β βββ [other features]/ # β³ Home, Profile, Learning, etc.
β
βββ main.dart # Application Entry Point
Ensure you have the following installed:
- Flutter SDK:
3.x(Stable channel) - Dart SDK: Compatible with Flutter version
- Git: Version control
- Android Studio / VS Code: Recommended IDEs with Flutter/Dart plugins
-
Clone the repository
git clone <repository-url> cd guardiancare
-
Install dependencies
flutter clean flutter pub get
-
Code Generation (if applicable) Since we use
injectableandjson_serializable, run build runner:dart run build_runner build --delete-conflicting-outputs
This project uses Environment Variables to manage sensitive keys and configuration.
Create a .env file in the root directory. Do NOT commit this file.
Use .env.example as a template:
# .env
API_URL=https://api.example.com
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
# Add other secrets here (exclude references to hardcoded keys in code)- Place
google-services.jsoninandroid/app/. - Place
GoogleService-Info.plistinios/Runner/. - Ensure
firebase_options.dartis present inlib/(generated viaflutterfire configure).
We adhere to strict security practices:
- No Credentials in Git:
.envfiles and Firebase keys are git-ignored. - Secure Logging: Usage of
Logutility instead ofprintordebugPrint. Logging is stripped in Release builds. - Secure Storage: Sensitive local data is encrypted.
- Environment Isolation: Distinct configurations for Development, Staging, and Production.
Run on an emulator or connected device:
flutter run
# OR with a specific flavor (if configured)
flutter run --flavor devGenerate release artifacts:
Android (APK):
flutter build apk --releaseAndroid (App Bundle):
flutter build appbundle --releaseiOS (IPA):
flutter build ios --releaseObfuscation (Optional but Recommended):
flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory>| Module | Status | Notes |
|---|---|---|
| Authentication | β Stable | Email, Google OAuth, Persistence |
| Forum | β Stable | Real-time updates, Categorization |
| Home Dashboard | UI Skeleton ready | |
| Learning | Content integration pending | |
| Quizzes | Logic refinement needed | |
| Emergency | β³ Planned | Contacts & SOS integration |
| Profile | β³ Planned | User management |
We welcome contributions! Please follow these guidelines to ensure quality.
- Fork the repository.
- Clone your fork locally.
- Create a Branch for your feature/fix:
git checkout -b feature/amazing-feature # OR git checkout -b fix/critical-bug - Commit your changes with clear messages:
git commit -m "feat: add amazing feature" - Push to your fork:
git push origin feature/amazing-feature
- Open a Pull Request (PR) to the
mainbranch.
- Follow Clean Architecture layers.
- Ensure
flutter analyzepasses with zero issues. - Format code using
dart format .. - Add Unit Tests for new Domain logic.
- Update Documentation if architectural changes are made.
# Run Unit & Widget Tests
flutter test
# Run tests with coverage
flutter test --coverage
genhtml coverage/lcov.info -o coverage/htmlAll user-facing text and technical keys are centralized in lib/core/constants/.
AppStrings: Routes, Keys, URLsUIStrings: Button labels, TitlesErrorStrings: User-friendly error messagesFirebaseStrings: Collection names
See Documentation for detailed usage guidelines.
| Home Page | Explore Page |
|---|---|
![]() |
![]() |
| Forum Page 1 | Forum Page 2 | Forum Page 3 |
|---|---|---|
![]() |
![]() |
![]() |
| Learn Page | Quiz Page | Emergency Page |
|---|---|---|
![]() |
![]() |
![]() |
- Phase 1: Core Infrastructure & Auth β
- Phase 2: Forum & Community Features β
- Phase 3: Core Features (Learning, Quiz, Home) β³
- Phase 4: Polish, Performance, & Launch π
This project is licensed under the MIT License - see the LICENSE file for details.
We value your input!
- Beta Testing: Join our program here.
- Issues: Report bugs or request features via GitHub Issues.
- Docs: Review
.kiro/specs/clean-architecture/.
Built with β€οΈ using Flutter and Clean Architecture







