OpportunitiesEntities
Docs
    Ring Platform

    Decentralized Self-building Future

    Sign In
    Entities
    Opportunities
    Store
    Docs
    Platform Concepts
    RING EconomySonoratek LLCGlobal ImpactAI Meets Web3
    Get Started
    Quick StartCalculatorRoadmap
    Privacy|Contact
    v1.104.26|Sonoratek LLC

    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
    Credit Rewards
    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
    Project configuration
    Public environment variables
    Order Lab secrets
    WalletConnect Project ID (Reown Cloud)
    Supported services
    NODUS wiki (project knowledge)
    Configuration playbook
    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
    News Kingdom architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server
    OSS vs enterprise

    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
    Credit Rewards
    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
    Project configuration
    Public environment variables
    Order Lab secrets
    WalletConnect Project ID (Reown Cloud)
    Supported services
    NODUS wiki (project knowledge)
    Configuration playbook
    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
    News Kingdom architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server
    OSS vs enterprise

    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
    Credit Rewards
    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
    Project configuration
    Public environment variables
    Order Lab secrets
    WalletConnect Project ID (Reown Cloud)
    Supported services
    NODUS wiki (project knowledge)
    Configuration playbook
    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
    News Kingdom architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server
    OSS vs enterprise

    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 Logo

    Loading documentation...

    Preparing Ring content

    Ring Logo

    Loading documentation...

    Preparing Ring content

    Ring Logo

    Loading documentation...

    Preparing Ring content

    Performance Optimization

    Filter with Founder / Developer in the docs sidebar. This page replaces legacy fiction ($2.8M revenue, invented dashboard examples, fake Lighthouse SLAs). Patterns below are traced to next.config.mjs, lib/cached-data.ts, components/providers/web-vitals-provider.tsx, features/analytics/lib/analytics-db.ts, and production Docker lessons.

    Ring Platform targets fast first paint (React 19 Server Components by default), fresh marketplace lists (cache tags + mutation sync), and measurable UX (Core Web Vitals ingest). Performance is a deploy concern — build timeouts, SSR traps, and cache invalidation — not only frontend polish.

    Performance stack (verified)

    LayerMechanismWhere
    FrameworkNext.js 16 App Router, cacheComponents: truenext.config.mjs
    List cachingunstable_cache + revalidateTaglib/cached-data.ts
    Request dedupReact.cache() on server readslib/services/firebase-service-manager.ts, actions
    Post-write reads30s in-process entity cacheDatabaseService EntityCache
    Heavy client UIdynamic(..., { ssr: false })components/docs/mdx-heavy-components.tsx
    Docs code blocksServer Shiki (highlightCodeToHtml)components/docs/code.tsx
    Imagesnext/image WebP/AVIFnext.config.mjs → images.formats
    UX metricsuseReportWebVitals → POST /api/analytics/web-vitalscomponents/providers/web-vitals-provider.tsx, features/analytics/lib/analytics-db.ts
    Resource hintsprefetchDNS / preinit scriptscontexts/app-context.tsx

    Why performance matters for your clone

    Slow opportunity and store pages directly hit conversion: members abandon checkout, vendors see empty dashboards, and AI matcher notifications feel “late” even when data is correct.

    What founders can optimize without code

    Measure first

    Admin → Analytics shows Web Vitals medians and client errors — establish a baseline before rebranding or adding heavy hero media.

    Image discipline

    Product and entity images should use Blob/CDN URLs via next/image — oversized PNG heroes are the most common LCP regression on new clones.

    List freshness

    After vendors post listings, caches must invalidate — if lists look stale, fix sync before scaling servers.

    Caching and freshness

    List page cache lifecycle

    Role-scoped list cache

    The same pattern covers entities (getCachedEntitiesForRole / invalidateEntitiesCache) and the admin news-stats aggregate (invalidateNewsStatsCache).

    Mutation services call syncOpportunityDiscovery / syncEntityDiscovery — see Discovery mutation sync. Never cache a write path; always invalidate after CRUD.

    Server read deduplication

    Wrap expensive server fetches with cache() from react so parallel Server Components share one DB round-trip per request (see getCachedDocument in lib/services/firebase-service-manager.ts).

    Read-after-write (30s)

    DatabaseService keeps a short-lived EntityCache (30s TTL) so creates are visible to immediate reads in the same process — not a substitute for revalidateTag.

    React 19 patterns in production code

    PatternExample location

    Related documentation

    Related documentation

    Monitoring & Analytics

    Next-step: health checks, the Web Vitals API, and the admin analytics dashboard.

    Docker

    Same-workflow: Mermaid SSR incident history and health probes.

    Discovery Mutation Sync

    Deep-dive: cache invalidation after entity/opportunity CRUD.

    Performance

    See-also: implementation patterns for cache(), static generation, and edge notes.

    1. Docs
    2. /Deployment
    3. /Performance Optimization

    Updated Aug 22, 20264 min listen

    Performance Optimization

    Filter with Founder / Developer in the docs sidebar. This page replaces legacy fiction ($2.8M revenue, invented dashboard examples, fake Lighthouse SLAs). Patterns below are traced to next.config.mjs, lib/cached-data.ts, components/providers/web-vitals-provider.tsx, features/analytics/lib/analytics-db.ts, and production Docker lessons.

    Ring Platform targets fast first paint (React 19 Server Components by default), fresh marketplace lists (cache tags + mutation sync), and measurable UX (Core Web Vitals ingest). Performance is a deploy concern — build timeouts, SSR traps, and cache invalidation — not only frontend polish.

    Performance stack (verified)

    LayerMechanismWhere
    FrameworkNext.js 16 App Router, cacheComponents: truenext.config.mjs
    List cachingunstable_cache + revalidateTaglib/cached-data.ts
    Request dedupReact.cache() on server readslib/services/firebase-service-manager.ts, actions
    Post-write reads30s in-process entity cacheDatabaseService EntityCache
    Heavy client UIdynamic(..., { ssr: false })components/docs/mdx-heavy-components.tsx
    Docs code blocksServer Shiki (highlightCodeToHtml)components/docs/code.tsx
    Imagesnext/image WebP/AVIFnext.config.mjs → images.formats
    UX metricsuseReportWebVitals → POST /api/analytics/web-vitalscomponents/providers/web-vitals-provider.tsx, features/analytics/lib/analytics-db.ts
    Resource hintsprefetchDNS / preinit scriptscontexts/app-context.tsx

    Why performance matters for your clone

    Slow opportunity and store pages directly hit conversion: members abandon checkout, vendors see empty dashboards, and AI matcher notifications feel “late” even when data is correct.

    What founders can optimize without code

    Measure first

    Admin → Analytics shows Web Vitals medians and client errors — establish a baseline before rebranding or adding heavy hero media.

    Image discipline

    Product and entity images should use Blob/CDN URLs via next/image — oversized PNG heroes are the most common LCP regression on new clones.

    List freshness

    After vendors post listings, caches must invalidate — if lists look stale, fix sync before scaling servers.

    Caching and freshness

    List page cache lifecycle

    Role-scoped list cache

    The same pattern covers entities (getCachedEntitiesForRole / invalidateEntitiesCache) and the admin news-stats aggregate (invalidateNewsStatsCache).

    Mutation services call syncOpportunityDiscovery / syncEntityDiscovery — see Discovery mutation sync. Never cache a write path; always invalidate after CRUD.

    Server read deduplication

    Wrap expensive server fetches with cache() from react so parallel Server Components share one DB round-trip per request (see getCachedDocument in lib/services/firebase-service-manager.ts).

    Read-after-write (30s)

    DatabaseService keeps a short-lived EntityCache (30s TTL) so creates are visible to immediate reads in the same process — not a substitute for revalidateTag.

    React 19 patterns in production code

    PatternExample location

    Related documentation

    Related documentation

    Monitoring & Analytics

    Next-step: health checks, the Web Vitals API, and the admin analytics dashboard.

    Docker

    Same-workflow: Mermaid SSR incident history and health probes.

    Discovery Mutation Sync

    Deep-dive: cache invalidation after entity/opportunity CRUD.

    Performance

    See-also: implementation patterns for cache(), static generation, and edge notes.

    1. Docs
    2. /Deployment
    3. /Performance Optimization

    Updated Aug 22, 20264 min listen

    Performance Optimization

    Filter with Founder / Developer in the docs sidebar. This page replaces legacy fiction ($2.8M revenue, invented dashboard examples, fake Lighthouse SLAs). Patterns below are traced to next.config.mjs, lib/cached-data.ts, components/providers/web-vitals-provider.tsx, features/analytics/lib/analytics-db.ts, and production Docker lessons.

    Ring Platform targets fast first paint (React 19 Server Components by default), fresh marketplace lists (cache tags + mutation sync), and measurable UX (Core Web Vitals ingest). Performance is a deploy concern — build timeouts, SSR traps, and cache invalidation — not only frontend polish.

    Performance stack (verified)

    LayerMechanismWhere
    FrameworkNext.js 16 App Router, cacheComponents: truenext.config.mjs
    List cachingunstable_cache + revalidateTaglib/cached-data.ts
    Request dedupReact.cache() on server readslib/services/firebase-service-manager.ts, actions
    Post-write reads30s in-process entity cacheDatabaseService EntityCache
    Heavy client UIdynamic(..., { ssr: false })components/docs/mdx-heavy-components.tsx
    Docs code blocksServer Shiki (highlightCodeToHtml)components/docs/code.tsx
    Imagesnext/image WebP/AVIFnext.config.mjs → images.formats
    UX metricsuseReportWebVitals → POST /api/analytics/web-vitalscomponents/providers/web-vitals-provider.tsx, features/analytics/lib/analytics-db.ts
    Resource hintsprefetchDNS / preinit scriptscontexts/app-context.tsx

    Why performance matters for your clone

    Slow opportunity and store pages directly hit conversion: members abandon checkout, vendors see empty dashboards, and AI matcher notifications feel “late” even when data is correct.

    What founders can optimize without code

    Measure first

    Admin → Analytics shows Web Vitals medians and client errors — establish a baseline before rebranding or adding heavy hero media.

    Image discipline

    Product and entity images should use Blob/CDN URLs via next/image — oversized PNG heroes are the most common LCP regression on new clones.

    List freshness

    After vendors post listings, caches must invalidate — if lists look stale, fix sync before scaling servers.

    Caching and freshness

    List page cache lifecycle

    Role-scoped list cache

    The same pattern covers entities (getCachedEntitiesForRole / invalidateEntitiesCache) and the admin news-stats aggregate (invalidateNewsStatsCache).

    Mutation services call syncOpportunityDiscovery / syncEntityDiscovery — see Discovery mutation sync. Never cache a write path; always invalidate after CRUD.

    Server read deduplication

    Wrap expensive server fetches with cache() from react so parallel Server Components share one DB round-trip per request (see getCachedDocument in lib/services/firebase-service-manager.ts).

    Read-after-write (30s)

    DatabaseService keeps a short-lived EntityCache (30s TTL) so creates are visible to immediate reads in the same process — not a substitute for revalidateTag.

    React 19 patterns in production code

    PatternExample location

    Related documentation

    Related documentation

    Monitoring & Analytics

    Next-step: health checks, the Web Vitals API, and the admin analytics dashboard.

    Docker

    Same-workflow: Mermaid SSR incident history and health probes.

    Discovery Mutation Sync

    Deep-dive: cache invalidation after entity/opportunity CRUD.

    Performance

    See-also: implementation patterns for cache(), static generation, and edge notes.

    1. Docs
    2. /Deployment
    3. /Performance Optimization

    Updated Aug 22, 20264 min listen

    Locale scope

    Fewer active locales (NEXT_PUBLIC_SUPPORTED_LOCALES) reduces build surface and static param work at deploy time.

    Web Vitals targets (Google thresholds used in code)

    MetricGood (≤)Poor (>)
    LCP2.5s4s
    INP200ms500ms
    CLS0.10.25
    TTFB800ms1.8s
    FCP1.8s3s
    FID100ms300ms

    Thresholds come from ratingForMetric in features/analytics/lib/analytics-db.ts. The client reports each metric's rating from next/web-vitals and buffers them into one POST per debounce window to /api/analytics/web-vitals.

    Treat performance as release criteria for major clone launches: run Lighthouse on /, /opportunities, and /store after deploy — compare with Admin analytics the following week.

    useActionState
    features/reviews/components/review-form.tsx
    useOptimistichooks/use-realtime.ts, hooks/use-realtime-opportunities.ts
    Server Actions + revalidatePathapp/_actions/*.ts

    Prefer Server Components for list/detail shells; isolate 'use client' to forms, tunnel, wallet, and viz widgets.

    Deploy and build pitfalls

    1. 1

      Do not SSR heavy viz on the server

      Docs and marketing widgets load via dynamic(..., { ssr: false }) in mdx-heavy-components.tsx. Top-level Mermaid/Shiki on the server caused 30s loads and 503s in production — see Docker deployment.

    2. 2

      Docs <Code> is async server Shiki

      components/docs/code.tsx calls highlightCodeToHtml once per block — do not add client-side highlighters on the same page.

    3. 3

      Build timeout budget

      staticPageGenerationTimeout: 180 in next.config.mjs — large doc trees or many locales need incremental static generation discipline; trim scanDocsStaticParams scope if builds exceed CI limits.

    4. 4

      Standalone output

      next.config.mjs sets output: 'standalone' with outputFileTracingRoot, serverExternalPackages (Firebase, Auth.js, Solana, nodemailer), and outputFileTracingIncludes (i18n, locales, docs, ring-config, server.ts) so container images trace only the server bundles they need.

    Image optimization

    next.config.mjs enables WebP/AVIF (images.formats) and remote patterns for Google avatars, Google Fonts, Vercel Blob, and cdn.ring-platform.org — plus per-clone patterns via collectCloneImageRemotePatterns. Add new CDN hostnames to images.remotePatterns when onboarding a clone.

    Measuring regressions

    • Ingest: WebVitalsProvider (components/providers/web-vitals-provider.tsx), rendered in app-client-shell.tsx
    • Storage: migration 017_ring_analytics_schema.sql
    • Query: Admin analytics or GET /api/analytics/web-vitals?scope=platform (admin)
    • Disable writes: ANALYTICS_DISABLE_STORAGE=true for load tests

    Full monitoring reference: Monitoring & analytics.

    Deeper developer guide

    Implementation patterns (Firebase cache(), static generation, edge notes) live in Development: Performance and Features: Performance patterns — verify examples against postgres-primary clones before copying Firebase-specific snippets.

    Locale scope

    Fewer active locales (NEXT_PUBLIC_SUPPORTED_LOCALES) reduces build surface and static param work at deploy time.

    Web Vitals targets (Google thresholds used in code)

    MetricGood (≤)Poor (>)
    LCP2.5s4s
    INP200ms500ms
    CLS0.10.25
    TTFB800ms1.8s
    FCP1.8s3s
    FID100ms300ms

    Thresholds come from ratingForMetric in features/analytics/lib/analytics-db.ts. The client reports each metric's rating from next/web-vitals and buffers them into one POST per debounce window to /api/analytics/web-vitals.

    Treat performance as release criteria for major clone launches: run Lighthouse on /, /opportunities, and /store after deploy — compare with Admin analytics the following week.

    useActionState
    features/reviews/components/review-form.tsx
    useOptimistichooks/use-realtime.ts, hooks/use-realtime-opportunities.ts
    Server Actions + revalidatePathapp/_actions/*.ts

    Prefer Server Components for list/detail shells; isolate 'use client' to forms, tunnel, wallet, and viz widgets.

    Deploy and build pitfalls

    1. 1

      Do not SSR heavy viz on the server

      Docs and marketing widgets load via dynamic(..., { ssr: false }) in mdx-heavy-components.tsx. Top-level Mermaid/Shiki on the server caused 30s loads and 503s in production — see Docker deployment.

    2. 2

      Docs <Code> is async server Shiki

      components/docs/code.tsx calls highlightCodeToHtml once per block — do not add client-side highlighters on the same page.

    3. 3

      Build timeout budget

      staticPageGenerationTimeout: 180 in next.config.mjs — large doc trees or many locales need incremental static generation discipline; trim scanDocsStaticParams scope if builds exceed CI limits.

    4. 4

      Standalone output

      next.config.mjs sets output: 'standalone' with outputFileTracingRoot, serverExternalPackages (Firebase, Auth.js, Solana, nodemailer), and outputFileTracingIncludes (i18n, locales, docs, ring-config, server.ts) so container images trace only the server bundles they need.

    Image optimization

    next.config.mjs enables WebP/AVIF (images.formats) and remote patterns for Google avatars, Google Fonts, Vercel Blob, and cdn.ring-platform.org — plus per-clone patterns via collectCloneImageRemotePatterns. Add new CDN hostnames to images.remotePatterns when onboarding a clone.

    Measuring regressions

    • Ingest: WebVitalsProvider (components/providers/web-vitals-provider.tsx), rendered in app-client-shell.tsx
    • Storage: migration 017_ring_analytics_schema.sql
    • Query: Admin analytics or GET /api/analytics/web-vitals?scope=platform (admin)
    • Disable writes: ANALYTICS_DISABLE_STORAGE=true for load tests

    Full monitoring reference: Monitoring & analytics.

    Deeper developer guide

    Implementation patterns (Firebase cache(), static generation, edge notes) live in Development: Performance and Features: Performance patterns — verify examples against postgres-primary clones before copying Firebase-specific snippets.

    Locale scope

    Fewer active locales (NEXT_PUBLIC_SUPPORTED_LOCALES) reduces build surface and static param work at deploy time.

    Web Vitals targets (Google thresholds used in code)

    MetricGood (≤)Poor (>)
    LCP2.5s4s
    INP200ms500ms
    CLS0.10.25
    TTFB800ms1.8s
    FCP1.8s3s
    FID100ms300ms

    Thresholds come from ratingForMetric in features/analytics/lib/analytics-db.ts. The client reports each metric's rating from next/web-vitals and buffers them into one POST per debounce window to /api/analytics/web-vitals.

    Treat performance as release criteria for major clone launches: run Lighthouse on /, /opportunities, and /store after deploy — compare with Admin analytics the following week.

    useActionState
    features/reviews/components/review-form.tsx
    useOptimistichooks/use-realtime.ts, hooks/use-realtime-opportunities.ts
    Server Actions + revalidatePathapp/_actions/*.ts

    Prefer Server Components for list/detail shells; isolate 'use client' to forms, tunnel, wallet, and viz widgets.

    Deploy and build pitfalls

    1. 1

      Do not SSR heavy viz on the server

      Docs and marketing widgets load via dynamic(..., { ssr: false }) in mdx-heavy-components.tsx. Top-level Mermaid/Shiki on the server caused 30s loads and 503s in production — see Docker deployment.

    2. 2

      Docs <Code> is async server Shiki

      components/docs/code.tsx calls highlightCodeToHtml once per block — do not add client-side highlighters on the same page.

    3. 3

      Build timeout budget

      staticPageGenerationTimeout: 180 in next.config.mjs — large doc trees or many locales need incremental static generation discipline; trim scanDocsStaticParams scope if builds exceed CI limits.

    4. 4

      Standalone output

      next.config.mjs sets output: 'standalone' with outputFileTracingRoot, serverExternalPackages (Firebase, Auth.js, Solana, nodemailer), and outputFileTracingIncludes (i18n, locales, docs, ring-config, server.ts) so container images trace only the server bundles they need.

    Image optimization

    next.config.mjs enables WebP/AVIF (images.formats) and remote patterns for Google avatars, Google Fonts, Vercel Blob, and cdn.ring-platform.org — plus per-clone patterns via collectCloneImageRemotePatterns. Add new CDN hostnames to images.remotePatterns when onboarding a clone.

    Measuring regressions

    • Ingest: WebVitalsProvider (components/providers/web-vitals-provider.tsx), rendered in app-client-shell.tsx
    • Storage: migration 017_ring_analytics_schema.sql
    • Query: Admin analytics or GET /api/analytics/web-vitals?scope=platform (admin)
    • Disable writes: ANALYTICS_DISABLE_STORAGE=true for load tests

    Full monitoring reference: Monitoring & analytics.

    Deeper developer guide

    Implementation patterns (Firebase cache(), static generation, edge notes) live in Development: Performance and Features: Performance patterns — verify examples against postgres-primary clones before copying Firebase-specific snippets.