littlefish Core
littlefish_core is the foundational library for the LittleFish ecosystem. It provides core functionalities such as logging, monitoring, configuration management, and analytics, facilitating streamlined development for various applications.
Features
• Logging: Centralized logging mechanism to capture and handle log messages at various levels (debug, info, warning, error).
• Monitoring: Tools to monitor application performance and usage.
• Configuration Management: Manage and load application settings dynamically.
• Analytics: Custom event tracking and analytics services to gather insights on app usage.
Getting Started
Installation
To install littlefish_core, add it to your pubspec.yaml file:
dependencies: littlefish_core: latest_version
Then, run:
flutter pub get
Usage
- Logging
The DefaultLogger class in littlefish_core provides logging functionality for tracking messages at different levels: debug, info, warn, and error.
Example:
import 'package:littlefish_core/logging/default_logger.dart';
final logger = DefaultLogger();
// Log a debug message logger.debug(this, 'Debug message');
// Log an error with additional info logger.error(this, 'Error occurred', error: 'Error details', stackTrace: StackTrace.current);
• debug(), info(), warn(), and error() methods allow detailed logging of app behavior.
• Supports extra data and stack traces for easier debugging.
- Configuration Management
The ConfigService class allows for dynamic configuration management. You can load configuration settings at runtime and retrieve various values like booleans or strings.
Example:
import 'package:littlefish_core/configuration/config_service.dart';
final configService = ConfigService();
// Initialize configuration await configService.initialise(settings: ConfigSettings(filePath: 'config.json'));
// Retrieve a boolean value bool isFeatureEnabled = configService.getBoolValue(key: 'feature_enabled', defaultValue: false);
// Retrieve a string value String apiUrl = configService.getStringValue(key: 'api_url');
• initialise() method loads configuration settings.
• getBoolValue() and getStringValue() provide easy access to configuration data.
- Monitoring
The monitoring module provides tools to track and monitor app performance, including custom events, error reports, and general health metrics. This module helps developers stay informed about app health and performance.
Usage of monitoring services depends on custom implementation, typically using models and services that you can extend to suit your application’s needs.
- Analytics
The AnalyticsService class is used to track and log custom events within your application, helping gather insights into user interactions and behaviors.
Example:
import 'package:littlefish_core/analytics/services/analytics_service.dart';
final analyticsService = AnalyticsService();
// Log a custom event analyticsService.logEvent('user_signup', parameters: { 'method': 'email', 'time': DateTime.now().toString(), });
• logEvent() is used to log custom events along with parameters (e.g., user actions, signup methods).
• Supports additional metadata for enhanced tracking.
Core Modules
• Core: Contains the base utilities and shared functionality for littlefish_core.
• Logging: Provides customizable logging services to track app behavior and issues.
• Configuration: Handles the dynamic management of configuration settings, making it easy to adjust app behavior without redeploying.
• Monitoring: Enables performance monitoring and error tracking for ensuring app reliability.
• Analytics: Tracks custom events for deeper insights into user activity.
Testing
To run tests for the littlefish_core package, use:
flutter test
Contributing
We welcome contributions! To contribute, follow these steps:
1. Fork the repository.
2. Create a new branch (git checkout -b feature/your-feature).
3. Commit your changes (git commit -m 'Add some feature').
4. Push to the branch (git push origin feature/your-feature).
5. Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
This README provides a more comprehensive overview of each feature and shows how to work with the logging, configuration, monitoring, and analytics functionalities. Let me know if you need further refinement! 
Libraries
- analytics/models/analytics_event
- analytics/models/analytics_settings
- analytics/services/analytics_service
- audit/audit_service
- auth/models/auth_business_credential
- auth/models/auth_settings
- auth/models/auth_user
- auth/services/auth_service
- configuration/config_service
- configuration/config_settings
- core/littlefish_core
- core/models/app_settings
- data/data_collection
- data/database_client
- data/database_settings
- data/database_statistic
- intent/intent_manager_service
- intent/models/intent_action
- logging/default_logger
- logging/models/logger_settings
- logging/services/logger_service
- monitoring/models/monitoring_http_metric
- monitoring/models/monitoring_settings
- monitoring/models/monitoring_trace
- monitoring/services/monitoring_service
- notifications/models/notification_event
- notifications/models/notification_service
- notifications/models/notification_settings
- notifications/notification_manager
- notifications/services/async_notification_service
- notifications/services/real_time_notification_service
- observability/models/managed_exception
- observability/observability_service
- observability/observability_settings
- payments/models/terminal_info
- payments/services/order_service
- payments/services/payment_service
- payments/services/terminal_service
- reports/models/report
- reports/models/report_settings
- reports/report_client
- terminal_management/models/terminal
- terminal_management/models/terminal_user
- terminal_management/terminal_manager_service
- terminal_management/terminal_manager_settings
- utils/extensions
- utils/littlefish_http_client