Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Ring Oracle
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Profile Account Widgets
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Vertical Presets (SSOT)
    Ringization playbook
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel Deployment
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Ring Oracle
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Profile Account Widgets
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Vertical Presets (SSOT)
    Ringization playbook
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel Deployment
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Ring Oracle
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Profile Account Widgets
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Vertical Presets (SSOT)
    Ringization playbook
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel Deployment
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    Ring Platform Logo

    Loading documentation...

    Preparing Ring Platform content

    Ring Platform Logo

    Loading documentation...

    Preparing Ring Platform content

    Ring Platform Logo

    Loading documentation...

    Preparing Ring Platform content

    Monitoring & Analytics

    Filter with Founder / Developer in the docs sidebar. Monitoring truth lives in app/api/health, app/api/analytics/*, lib/logger.ts, public/scripts/analytics.js + RingAnalyticsBeacon, and the admin analytics UI. No separate features/analytics doc page — this article is the ring-wide analytics overview.

    Ring Platform ships first-party telemetry into PostgreSQL JSONB tables, a container-friendly health endpoint, and structured server logs. External APM (Sentry, Vercel Analytics) is optional via env vars — not required for core operation.

    Monitoring layers (what actually exists)

    LayerMechanismPrimary signal
    LivenessGET /api/health (+ HEAD)Process up, env warnings, memory
    UX performanceWebVitalsProvider → POST /api/analytics/web-vitalsLCP, CLS, INP, TTFB, FCP
    Product eventsanalytics.js + RingAnalyticsBeacon → POST /api/analytics/appSessions, page loads, custom events (analytics_events)
    Personal profilesrecordPersonalPageView → personal_page_viewUnique visits 24h/7d by role on /{username}
    Client errorsPOST /api/analytics/errorsStack traces, component, severity
    Admin dashboard/admin/analyticsgetPlatformAnalytics() incl. personalPages
    Realtime connectivity/api/tunnel/ping, /api/tunnel/heartbeatTunnel latency / session health
    Server logslib/logger.tsJSON lines to stdout (LOG_LEVEL)
    Optional infraDocker profile monitoringPrometheus + Grafana (local dev only)

    Why operators should monitor

    A Ring clone combines auth, marketplace data, payments, and realtime notifications. Silent failure shows up as “the site loads but orders don’t sync” — not as a red error page. Personal-page unique visits tell you whether member trust faces are getting traffic without counting owners refreshing their own pages.

    What to watch without reading code

    Health endpoint

    Probe GET /api/health from your load balancer or uptime checker — 503 means degraded (often missing AUTH_SECRET).

    Admin analytics

    Admin → Analytics for user counts, Web Vitals medians, recent client errors, and personalPages (top profiles + role buckets).

    Public profiles

    Architecture

    First-party analytics ingest

    Health check — app/api/health/route.ts

    Returns JSON: status (healthy | degraded | unhealthy), uptime, memory, inferred services.database (postgresql vs firebase), optional Docker container block. Missing AUTH_SECRET → degraded + HTTP 503.

    Client beacon (verified)

    PiecePath
    Scriptpublic/scripts/analytics.js — batches to POST /api/analytics/app via sendBeacon / fetch; exposes window.ringAnalytics
    App Router gluecomponents/providers/ring-analytics-beacon.tsx — loads the script; calls pageView on pathname/searchParams change (hard load alone is not enough)
    Mountcomponents/providers/app-client-shell.tsx

    Legacy exists in tree but is the mounted SSOT — do not document it as live.

    Related documentation

    Related documentation

    Public Profile Pages

    Same-workflow: personal_page_view unique visit stats and owner skip.

    Backup & Recovery

    Next-step: restore after incidents detected here.

    Performance Optimization

    See-also: Web Vitals tuning and performance ops.

    Environment Configuration

    Depends-on: CRON_SECRET, LOG_LEVEL, ANALYTICS_DISABLE_STORAGE, optional Sentry.

    Real Time

    Monitoring & Analytics

    Filter with Founder / Developer in the docs sidebar. Monitoring truth lives in app/api/health, app/api/analytics/*, lib/logger.ts, public/scripts/analytics.js + RingAnalyticsBeacon, and the admin analytics UI. No separate features/analytics doc page — this article is the ring-wide analytics overview.

    Ring Platform ships first-party telemetry into PostgreSQL JSONB tables, a container-friendly health endpoint, and structured server logs. External APM (Sentry, Vercel Analytics) is optional via env vars — not required for core operation.

    Monitoring layers (what actually exists)

    LayerMechanismPrimary signal
    LivenessGET /api/health (+ HEAD)Process up, env warnings, memory
    UX performanceWebVitalsProvider → POST /api/analytics/web-vitalsLCP, CLS, INP, TTFB, FCP
    Product eventsanalytics.js + RingAnalyticsBeacon → POST /api/analytics/appSessions, page loads, custom events (analytics_events)
    Personal profilesrecordPersonalPageView → personal_page_viewUnique visits 24h/7d by role on /{username}
    Client errorsPOST /api/analytics/errorsStack traces, component, severity
    Admin dashboard/admin/analyticsgetPlatformAnalytics() incl. personalPages
    Realtime connectivity/api/tunnel/ping, /api/tunnel/heartbeatTunnel latency / session health
    Server logslib/logger.tsJSON lines to stdout (LOG_LEVEL)
    Optional infraDocker profile monitoringPrometheus + Grafana (local dev only)

    Why operators should monitor

    A Ring clone combines auth, marketplace data, payments, and realtime notifications. Silent failure shows up as “the site loads but orders don’t sync” — not as a red error page. Personal-page unique visits tell you whether member trust faces are getting traffic without counting owners refreshing their own pages.

    What to watch without reading code

    Health endpoint

    Probe GET /api/health from your load balancer or uptime checker — 503 means degraded (often missing AUTH_SECRET).

    Admin analytics

    Admin → Analytics for user counts, Web Vitals medians, recent client errors, and personalPages (top profiles + role buckets).

    Public profiles

    Architecture

    First-party analytics ingest

    Health check — app/api/health/route.ts

    Returns JSON: status (healthy | degraded | unhealthy), uptime, memory, inferred services.database (postgresql vs firebase), optional Docker container block. Missing AUTH_SECRET → degraded + HTTP 503.

    Client beacon (verified)

    PiecePath
    Scriptpublic/scripts/analytics.js — batches to POST /api/analytics/app via sendBeacon / fetch; exposes window.ringAnalytics
    App Router gluecomponents/providers/ring-analytics-beacon.tsx — loads the script; calls pageView on pathname/searchParams change (hard load alone is not enough)
    Mountcomponents/providers/app-client-shell.tsx

    Legacy exists in tree but is the mounted SSOT — do not document it as live.

    Related documentation

    Related documentation

    Public Profile Pages

    Same-workflow: personal_page_view unique visit stats and owner skip.

    Backup & Recovery

    Next-step: restore after incidents detected here.

    Performance Optimization

    See-also: Web Vitals tuning and performance ops.

    Environment Configuration

    Depends-on: CRON_SECRET, LOG_LEVEL, ANALYTICS_DISABLE_STORAGE, optional Sentry.

    Real Time

    Monitoring & Analytics

    Filter with Founder / Developer in the docs sidebar. Monitoring truth lives in app/api/health, app/api/analytics/*, lib/logger.ts, public/scripts/analytics.js + RingAnalyticsBeacon, and the admin analytics UI. No separate features/analytics doc page — this article is the ring-wide analytics overview.

    Ring Platform ships first-party telemetry into PostgreSQL JSONB tables, a container-friendly health endpoint, and structured server logs. External APM (Sentry, Vercel Analytics) is optional via env vars — not required for core operation.

    Monitoring layers (what actually exists)

    LayerMechanismPrimary signal
    LivenessGET /api/health (+ HEAD)Process up, env warnings, memory
    UX performanceWebVitalsProvider → POST /api/analytics/web-vitalsLCP, CLS, INP, TTFB, FCP
    Product eventsanalytics.js + RingAnalyticsBeacon → POST /api/analytics/appSessions, page loads, custom events (analytics_events)
    Personal profilesrecordPersonalPageView → personal_page_viewUnique visits 24h/7d by role on /{username}
    Client errorsPOST /api/analytics/errorsStack traces, component, severity
    Admin dashboard/admin/analyticsgetPlatformAnalytics() incl. personalPages
    Realtime connectivity/api/tunnel/ping, /api/tunnel/heartbeatTunnel latency / session health
    Server logslib/logger.tsJSON lines to stdout (LOG_LEVEL)
    Optional infraDocker profile monitoringPrometheus + Grafana (local dev only)

    Why operators should monitor

    A Ring clone combines auth, marketplace data, payments, and realtime notifications. Silent failure shows up as “the site loads but orders don’t sync” — not as a red error page. Personal-page unique visits tell you whether member trust faces are getting traffic without counting owners refreshing their own pages.

    What to watch without reading code

    Health endpoint

    Probe GET /api/health from your load balancer or uptime checker — 503 means degraded (often missing AUTH_SECRET).

    Admin analytics

    Admin → Analytics for user counts, Web Vitals medians, recent client errors, and personalPages (top profiles + role buckets).

    Public profiles

    Architecture

    First-party analytics ingest

    Health check — app/api/health/route.ts

    Returns JSON: status (healthy | degraded | unhealthy), uptime, memory, inferred services.database (postgresql vs firebase), optional Docker container block. Missing AUTH_SECRET → degraded + HTTP 503.

    Client beacon (verified)

    PiecePath
    Scriptpublic/scripts/analytics.js — batches to POST /api/analytics/app via sendBeacon / fetch; exposes window.ringAnalytics
    App Router gluecomponents/providers/ring-analytics-beacon.tsx — loads the script; calls pageView on pathname/searchParams change (hard load alone is not enough)
    Mountcomponents/providers/app-client-shell.tsx

    Legacy exists in tree but is the mounted SSOT — do not document it as live.

    Related documentation

    Related documentation

    Public Profile Pages

    Same-workflow: personal_page_view unique visit stats and owner skip.

    Backup & Recovery

    Next-step: restore after incidents detected here.

    Performance Optimization

    See-also: Web Vitals tuning and performance ops.

    Environment Configuration

    Depends-on: CRON_SECRET, LOG_LEVEL, ANALYTICS_DISABLE_STORAGE, optional Sentry.

    Real Time

    Owners see unique 24h/7d visit stats on their personal page widget.

    Backup correlation

    Monitoring tells you when things broke; backups tell you what you can restore.

    Typical alert scenarios

    • Health flips to degraded — missing critical env after deploy; check secrets before blaming Postgres.
    • Web Vitals poor ratings climb — CDN, image weight, or SSR regression; correlate with a release tag (BUILD_DATE / GIT_COMMIT on health JSON when set).
    • Spike in analytics_errors — broken client bundle or third-party script; admin dashboard lists recent messages.
    • Tunnel disconnect storms — see Realtime transport; often edge/WSS config, not database.

    Define who gets paged (operator vs developer) and what “down” means for your clone — Ring OSS does not ship PagerDuty wiring; you attach health checks to your provider.

    public/scripts/app-analytics.js
    not

    Analytics API surface

    RouteMethodAuthPersists to
    /api/analytics/web-vitalsPOSTOptional sessionweb_vitals
    /api/analytics/web-vitalsGETAdminQuery web_vitals or ?scope=platform summary
    /api/analytics/appPOSTOptional sessionanalytics_events
    /api/analytics/errorsPOSTOptional sessionanalytics_errors
    /api/analytics/errorsGETAdminList errors
    /api/analytics/devicePOSTSession requireduser_device_telemetry
    /api/analytics/platform-statsGETAdminCounts: users, entities, opportunities

    Implementation: features/analytics/lib/analytics-db.ts (insertAnalyticsEventBatch). Client Web Vitals: lib/web-vitals.tsx (INP replaces FID).

    Personal page events

    PiecePath
    Event typepersonal_page_view
    Writerfeatures/analytics/lib/personal-page-analytics.ts → recordPersonalPageView
    Call siteapp/[locale]/[username]/page.tsx — skips owners
    Owner widgetgetPersonalPageViewStats (features/auth/services/personal-page-stats.ts)
    AdmingetPersonalPagePlatformStats → PlatformAnalyticsSummary.personalPages
    Engagementpersonal_page_view joins docs_page_view / page_view / app_load in admin pageViews aggregates

    Details and unique-by-role math: Public Profile Pages.

    Database tables

    Included in data/schema.sql and migration 017_ring_analytics_schema.sql:

    • analytics_events — batched client telemetry and server personal_page_view rows
    • web_vitals — Core Web Vitals batches
    • analytics_errors — client-side error log

    Disable storage (privacy / load testing)

    When set, ingest routes acknowledge payloads but skip DatabaseService writes (isAnalyticsStorageDisabled()). Personal-page recorder also no-ops.

    Structured logging

    Env: LOG_LEVEL (debug | info | warn | error, default info in production), LOG_SILENT=true to mute.

    Optional external APM

    Commented/optional in env.local.template / docker.env.template:

    • SENTRY_DSN — wire via your Sentry Next.js integration (not auto-enabled in repo)
    • NEXT_PUBLIC_ANALYTICS_ID, VERCEL_ANALYTICS_ID — Vercel-hosted clones only

    Realtime probes

    RoutePurpose
    POST /api/tunnel/pingAuthenticated pong + timestamp
    POST /api/tunnel/heartbeatConnection keep-alive

    See Tunnel protocol.

    Cron / pipeline monitoring

    Cron routes (/api/cron/*) fail closed without CRON_SECRET. Example: GET /api/cron/email-analytics runs ProcessConductor pipeline email-analytics.

    Optional Docker Prometheus + Grafana

    Services: ring-prometheus (:9090), ring-grafana (:3001). Config: docker/prometheus/prometheus.yml.

    Prometheus config caveat

    The bundled Prometheus job references /api/metrics, which is not implemented in this tree, and scrapes /api/health as JSON (not Prometheus exposition format). Treat the profile as a starting scaffold.

    Admin UI entrypoint

    Server page: app/[locale]/admin/analytics/page.tsx — requires isPlatformAdmin, loads getPlatformAnalytics('7d') including personalPages.

    Deep-dive: tunnel transports and heartbeat behavior.

    Admin console

    Next-step: Admin console entry for /admin/analytics.

    Owners see unique 24h/7d visit stats on their personal page widget.

    Backup correlation

    Monitoring tells you when things broke; backups tell you what you can restore.

    Typical alert scenarios

    • Health flips to degraded — missing critical env after deploy; check secrets before blaming Postgres.
    • Web Vitals poor ratings climb — CDN, image weight, or SSR regression; correlate with a release tag (BUILD_DATE / GIT_COMMIT on health JSON when set).
    • Spike in analytics_errors — broken client bundle or third-party script; admin dashboard lists recent messages.
    • Tunnel disconnect storms — see Realtime transport; often edge/WSS config, not database.

    Define who gets paged (operator vs developer) and what “down” means for your clone — Ring OSS does not ship PagerDuty wiring; you attach health checks to your provider.

    public/scripts/app-analytics.js
    not

    Analytics API surface

    RouteMethodAuthPersists to
    /api/analytics/web-vitalsPOSTOptional sessionweb_vitals
    /api/analytics/web-vitalsGETAdminQuery web_vitals or ?scope=platform summary
    /api/analytics/appPOSTOptional sessionanalytics_events
    /api/analytics/errorsPOSTOptional sessionanalytics_errors
    /api/analytics/errorsGETAdminList errors
    /api/analytics/devicePOSTSession requireduser_device_telemetry
    /api/analytics/platform-statsGETAdminCounts: users, entities, opportunities

    Implementation: features/analytics/lib/analytics-db.ts (insertAnalyticsEventBatch). Client Web Vitals: lib/web-vitals.tsx (INP replaces FID).

    Personal page events

    PiecePath
    Event typepersonal_page_view
    Writerfeatures/analytics/lib/personal-page-analytics.ts → recordPersonalPageView
    Call siteapp/[locale]/[username]/page.tsx — skips owners
    Owner widgetgetPersonalPageViewStats (features/auth/services/personal-page-stats.ts)
    AdmingetPersonalPagePlatformStats → PlatformAnalyticsSummary.personalPages
    Engagementpersonal_page_view joins docs_page_view / page_view / app_load in admin pageViews aggregates

    Details and unique-by-role math: Public Profile Pages.

    Database tables

    Included in data/schema.sql and migration 017_ring_analytics_schema.sql:

    • analytics_events — batched client telemetry and server personal_page_view rows
    • web_vitals — Core Web Vitals batches
    • analytics_errors — client-side error log

    Disable storage (privacy / load testing)

    When set, ingest routes acknowledge payloads but skip DatabaseService writes (isAnalyticsStorageDisabled()). Personal-page recorder also no-ops.

    Structured logging

    Env: LOG_LEVEL (debug | info | warn | error, default info in production), LOG_SILENT=true to mute.

    Optional external APM

    Commented/optional in env.local.template / docker.env.template:

    • SENTRY_DSN — wire via your Sentry Next.js integration (not auto-enabled in repo)
    • NEXT_PUBLIC_ANALYTICS_ID, VERCEL_ANALYTICS_ID — Vercel-hosted clones only

    Realtime probes

    RoutePurpose
    POST /api/tunnel/pingAuthenticated pong + timestamp
    POST /api/tunnel/heartbeatConnection keep-alive

    See Tunnel protocol.

    Cron / pipeline monitoring

    Cron routes (/api/cron/*) fail closed without CRON_SECRET. Example: GET /api/cron/email-analytics runs ProcessConductor pipeline email-analytics.

    Optional Docker Prometheus + Grafana

    Services: ring-prometheus (:9090), ring-grafana (:3001). Config: docker/prometheus/prometheus.yml.

    Prometheus config caveat

    The bundled Prometheus job references /api/metrics, which is not implemented in this tree, and scrapes /api/health as JSON (not Prometheus exposition format). Treat the profile as a starting scaffold.

    Admin UI entrypoint

    Server page: app/[locale]/admin/analytics/page.tsx — requires isPlatformAdmin, loads getPlatformAnalytics('7d') including personalPages.

    Deep-dive: tunnel transports and heartbeat behavior.

    Admin console

    Next-step: Admin console entry for /admin/analytics.

    Owners see unique 24h/7d visit stats on their personal page widget.

    Backup correlation

    Monitoring tells you when things broke; backups tell you what you can restore.

    Typical alert scenarios

    • Health flips to degraded — missing critical env after deploy; check secrets before blaming Postgres.
    • Web Vitals poor ratings climb — CDN, image weight, or SSR regression; correlate with a release tag (BUILD_DATE / GIT_COMMIT on health JSON when set).
    • Spike in analytics_errors — broken client bundle or third-party script; admin dashboard lists recent messages.
    • Tunnel disconnect storms — see Realtime transport; often edge/WSS config, not database.

    Define who gets paged (operator vs developer) and what “down” means for your clone — Ring OSS does not ship PagerDuty wiring; you attach health checks to your provider.

    public/scripts/app-analytics.js
    not

    Analytics API surface

    RouteMethodAuthPersists to
    /api/analytics/web-vitalsPOSTOptional sessionweb_vitals
    /api/analytics/web-vitalsGETAdminQuery web_vitals or ?scope=platform summary
    /api/analytics/appPOSTOptional sessionanalytics_events
    /api/analytics/errorsPOSTOptional sessionanalytics_errors
    /api/analytics/errorsGETAdminList errors
    /api/analytics/devicePOSTSession requireduser_device_telemetry
    /api/analytics/platform-statsGETAdminCounts: users, entities, opportunities

    Implementation: features/analytics/lib/analytics-db.ts (insertAnalyticsEventBatch). Client Web Vitals: lib/web-vitals.tsx (INP replaces FID).

    Personal page events

    PiecePath
    Event typepersonal_page_view
    Writerfeatures/analytics/lib/personal-page-analytics.ts → recordPersonalPageView
    Call siteapp/[locale]/[username]/page.tsx — skips owners
    Owner widgetgetPersonalPageViewStats (features/auth/services/personal-page-stats.ts)
    AdmingetPersonalPagePlatformStats → PlatformAnalyticsSummary.personalPages
    Engagementpersonal_page_view joins docs_page_view / page_view / app_load in admin pageViews aggregates

    Details and unique-by-role math: Public Profile Pages.

    Database tables

    Included in data/schema.sql and migration 017_ring_analytics_schema.sql:

    • analytics_events — batched client telemetry and server personal_page_view rows
    • web_vitals — Core Web Vitals batches
    • analytics_errors — client-side error log

    Disable storage (privacy / load testing)

    When set, ingest routes acknowledge payloads but skip DatabaseService writes (isAnalyticsStorageDisabled()). Personal-page recorder also no-ops.

    Structured logging

    Env: LOG_LEVEL (debug | info | warn | error, default info in production), LOG_SILENT=true to mute.

    Optional external APM

    Commented/optional in env.local.template / docker.env.template:

    • SENTRY_DSN — wire via your Sentry Next.js integration (not auto-enabled in repo)
    • NEXT_PUBLIC_ANALYTICS_ID, VERCEL_ANALYTICS_ID — Vercel-hosted clones only

    Realtime probes

    RoutePurpose
    POST /api/tunnel/pingAuthenticated pong + timestamp
    POST /api/tunnel/heartbeatConnection keep-alive

    See Tunnel protocol.

    Cron / pipeline monitoring

    Cron routes (/api/cron/*) fail closed without CRON_SECRET. Example: GET /api/cron/email-analytics runs ProcessConductor pipeline email-analytics.

    Optional Docker Prometheus + Grafana

    Services: ring-prometheus (:9090), ring-grafana (:3001). Config: docker/prometheus/prometheus.yml.

    Prometheus config caveat

    The bundled Prometheus job references /api/metrics, which is not implemented in this tree, and scrapes /api/health as JSON (not Prometheus exposition format). Treat the profile as a starting scaffold.

    Admin UI entrypoint

    Server page: app/[locale]/admin/analytics/page.tsx — requires isPlatformAdmin, loads getPlatformAnalytics('7d') including personalPages.

    Deep-dive: tunnel transports and heartbeat behavior.

    Admin console

    Next-step: Admin console entry for /admin/analytics.

    1. Docs
    2. /Deployment
    3. /Monitoring & Analytics

    Updated Aug 3, 20265 min listen

    1. Docs
    2. /Deployment
    3. /Monitoring & Analytics

    Updated Aug 3, 20265 min listen

    1. Docs
    2. /Deployment
    3. /Monitoring & Analytics

    Updated Aug 3, 20265 min listen