How yelmuratoff/ispect works
Project Type and Purpose
• Monorepo of modular Dart/Flutter packages
• Purpose: provide an in-app debug panel (ISpect) + logging backbone (ISpectify) + adapters for HTTP, Dio, WebSocket, DB, BLoC, Jira + example apps + CLI tooling + automation scripts
• Consumers: Flutter app developers who integrate these packages into their applications for debugging, monitoring, and reporting
File Structure
Top‐level directories:
• .github/workflows → CI/CD pipelines for publishing and version sync
• bash → release & pre-commit scripts (version bump, changelog, dependency checks)
• docs, licences → documentation and license artifacts
• packages/… → individual Dart/Flutter packages (ispect, ispectify, ispectify_dio, …, ispect_jira)
• readme_generator → CLI tool to auto‐generate README files per package
• web_logs_viewer → standalone Flutter web app to view JSON logs
Patterns:
• Each package follows lib/src/common, core, features, presentation, services, test
• Modular layering: common utilities, domain models, feature slices
README for Additional Insights
• “Architecture” section calls out each package’s role
• Core panel (ispect), logging backbone (ispectify), adapters (ispectify_*)
• Integration flow: wrap your app in ISpectBuilder, attach interceptors/observers
Main Components
A. Host Application (Flutter App)
– Entry point: main.dart
– Wraps MaterialApp in ISpect.run & ISpectBuilder
B. Core Panel Module (packages/ispect)
– UI layer: panel, cards, dialogs, widget tree inspector
– Controllers & services for logs, performance, device info
C. Logging Backbone (packages/ispectify)
– Produces log events, history storage, console forwarding
– Filter, redaction, formatting utilities
D. Adapters / Integrations
– HTTP: ispectify_http (http package interceptor)
– Dio: ispectify_dio (Dio interceptor)
– WebSocket: ispectify_ws
– Database: ispectify_db (sqflite wrapper)
– BLoC: ispectify_bloc (BlocObserver)
– Jira: ispect_jira (CUBIT + JiraClient + UI to send issues)
E. Storage & History
– In-memory/event stream + optional file history (daily_file_history)
F. Example Apps
– Flutter example under each package → demonstrate usage patterns
– web_logs_viewer: standalone web app visualizing JSON logs
G. Tooling & Pipelines
– readme_generator: Dart CLI to scaffold/update READMEs
– bash scripts: version bump, changelog, pre-commit hooks
– GitHub Actions: deploy, sync versions, validate versions
Relationships & Data Flows
• Host App → ISpect.run
• onInit callback → attach interceptors to HTTP/Dio/WS/DB clients + set Bloc.observer
• Adapters intercept traffic/events → forward to ISpectify logger
• ISpectify logger → stores events → exposes event stream
• ISpect panel controllers subscribe → render UI widgets in overlay
• Optionally: ISpectify logger writes to file (daily_file_history)
• readme_generator and bash pipelines operate offline on packages → update docs & version files
Architectural Patterns & Principles
• Modular Monorepo: each package independently versioned & published
• Layered Architecture: common → core → features → presentation
• Adapter / Strategy Pattern: interceptors for different protocols
• Observer Pattern: event streams for real-time UI updates
• Flag-driven Initialization: tree-shaken in production builds
• Separation of Concerns: logging backbone vs UI vs integration