Concepts, value, and typical clone scenarios — less code.
Concepts, value, and typical clone scenarios — less code.
Підготовка контенту платформи Ring
Підготовка контенту платформи Ring
Підготовка контенту платформи Ring
Filter with Founder / Developer in the docs sidebar. This page replaces legacy fiction (PostHog/Mixpanel stacks, fabricated ROI, invented apiMonitor classes). Monitoring truth lives in app/api/health, app/api/analytics/*, lib/logger.ts, and the admin analytics UI.
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.
| Layer | Mechanism | Primary signal |
|---|---|---|
| Liveness | GET /api/health (+ HEAD) | Process up, env warnings, memory |
| UX performance | WebVitalsProvider → POST /api/analytics/web-vitals | LCP, CLS, INP, TTFB, FCP |
| Product events | app-analytics.js → POST /api/analytics/app | Sessions, page loads, custom events |
| Client errors | POST /api/analytics/errors | Stack traces, component, severity |
| Admin dashboard | /admin/analytics | Aggregates via getPlatformAnalytics() |
| Realtime connectivity | /api/tunnel/ping, /api/tunnel/heartbeat | Tunnel latency / session health |
| Server logs | lib/logger.ts | JSON lines to stdout (LOG_LEVEL) |
| Optional infra | Docker profile monitoring | Prometheus + Grafana (local dev only) |
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.
Probe GET /api/health from your load balancer or uptime checker — 503 means degraded (often missing AUTH_SECRET).
Platform admins open Admin → Analytics for user counts, Web Vitals medians, and recent client errors (7-day window).
Monitoring tells you things broke; backups tell you you can restore.
Filter with Founder / Developer in the docs sidebar. This page replaces legacy fiction (PostHog/Mixpanel stacks, fabricated ROI, invented apiMonitor classes). Monitoring truth lives in app/api/health, app/api/analytics/*, lib/logger.ts, and the admin analytics UI.
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.
| Layer | Mechanism | Primary signal |
|---|---|---|
| Liveness | GET /api/health (+ HEAD) | Process up, env warnings, memory |
| UX performance | WebVitalsProvider → POST /api/analytics/web-vitals | LCP, CLS, INP, TTFB, FCP |
| Product events | app-analytics.js → POST /api/analytics/app | Sessions, page loads, custom events |
| Client errors | POST /api/analytics/errors | Stack traces, component, severity |
| Admin dashboard | /admin/analytics | Aggregates via getPlatformAnalytics() |
| Realtime connectivity | /api/tunnel/ping, /api/tunnel/heartbeat | Tunnel latency / session health |
| Server logs | lib/logger.ts | JSON lines to stdout (LOG_LEVEL) |
| Optional infra | Docker profile monitoring | Prometheus + Grafana (local dev only) |
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.
Probe GET /api/health from your load balancer or uptime checker — 503 means degraded (often missing AUTH_SECRET).
Platform admins open Admin → Analytics for user counts, Web Vitals medians, and recent client errors (7-day window).
Monitoring tells you things broke; backups tell you you can restore.
Filter with Founder / Developer in the docs sidebar. This page replaces legacy fiction (PostHog/Mixpanel stacks, fabricated ROI, invented apiMonitor classes). Monitoring truth lives in app/api/health, app/api/analytics/*, lib/logger.ts, and the admin analytics UI.
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.
| Layer | Mechanism | Primary signal |
|---|---|---|
| Liveness | GET /api/health (+ HEAD) | Process up, env warnings, memory |
| UX performance | WebVitalsProvider → POST /api/analytics/web-vitals | LCP, CLS, INP, TTFB, FCP |
| Product events | app-analytics.js → POST /api/analytics/app | Sessions, page loads, custom events |
| Client errors | POST /api/analytics/errors | Stack traces, component, severity |
| Admin dashboard | /admin/analytics | Aggregates via getPlatformAnalytics() |
| Realtime connectivity | /api/tunnel/ping, /api/tunnel/heartbeat | Tunnel latency / session health |
| Server logs | lib/logger.ts | JSON lines to stdout (LOG_LEVEL) |
| Optional infra | Docker profile monitoring | Prometheus + Grafana (local dev only) |
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.
Probe GET /api/health from your load balancer or uptime checker — 503 means degraded (often missing AUTH_SECRET).
Platform admins open Admin → Analytics for user counts, Web Vitals medians, and recent client errors (7-day window).
Monitoring tells you things broke; backups tell you you can restore.
degraded — missing critical env after deploy; check secrets before blaming Postgres.poor ratings climb — CDN, image weight, or SSR regression; correlate with a release tag (BUILD_DATE / GIT_COMMIT on health JSON when set).analytics_errors — broken client bundle or third-party script; admin dashboard lists recent messages.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.
web_vitals?scope=platform/api/analytics/app | POST | Optional session | analytics_events |
/api/analytics/errors | POST | Optional session | analytics_errors |
/api/analytics/errors | GET | Admin | List errors |
/api/analytics/device | POST | Session required | user_device_telemetry |
/api/analytics/platform-stats | GET | Admin | Counts: users, entities, opportunities |
Implementation: features/analytics/lib/analytics-db.ts. Client collector: lib/web-vitals.tsx (uses web-vitals package — INP replaces FID).
Included in data/schema.sql and migration 017_ring_analytics_schema.sql:
analytics_events — batched client telemetryweb_vitals — Core Web Vitals batchesanalytics_errors — client-side error logApply on postgres-primary clones per Database migrations.
When set, ingest routes acknowledge payloads but skip DatabaseService writes (isAnalyticsStorageDisabled()).
Env: LOG_LEVEL (debug | info | warn | error, default info in production), LOG_SILENT=true to mute. Logs are JSON to stdout — ship with your cluster log agent (not built into Ring).
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| Route | Purpose |
|---|---|
POST /api/tunnel/ping | Authenticated pong + timestamp |
POST /api/tunnel/heartbeat | Connection keep-alive |
See Tunnel protocol.
Cron routes (/api/cron/*) fail closed without CRON_SECRET. Example: GET /api/cron/email-analytics runs ProcessConductor pipeline email-analytics. Monitor HTTP 401 vs 200 from your scheduler.
Services: ring-prometheus (:9090), ring-grafana (:3001). Config: docker/prometheus/prometheus.yml.
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 — add a real metrics exporter or fix scrape targets before production use.
Server page: app/[locale]/admin/analytics/page.tsx — requires isPlatformAdmin, loads getPlatformAnalytics('7d').
Additional admin endpoints (verify against live routes before relying on legacy API doc examples).
degraded — missing critical env after deploy; check secrets before blaming Postgres.poor ratings climb — CDN, image weight, or SSR regression; correlate with a release tag (BUILD_DATE / GIT_COMMIT on health JSON when set).analytics_errors — broken client bundle or third-party script; admin dashboard lists recent messages.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.
web_vitals?scope=platform/api/analytics/app | POST | Optional session | analytics_events |
/api/analytics/errors | POST | Optional session | analytics_errors |
/api/analytics/errors | GET | Admin | List errors |
/api/analytics/device | POST | Session required | user_device_telemetry |
/api/analytics/platform-stats | GET | Admin | Counts: users, entities, opportunities |
Implementation: features/analytics/lib/analytics-db.ts. Client collector: lib/web-vitals.tsx (uses web-vitals package — INP replaces FID).
Included in data/schema.sql and migration 017_ring_analytics_schema.sql:
analytics_events — batched client telemetryweb_vitals — Core Web Vitals batchesanalytics_errors — client-side error logApply on postgres-primary clones per Database migrations.
When set, ingest routes acknowledge payloads but skip DatabaseService writes (isAnalyticsStorageDisabled()).
Env: LOG_LEVEL (debug | info | warn | error, default info in production), LOG_SILENT=true to mute. Logs are JSON to stdout — ship with your cluster log agent (not built into Ring).
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| Route | Purpose |
|---|---|
POST /api/tunnel/ping | Authenticated pong + timestamp |
POST /api/tunnel/heartbeat | Connection keep-alive |
See Tunnel protocol.
Cron routes (/api/cron/*) fail closed without CRON_SECRET. Example: GET /api/cron/email-analytics runs ProcessConductor pipeline email-analytics. Monitor HTTP 401 vs 200 from your scheduler.
Services: ring-prometheus (:9090), ring-grafana (:3001). Config: docker/prometheus/prometheus.yml.
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 — add a real metrics exporter or fix scrape targets before production use.
Server page: app/[locale]/admin/analytics/page.tsx — requires isPlatformAdmin, loads getPlatformAnalytics('7d').
Additional admin endpoints (verify against live routes before relying on legacy API doc examples).
degraded — missing critical env after deploy; check secrets before blaming Postgres.poor ratings climb — CDN, image weight, or SSR regression; correlate with a release tag (BUILD_DATE / GIT_COMMIT on health JSON when set).analytics_errors — broken client bundle or third-party script; admin dashboard lists recent messages.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.
web_vitals?scope=platform/api/analytics/app | POST | Optional session | analytics_events |
/api/analytics/errors | POST | Optional session | analytics_errors |
/api/analytics/errors | GET | Admin | List errors |
/api/analytics/device | POST | Session required | user_device_telemetry |
/api/analytics/platform-stats | GET | Admin | Counts: users, entities, opportunities |
Implementation: features/analytics/lib/analytics-db.ts. Client collector: lib/web-vitals.tsx (uses web-vitals package — INP replaces FID).
Included in data/schema.sql and migration 017_ring_analytics_schema.sql:
analytics_events — batched client telemetryweb_vitals — Core Web Vitals batchesanalytics_errors — client-side error logApply on postgres-primary clones per Database migrations.
When set, ingest routes acknowledge payloads but skip DatabaseService writes (isAnalyticsStorageDisabled()).
Env: LOG_LEVEL (debug | info | warn | error, default info in production), LOG_SILENT=true to mute. Logs are JSON to stdout — ship with your cluster log agent (not built into Ring).
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| Route | Purpose |
|---|---|
POST /api/tunnel/ping | Authenticated pong + timestamp |
POST /api/tunnel/heartbeat | Connection keep-alive |
See Tunnel protocol.
Cron routes (/api/cron/*) fail closed without CRON_SECRET. Example: GET /api/cron/email-analytics runs ProcessConductor pipeline email-analytics. Monitor HTTP 401 vs 200 from your scheduler.
Services: ring-prometheus (:9090), ring-grafana (:3001). Config: docker/prometheus/prometheus.yml.
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 — add a real metrics exporter or fix scrape targets before production use.
Server page: app/[locale]/admin/analytics/page.tsx — requires isPlatformAdmin, loads getPlatformAnalytics('7d').
Additional admin endpoints (verify against live routes before relying on legacy API doc examples).