feat(analytics): implement subscription analytics suite with MRR, ARR, cohort analysis and forecasting (#724)#805
Open
primexk5 wants to merge 1 commit into
Open
Conversation
…, cohort analysis and forecasting (Smartdevs17#724)
|
@primexk5 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements an advanced, enterprise-grade subscription analytics suite for SubTrackr, empowering SaaS operators and subscribers with deep visibility into Monthly Recurring Revenue (MRR), Annual Recurring Revenue (ARR), customer cohort retention curves, algorithmic revenue forecasting, customizable dashboard widgets, and multi-format report exports.
Closes #724
Key Highlights & Features
Core Analytics Service (
src/services/analyticsService.ts)mrrGrowthRateandarrGrowthRatepercentage calculations to quantify momentum.calculateRetentionCurvehelper to compute Day 1, Day 7, Day 30, Day 60, and Day 90 retention milestones.Analytics State & Customization Engine (
app/stores/analyticsStore.ts)enabledWidgets), layout ordering (widgetOrder), and directional reordering actions (toggleWidget,reorderWidgets,resetWidgetConfig).forecastModel: 'linear' | 'exponential'state to allow real-time toggling between regression and exponential prediction algorithms.exportSummaryCsv()andexportSummaryText()) generating clean tabular KPI reports.UI Screens & Dashboard Customizer (
src/components/analytics/WidgetCustomizationModal.tsx,app/screens/AnalyticsDashboard.tsx,src/screens/AnalyticsScreen.tsx)+5.2% MoMin green,-1.5% MoMin red) directly to the MRR and ARR overview cards.AnalyticsScreen.tsxconnecting the general tab directly into the advanced cohort and MRR dashboard suite.Backend REST API Extensions (
backend/services/analytics/analyticsDashboardApi.ts)getMrrArrReport(merchantId)exposing active MRR, ARR, ARPU, customer LTV, subscriber counts, and churn ratios.getRevenueForecast(merchantId, model, monthsAhead)providing predictive revenue data points with statistical confidence intervals.Documentation & Unit Testing (
docs/analytics-guide.md)analyticsService.test.tsverifying linear vs exponential regression projections, MoM growth rate accuracy, and Day 1-90 retention curve milestones.Verification