Overview
Add a dedicated /dashboard/alerts route with a UI for creating, viewing, and deleting fee alert rules. Also add an in-app firing indicator that appears on the dashboard when an alert is currently active.
Route
/dashboard/alerts — alert management page
Acceptance Criteria
Route & Page
Create Alert Form
Active Alerts List
In-App Firing Indicator
Navigation
Type Shapes
export interface Alert {
id: string;
condition: 'ABOVE' | 'BELOW';
threshold: number;
metric: 'avg_fee' | 'base_fee' | 'max_fee';
email?: string;
active: boolean;
triggered: boolean;
created_at: string;
}
export interface CreateAlertInput {
condition: 'ABOVE' | 'BELOW';
threshold: number;
metric: 'avg_fee' | 'base_fee' | 'max_fee';
email?: string;
}
export interface FiringAlert extends Alert {
current_value: number;
}
Notes
- In-app alerts are the minimum delivery — email is handled entirely by the backend
- Related backend issues: schema/CRUD issue and checker/email issue
Overview
Add a dedicated
/dashboard/alertsroute with a UI for creating, viewing, and deleting fee alert rules. Also add an in-app firing indicator that appears on the dashboard when an alert is currently active.Route
/dashboard/alerts— alert management pageAcceptance Criteria
Route & Page
src/app/dashboard/alerts/page.tsxsrc/lib/api.ts:fetchAlerts(): Promise<Alert[]>createAlert(rule: CreateAlertInput): Promise<Alert>deleteAlert(id: string): Promise<void>fetchFiringAlerts(): Promise<FiringAlert[]>Alert,CreateAlertInput,FiringAlerttypes tosrc/lib/types.tsCreate Alert Form
avg_fee|base_fee|max_feeABOVE|BELOWCREATE ALERTActive Alerts List
In-App Firing Indicator
/dashboardpage, pollGET /api/alerts/statusevery 10s alongside existing polls⚡ ALERT: avg_fee is ABOVE 500 stroops — current value: 620 stroopsNavigation
ALERTSlink to the dashboard nav/sidebar with a red dot badge when alerts are firingType Shapes
Notes