ServPulse/Domain: Difference between revisions

From Nasqueron Agora
Ieli (talk | contribs)
No edit summary
Ieli (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
:'''Database table:''' service
:'''Database table:''' service


;Metrics
;Metric
:This concept represents the performance metrics or indicators being measured for each component, such as uptime, response time, error rates, and other relevant metrics.
:Performance data recorded per service, either by the health check service (automatic) or via the API (manual).
:'''Attributes:''' name, value, unit, timestamp.
:'''Attributes:''' service_id, uptime (decimal 0-100), response_time (integer, ms), error_rate (decimal 0-100), recorded_at.
:'''Database table:''' metric (indexed on service_id + recorded_at)
:'''Endpoint:''' GET /api/metrics (latest per service), GET /api/metrics/service/:id?days=30 (raw), GET /api/metrics/service/:id/daily?days=30 (aggregated)


;Incidents
;Incident
:An outage, disruption, or degradation reported on the status page. Incidents follow a lifecycle and can affect multiple services.
:An outage, disruption, or degradation reported on the status page. Incidents follow a lifecycle and can affect multiple services.
:'''Attributes:''' title, status (investigating, identified, monitoring, resolved), impact (none, minor, major, critical), start_date, update_date, end_date.
:'''Attributes:''' title, status (investigating, identified, monitoring, resolved), impact (none, minor, major, critical), start_date, update_date, end_date.
Line 23: Line 25:
:A timestamped status change within an incident, forming the incident timeline.
:A timestamped status change within an incident, forming the incident timeline.
:'''Attributes:''' incident_id, status, message.
:'''Attributes:''' incident_id, status, message.
:'''Database tables:''' incident_update
:'''Database table:''' incident_update


;Users
;Authentication
:Admin access is controlled by JWT tokens signed with JWT_SECRET. There is no user table, no user accounts, and no permissions system. A single admin role exists. Tokens are generated via CLI and pasted into the login page.
:Admin access is controlled by JWT tokens signed with JWT_SECRET. There is no user table, no user accounts, and no permissions system. A single admin role exists. Tokens are generated via CLI and pasted into the login page.
:'''Token payload:''' { role: 'admin' }
:'''Token payload:''' { role: 'admin' }
:'''Endpoint:''' POST /api/auth/verify
:'''Endpoint:''' POST /api/auth/verify
;Maintenance
:A scheduled maintenance window that can affect multiple services.
:'''Attributes:''' title, description, scheduled_start, scheduled_end, status (scheduled, in_progress, completed).
:'''Database tables:''' maintenance, maintenance_service
;Subscriber
:A user subscribed to status update notifications, either by email or webhook. Email subscribers must confirm via a token link before receiving notifications.
:'''Attributes:''' email (or webhook_url), type (email, webhook), confirmed, confirm_token, unsubscribe_token.
:'''Database table:''' subscriber (with partial unique indexes on email and webhook_url)
;Group
:A label used to visually organize services on the status page. Stored as a string field on the service table (not a separate entity). Services with the same group value are displayed together under a shared heading. Services without a group appear under "Uncategorized".

Latest revision as of 15:37, 17 February 2026

Lexicon

Configuration
Application-level settings stored in config/app.json and served via the config API.
Attributes: navbar.title, navbar.buttons_left (array of {name, link}), footer.line1 (text with %link1%/%link2% placeholders, labels, URLs), footer.line2 (text with %link% placeholder, label, URL).
Endpoint: GET /api/config/getAll (public), PUT /api/config (admin)
Service
A monitored entity on the status page (server, application, database, API, etc.). Services can be grouped and ordered.
Attributes: name, group, description, url, auto_status, status (operational, degraded, partial, major, maintenance), order.
Database table: service
Metric
Performance data recorded per service, either by the health check service (automatic) or via the API (manual).
Attributes: service_id, uptime (decimal 0-100), response_time (integer, ms), error_rate (decimal 0-100), recorded_at.
Database table: metric (indexed on service_id + recorded_at)
Endpoint: GET /api/metrics (latest per service), GET /api/metrics/service/:id?days=30 (raw), GET /api/metrics/service/:id/daily?days=30 (aggregated)
Incident
An outage, disruption, or degradation reported on the status page. Incidents follow a lifecycle and can affect multiple services.
Attributes: title, status (investigating, identified, monitoring, resolved), impact (none, minor, major, critical), start_date, update_date, end_date.
Database tables: incident, incident_update, incident_service
Incident Update
A timestamped status change within an incident, forming the incident timeline.
Attributes: incident_id, status, message.
Database table: incident_update
Authentication
Admin access is controlled by JWT tokens signed with JWT_SECRET. There is no user table, no user accounts, and no permissions system. A single admin role exists. Tokens are generated via CLI and pasted into the login page.
Token payload: { role: 'admin' }
Endpoint: POST /api/auth/verify
Maintenance
A scheduled maintenance window that can affect multiple services.
Attributes: title, description, scheduled_start, scheduled_end, status (scheduled, in_progress, completed).
Database tables: maintenance, maintenance_service
Subscriber
A user subscribed to status update notifications, either by email or webhook. Email subscribers must confirm via a token link before receiving notifications.
Attributes: email (or webhook_url), type (email, webhook), confirmed, confirm_token, unsubscribe_token.
Database table: subscriber (with partial unique indexes on email and webhook_url)
Group
A label used to visually organize services on the status page. Stored as a string field on the service table (not a separate entity). Services with the same group value are displayed together under a shared heading. Services without a group appear under "Uncategorized".