- MRR
- Subscribers
- MRR Movements
- Average Staying
- Customer Lifetime Value
- Customer Churn Rate
- Free to paid subscriptions
- Free trials
- Annual Run Rate
-
Clone the repository from GitHub
git clone https://github.com/peppapig13132/StripeMetrics-Backend.git cd StripeMetrics-Backend
-
Install Dependencies
Install the necessary dependencies for Backend - Express.js project.
npm install
-
Set Environment variables
Replace filename
.env.example
to.env
.# This variable used for JWT SECRETKEY=
-
Prepare Frontend Codes
Move Compiled Frontend Codes into
static
directory. -
Run Development mode
Running without hotload
npm start
Running with hotload (Used nodemon)
npm run dev
-
Run Production mode
Build the code: This command will create
dist
directory in the project folder.npm run build
cd dist npm start
-
Synchronize Database
Use environment variable
DB_SYNC
to synchronize database.# Synchronize database DB_SYNC=true # Ignore synchronization DB_SYNC=false
To synchronize a specific model, find
src/db.ts
-
ARPU (Average Monthly Revenue Per User)
ARPU = Total Monthly Revenue / Number of Active Customers
-
Monthly Churn Rate
Monthly Churn Rate = Number of Customers Lost in a Month / Number of Customers at the Start of the Month
-
Customer Lifetime
Customer Lifetime = 1 / Monthly Churn Rate
-
CLV (Customer Lifetime Value)
CLV = ARPU * Customer Lifetime
- Customer Churn Rate
Churn Rate = (Number of Canceled Subscriptions / Number of Active Subscriptions at the Start) * 100
-
Annual Run Rate
Be sure, Annual Run Rate calcualted by following formular as the provider has only monthly subscriptions.
Annual Run Rate = MRR * 12
- Modify your
.htaccess
file in the domain root directory.# If your server running on port 8000 RewriteEngine on RewriteRule ^(.*)$ http://127.0.0.1:8000/$1 [P]
- Use
pm2
module. More aboutpm2
, click here.# Start process pm2 start <ENTRY_JS_FILE> # Check process pm2 list # Stop process pm2 delete <id>
- MRR
- Subscribers
- MRR Movements
- Average Staying
- Customer Lifetime Value
- Customer Churn Rate
- Free to paid subscriptions
- Free trials
- Annual Run Rate