docs(architecture): establish canonical architecture document (#609) - #669
Open
Ummi-001 wants to merge 131 commits into
Open
docs(architecture): establish canonical architecture document (#609)#669Ummi-001 wants to merge 131 commits into
Ummi-001 wants to merge 131 commits into
Conversation
Implemented the Api key Authentification Middleware
- Created new StreakCalendar.tsx component for displaying monthly streak tracking - Enhanced StreakDayIndicator.tsx to support missed days and improved streak highlighting - Implemented responsive calendar grid with month navigation - Added color status support: white for missed, yellow for claimed, fire icon for streak days - Added horizontal streak highlighting bar for consecutive streak days - Matches Figma design specifications with dark theme and brand colors
…ze-Limit Revert "Size limit"
…th-Middleware Revert "Implemented the Api key Authentification Middleware"
feat: Implement Streak Calendar Component with Monthly Grid View
Feat/versionioning
…at/perf Revert "Feat/perf"
…at/time Revert "Feat/time"
feat: Add reusable ShareOptionsSheet component and fix streak navigation
- Implement automated benchmarking system to measure latency overhead of each middleware individually - Create benchmark.ts script with load testing client for realistic performance measurement - Support benchmarking of JWT Auth, RBAC, Security Headers, Timeout, Circuit Breaker, and Correlation ID middleware - Add npm scripts: 'benchmark' and 'benchmark:ci' for running performance tests - Update PERFORMANCE.md with comprehensive benchmarking documentation and usage guide - Add benchmark integration tests to verify middleware initialization - Update package.json with autocannon (load testing) and ts-node dependencies - Update README.md with performance benchmarking section - Update tsconfig.json to include scripts directory - Export security middleware components for benchmarking All implementation confined to middleware repository as required.
PLUGIN SYSTEM IMPLEMENTATION
============================
Core Components:
- PluginInterface: Standard interface all plugins must implement
- PluginLoader: Low-level plugin discovery, loading, and lifecycle management
- PluginRegistry: High-level service for plugin management and orchestration
Key Features:
✓ Dynamic discovery of plugins from npm packages
✓ Plugin lifecycle management (load, init, activate, deactivate, unload, reload)
✓ Configuration validation with JSON Schema support
✓ Semantic version compatibility checking
✓ Dependency resolution between plugins
✓ Plugin priority-based execution ordering
✓ Plugin registry with search and filter capabilities
✓ Plugin context for access to shared services
✓ Comprehensive error handling with specific error types
✓ Plugin middleware export and utility export
✓ Plugin statistics and monitoring
Error Types:
- PluginNotFoundError
- PluginLoadError
- PluginAlreadyLoadedError
- PluginConfigError
- PluginDependencyError
- PluginVersionError
- PluginInitError
- PluginInactiveError
- InvalidPluginPackageError
- PluginResolutionError
Files Added:
- src/common/interfaces/plugin.interface.ts: Core plugin types and metadata
- src/common/interfaces/plugin.errors.ts: Custom error classes
- src/common/utils/plugin-loader.ts: PluginLoader service implementation
- src/common/utils/plugin-registry.ts: PluginRegistry service implementation
- src/plugins/example.plugin.ts: Example plugin template
- tests/integration/plugin-system.integration.spec.ts: Plugin system tests
- docs/PLUGINS.md: Complete plugin system documentation
- docs/PLUGIN_QUICKSTART.md: Quick start guide for plugin developers
Files Modified:
- package.json: Added semver, @types/semver dependencies
- src/index.ts: Export plugin system components
- src/common/interfaces/index.ts: Plugin interface exports
- src/common/utils/index.ts: Plugin utility exports
- README.md: Added plugin system overview and links
USAGE EXAMPLE:
==============
const registry = new PluginRegistry({ autoLoadEnabled: true });
await registry.init();
const plugin = await registry.load('@yourorg/plugin-example');
await registry.initialize(plugin.metadata.id);
await registry.activate(plugin.metadata.id);
PLUGIN DEVELOPMENT:
===================
1. Implement PluginInterface with metadata
2. Create package.json with mindblockPlugin configuration
3. Export plugin class/instance from main entry point
4. Publish to npm with scoped name (@yourorg/plugin-name)
5. Users can discover, load, and activate via PluginRegistry
All implementation confined to middleware repository as required.
…onfigurable verbosity, path filtering, and request ID correlation - Implemented RequestLoggerPlugin class implementing PluginInterface - Structured logging with request/response timing and status codes - Configurable log levels (debug, info, warn, error) - Path exclusion with glob pattern support - Request ID extraction/generation for correlation tracking - Sensitive header filtering (auth, cookies, API keys) - Color-coded terminal output (ANSI escape codes) - Runtime configuration API (setLogLevel, addExcludePaths, etc.) - Comprehensive 330+ line integration tests - Complete documentation in REQUEST-LOGGER.md (650+ lines) - Production-ready with error handling and best practices - Exported as first-party plugin from middleware package - Updated README.md with plugin overview - No backend modifications - middleware repository only
…y management for plugin lifecycle operations - Implemented LifecycleTimeoutManager service (400+ lines) - Configurable timeouts for all lifecycle hooks (onLoad, onInit, onActivate, etc.) - Four recovery strategies: RETRY, FAIL_FAST, GRACEFUL, ROLLBACK - Exponential backoff for automatic retries - Execution history and diagnostics tracking - Per-plugin configuration management - Error context recording with detailed diagnostics - Multiple plugins support with independent state - Execution statistics and health monitoring - Comprehensive 50+ test cases covering all scenarios - Production-ready error handling patterns - Complete documentation in LIFECYCLE-TIMEOUTS.md (500+ lines) - Environment-based configuration support - Performance < 2% overhead - Exported from middleware package root - No backend modifications - middleware repository only
…-onchain-provider Implement on-chain puzzle submission and retry mechanism
…at/submit-puzzle-onchain-provider Revert "Implement on-chain puzzle submission and retry mechanism"
Middleware Performance Benchmarks & External Plugin System
…at/Pre-Midleware Revert "Middleware Performance Benchmarks & External Plugin System"
…vert-434-feat/Pre-Midleware Revert "Revert "Middleware Performance Benchmarks & External Plugin System""
Complete Plugin System with Error Handling, Timeouts, and First-Party Plugins
…st-Party Plugins"
…at/Request Revert "Complete Plugin System with Error Handling, Timeouts, and First-Party Plugins"
…vert-437-revert-434-feat/Pre-Midleware Revert "Revert "Revert "Middleware Performance Benchmarks & External Plugin System"""
… validation - Add IPlugin interface with onInit/onDestroy hooks - Implement PluginManager for ordered plugin initialization - Support priority-based ordering (CRITICAL → HIGH → NORMAL → LOW) - Handle dependencies between plugins with circular dependency detection - Initialize plugins in registration order, destroy in reverse order - Add comprehensive unit tests for PluginManager - Export plugin system from common module Closes MindBlockLabs#35
- Implement PrometheusMetricsPlugin with three standard metrics: * http_requests_total (counter by method/route/status) * http_request_duration_seconds (histogram with p50/p95/p99 buckets) * http_errors_total (counter by error type) - Create MetricsMiddleware for easy integration - Add optional /metrics endpoint with Bearer token auth - Include Grafana dashboard JSON template - Support default Node.js metrics (CPU, memory, event loop) - Add custom labels support - Ensure low overhead (<0.5ms per request) - Add .env.example with configuration options - Update package.json with prom-client dependency Closes MindBlockLabs#36
- Create three Jest configurations: * jest.unit.config.ts (80% coverage thresholds) * jest.integration.config.ts (70% coverage, 10s timeout) * jest.e2e.config.ts (60% coverage, 30s timeout) - Add test utilities with typed mock factories: * mockRequest(), mockResponse(), mockNext() * createMiddlewareTestContext() * createTestApp() - boots in <1 second * createMockExecutionContext() * createTestRequest() for supertest integration - Update npm scripts: * npm run test:unit * npm run test:integration * npm run test:e2e * npm run test:*:cov variants - Add comprehensive tests/README.md with: * Test tier explanations * Usage examples * Best practices * Troubleshooting guide - Add supertest and @nestjs/testing dependencies Closes MindBlockLabs#41
- Add plugin-testing.utils.ts with test helpers: * createPluginTestContext() for unit testing without NestJS * testPluginLifecycle() for lifecycle validation * createMockPlugin() for creating mock plugins - Create comprehensive PLUGIN_DEVELOPMENT.md guide: * Step-by-step walkthrough for new contributors * Scaffold → Implement → Test → Publish workflow * Best practices and examples * Troubleshooting section - Create packages/plugin-starter/ npm package: * Working plugin scaffold with IPlugin implementation * Pre-configured package.json for publishing * Jest test setup with examples * README.md template with API documentation * tsconfig.json for TypeScript compilation - Export testing utilities from common module Closes MindBlockLabs#40
…stem-lifecycle-metrics-pdk Feature/plugin system lifecycle metrics pdk
|
@A6dulmalik is attempting to deploy a commit to the aminubabafatima8-gmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
@Ummi-001 too many conflicts and failed CI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #609
Summary
docs/ARCHITECTURE.md already existed but was missing several sections
required by this issue. This PR adds them, verified against the actual
backend code (not guessed):
signature login, guest sessions)
no minting/transfer is wired up yet — documented as such)
contract
exists in the repo currently
architecture (added AI Services and Blockchain module)
acceptance criteria