Alarms system: DB schema, RPC endpoints, dashboard UI & uptime integration#294
Alarms system: DB schema, RPC endpoints, dashboard UI & uptime integration#294samuel-asleep wants to merge 3 commits intodatabuddy-analytics:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@samuel-asleep is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
Greptile OverviewGreptile SummaryThis PR implements a comprehensive alarm and notification system for Databuddy, integrating uptime monitoring with multi-channel alerts. The implementation includes database schema with three tables ( Key Changes
ArchitectureThe alarm system follows a clean separation of concerns:
The implementation correctly addresses the previous schema concerns by using composite keys and proper conflict resolution in upserts. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Dashboard
participant RPC
participant DB
participant Uptime
participant Alarms
participant Notify
Note over User,Dashboard: Alarm Configuration
User->>Dashboard: Create/Edit Alarm
Dashboard->>RPC: alarms.create/update
RPC->>DB: Insert/Update alarms table
DB-->>RPC: Alarm record
RPC-->>Dashboard: Success
Dashboard->>RPC: Assign alarm to website
RPC->>DB: Update alarm.websiteId
DB-->>Dashboard: Alarm assigned
Note over Uptime,Notify: Uptime Monitoring & Alarm Processing
Uptime->>Uptime: Execute scheduled check
Uptime->>DB: Query uptime_schedules
DB-->>Uptime: Schedule data
Uptime->>Uptime: Perform HTTP check
Uptime->>Alarms: processUptimeAlarms(uptimeData, websiteId)
Alarms->>DB: Fetch enabled alarms for website
DB-->>Alarms: Active alarms list
Alarms->>DB: Fetch alarm_state for alarms
DB-->>Alarms: Previous state records
Alarms->>Alarms: evaluateAlarmState(previous, isDown, threshold)
alt Threshold reached (first down notification)
Alarms->>DB: Upsert alarm_state (status=down)
Alarms->>Notify: sendNotifications(alarm, downPayload)
Notify->>Notify: Send via Slack/Discord/Email/Webhook
Notify-->>Alarms: Results
Alarms->>DB: Insert alarm_trigger_history
else Site recovered (up notification)
Alarms->>DB: Upsert alarm_state (status=up, reset counters)
Alarms->>Notify: sendNotifications(alarm, upPayload)
Notify->>Notify: Send via configured channels
Notify-->>Alarms: Results
Alarms->>DB: Insert alarm_trigger_history
else Still down but not notifying
Alarms->>DB: Upsert alarm_state (increment failures)
end
Alarms-->>Uptime: Processing complete
Uptime->>DB: Store uptime result
|
0115dcc to
80b8a36
Compare
|
@izadoesdev can you please review my pr |
|
@greptile review |
|
I'm gonna go ahead and assume this is slop-coded since there's a few critical issues (as mentioned by Greptile) and you haven't disclosed it which violates our AI Usage policy, which is a first strike Also, you provided a screenshot of the login page rather than the actual changes made??? I don't understand what you expect me to do with this review |
|
@izadoesdev Thanks for pointing this out — that’s on me. I should have clearly disclosed AI assistance up front, and I’ll update the PR description immediately to fully comply with the AI usage policy. I’ll also replace the screenshot with concrete diffs / screenshots of the actual changes so the review is actionable. Sorry for the confusion here — I’ll fix these items now so the PR can be reviewed properly. |
|
@izadoesdev I’ve updated the PR description to include an explicit AI usage disclosure and added screenshots that directly show the implemented alarms UI on the Notifications page. Please let me know if you’d like me to adjust anything further or add more reviewable context. |
0377437 to
3a32e66
Compare
|
@izadoesdev can you please review my pr |
|
@izadoesdev is there any more changes you need me to make ? |
|
This looks very vibe-coded and low quality, the design does not at all match our designs / other pages, it uses database migrations despite us not using them beforehand, it just does not match the quality we're looking for |
Summary
This PR implements a complete alarms/notifications system for Databuddy, covering both #267 (Alarms System) and #268 (Uptime Monitoring Alarm Integration).
It provides end-to-end support for defining alarms, assigning them to websites, and triggering notifications based on uptime state changes, with coordinated backend processing and dashboard UI.
What’s included
Alarm / Notification System
(
apps/dashboard/app/(main)/settings/notifications/page.tsx)Website alarm assignment
Backend alarm processing
alarms-runtime.tsDependencies
Screenshots
Homepage (login/signup page)
Alarm shown on Notifications page
Testing
AI Disclosure
This PR was created with AI-assisted tooling in a strict human-in-the-loop workflow.
All final implementation decisions, validation, and testing were performed manually.
Notes
Claims
/claim #268
/claim #267
Checklist