# feat: implement security monitoring and operational metrics dashboard#677
Open
saidai-bhuvanesh wants to merge 8 commits into
Open
# feat: implement security monitoring and operational metrics dashboard#677saidai-bhuvanesh wants to merge 8 commits into
saidai-bhuvanesh wants to merge 8 commits into
Conversation
added 8 commits
June 5, 2026 12:31
|
Someone is attempting to deploy a commit to the adithyansubramani1-1657's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
This PR introduces a production-grade security monitoring and operational metrics system for Brownie-Bliss. The implementation provides centralized observability, security event tracking, API performance monitoring, and operational health reporting to help administrators detect abuse, investigate incidents, and monitor system performance in real time.
Problem Statement
Prior to this implementation:
Changes Implemented
Security Event Tracking
Introduced a dedicated
SecurityEventmodel to capture and retain critical security-related activities:Security events are automatically retained for 90 days using TTL indexes and cleaned up without manual intervention.
API Performance Monitoring
Introduced an
ApiMetricmodel to collect:Metrics automatically expire after 24 hours to prevent database growth.
Centralized Metrics Service
Created a reusable
metricsService.jsresponsible for:The service operates asynchronously to avoid impacting user-facing requests.
Global Monitoring Middleware
Implemented
monitoringMiddleware.jswhich:Security Instrumentation
Added monitoring hooks across critical workflows:
Authentication
OTP Security
Order Processing
Infrastructure
Admin Monitoring Dashboard
Added a protected endpoint:
GET /api/admin/monitoring/dashboard
Provides:
Access is restricted through existing admin authentication middleware.
Files Added
Models
SecurityEvent.jsApiMetric.jsServices
metricsService.jsMiddleware
monitoringMiddleware.jsControllers
monitoringController.jsFiles Updated
Authentication
adminController.jsRate Limiting
rateLimiters.jsOTP Workflows
otpController.jsOrder Processing
orderController.jsEmail Reliability
mailer.jsRouting
adminRoutes.jsApplication Bootstrap
index.jsTesting
Automated Coverage
Added integration tests covering:
Results
Benefits
Security
Reliability
Performance
Impact
This implementation significantly improves operational awareness, security visibility, and production monitoring capabilities while maintaining low performance overhead and full backward compatibility.