Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/soker90/finper/llms.txt

Use this file to discover all available pages before exploring further.

The Dashboard endpoint provides a comprehensive snapshot of the authenticated user’s financial health in a single request. It aggregates data across Accounts, Transactions, Budgets, Debts, Loans, and Pensions at query time — there is no dedicated Dashboard data model or persistent state. All calculations are performed synchronously against the SQLite database and returned as a single JSON object.
The dashboard has no own data model. It aggregates live data from the accounts, transactions, budgets, debts, loans, and pensions tables. All monetary values in the response are rounded to two decimal places via the roundMoney utility from @soker90/finper-db.

GET /api/dashboard/stats

Retrieve the full aggregated financial overview for the authenticated user. GET /api/dashboard/stats — requires token header.

Response — 200 OK

Returns a single DashboardStatsResult object.

Net Worth & Balance

totalBalance
number
Sum of all active account balances.
totalDebts
number
Total outstanding debt amount owed by the user (from the Debts module).
totalLoansPending
number
Total pending principal remaining across all active loans.
netWorth
number
Calculated as totalBalance - totalDebts - totalLoansPending + totalReceivable.

Current Month

monthlyIncome
number
Total income transactions for the current calendar month.
monthlyExpenses
number
Total expense transactions for the current calendar month.
savingsRate
number
Current month savings rate as a percentage: ((income - expenses) / income) * 100. Returns 0 if income is zero.

Month-over-Month Trend

monthlyTrend
object
Comparison of the current month vs the previous month.
  • income.current — current month income
  • income.previous — previous month income
  • expenses.current — current month expenses
  • expenses.previous — previous month expenses

Historical Summary

last6Months
array
Array of monthly summary objects for the last 6 calendar months. Each object contains month/year, total income, and total expenses — useful for rendering bar or line charts.

Expense Velocity

expenseVelocity
object
Cumulative daily expense arrays for the current and previous months.
  • currentMonth — array of { day: number, amount: number } (cumulative through each day of the current month)
  • previousMonth — same structure for the previous month
dailyAvgExpense
number
Average daily expense for the current month to date (monthlyExpenses / dayOfMonth).
projectedMonthlyExpense
number
Projected total expense for the full current month based on dailyAvgExpense * daysInMonth.
cashRunwayMonths
number
Estimated number of months the current balance would last at the filtered average monthly expense rate (last 3 months, excluding outlier months).

Rankings

topExpenseCategories
array
Top expense categories for the current month, sorted by amount descending. Each entry: { name: string, amount: number, parentName?: string }.
topStores
array
Top stores by expense amount for the current month. Each entry: { name: string, amount: number }.

Budget Compliance

budgetAdherencePct
number
Percentage indicating how well the user is adhering to their current-month budgets. Computed from actual expenses vs total budgeted amount.

Pension

pension
object | null
Pension summary if pension data exists; null otherwise.
  • employeeAmount — total employee contributions
  • companyAmount — total employer contributions
  • total — current total pension value
  • transactions — array of serialized pension snapshot records
pensionReturnPct
number
Pension return as a percentage: ((total - contributed) / contributed) * 100. Returns 0 if no contributions exist.

Health Score

healthScore
object
A composite financial health score (0–100) and its component sub-scores.
  • total — overall health score
  • savingsRate — sub-score derived from historical savings rate
  • debtRatio — sub-score from total debt vs total balance ratio
  • budgetAdherence — sub-score from budget compliance
  • cashRunway — sub-score from cash runway months
  • pensionReturn — sub-score from pension performance

Insights

insights
array
Array of dynamically generated insight objects. Each insight surfaces an actionable observation (e.g. a category approaching its budget limit, an unusual spike in spending). The structure of each insight is { type: string, message: string, ... }.

Example

curl http://localhost:3008/api/dashboard/stats \
  -H 'token: <your-jwt>'
{
  "totalBalance": 12450.00,
  "totalDebts": 300.00,
  "totalLoansPending": 8500.00,
  "netWorth": 3650.00,
  "monthlyIncome": 3200.00,
  "monthlyExpenses": 1850.00,
  "savingsRate": 42.19,
  "monthlyTrend": {
    "income": { "current": 3200.00, "previous": 3000.00 },
    "expenses": { "current": 1850.00, "previous": 1920.00 }
  },
  "last6Months": [
    { "year": 2024, "month": 8, "income": 3000.00, "expenses": 1920.00 },
    { "year": 2024, "month": 9, "income": 3100.00, "expenses": 1870.00 }
  ],
  "expenseVelocity": {
    "currentMonth": [
      { "day": 1, "amount": 45.00 },
      { "day": 2, "amount": 45.00 },
      { "day": 3, "amount": 112.50 }
    ],
    "previousMonth": [
      { "day": 1, "amount": 60.00 }
    ]
  },
  "dailyAvgExpense": 61.67,
  "projectedMonthlyExpense": 1911.77,
  "cashRunwayMonths": 6.7,
  "topExpenseCategories": [
    { "name": "Groceries", "amount": 420.00, "parentName": "Food" },
    { "name": "Rent", "amount": 900.00, "parentName": null }
  ],
  "topStores": [
    { "name": "Whole Foods", "amount": 220.00 },
    { "name": "Amazon", "amount": 130.00 }
  ],
  "budgetAdherencePct": 87.5,
  "pension": {
    "employeeAmount": 5000.00,
    "companyAmount": 2500.00,
    "total": 8200.00,
    "transactions": []
  },
  "pensionReturnPct": 9.33,
  "healthScore": {
    "total": 74,
    "savingsRate": 80,
    "debtRatio": 65,
    "budgetAdherence": 87,
    "cashRunway": 70,
    "pensionReturn": 75
  },
  "insights": [
    {
      "type": "budget_warning",
      "message": "Groceries is at 84% of its monthly budget with 12 days remaining."
    }
  ]
}

Build docs developers (and LLMs) love