Interactive Financial Calculators โ Complete โ
Date: 2026-01-11
Status: โ
Complete
Related Feature(s): Economics Documentation, VitePress Documentation System
Problem Statement / Goal โ
The economics documentation contained static tables and Python scripts for financial modeling. Users needed to:
- Manually edit Python files and re-run scripts to see different scenarios
- Copy/paste values into spreadsheets for what-if analysis
- Couldn't easily explore fund allocation across different revenue scales
Goal: Create interactive, real-time financial calculators embedded directly in the documentation for immediate scenario modeling.
Solution Overview โ
Built two Vue 3 components integrated with VitePress that provide interactive financial modeling:
1. Fund Allocation Calculator (FundAllocationCalculator.vue) โ
Purpose: Model how revenue is allocated across Four Pillars, safe spaces, profit sharing, and operations at any scale.
Features:
- Preset scenarios: Pilot (7.5K/mo), Growth (75K/mo), Enterprise (8.3M/mo), Sustainable Growth
- Adjustable inputs:
- Monthly revenue (5K - 10M range)
- Number of employees (1-200)
- Average salary multiplier (1.0ร - 3.0ร)
- Profit sharing percentage (10%-100%)
- Real-time calculations:
- Per-category budget allocation with percentages
- Per-employee annual compensation breakdown
- Total monthly expenses and profit before sharing
- Distributed vs. retained profit
- Contextual insights:
- Warnings for operating losses
- Success indicators for healthy margins and compensation
- Safe space funding scale analysis
- Sustainable growth mode detection
2. Pilot Calculator (PilotCalculator.vue) โ
Purpose: Project 12-month revenue, costs, and profitability based on merchant acquisition assumptions.
Features:
- Preset scenarios: Conservative, Baseline, Optimistic, Aggressive
- Adjustable inputs:
- ARPU (average revenue per merchant)
- Monthly infrastructure and contractor costs
- Merchant churn rate
- New merchants acquired each month (per-month granular control)
- Real-time 12-month projections:
- Month-by-month active merchants, revenue, costs, profit
- Cumulative profitability tracking
- Break-even month detection
- Year 1 summary cards:
- Total revenue, costs, net profit
- Profit margin, average merchants
- Break-even timing
- Contextual insights:
- Profitability warnings and success indicators
- Margin health analysis
- Churn rate feedback (strong/moderate/high risk)
- Break-even timing validation
Files Changed/Created โ
Created โ
- FundAllocationCalculator.vue โ Vue component for fund allocation modeling
- PilotCalculator.vue โ Vue component for pilot revenue projections
- worklog/INTERACTIVE_CALCULATORS_COMPLETE.md โ This worklog entry
Modified โ
- economics/FUND_ALLOCATION.md โ Added interactive calculator embed above Enterprise Scale Example
- economics/CALCULATOR.md โ Replaced static instructions with interactive calculator at top
- CHANGELOG.md โ Added "Interactive financial calculators" entry to Unreleased section
Technical Implementation โ
VitePress Component Integration โ
VitePress automatically discovers Vue components in docs/.vitepress/components/ and makes them globally available in markdown files. No registration needed.
Usage in markdown:
<FundAllocationCalculator />
<PilotCalculator />Component Architecture โ
Both components use Vue 3 Composition API with:
- Reactive state:
ref()for input values - Computed properties: Real-time derived calculations
- Preset scenarios: One-click load of common configurations
- Responsive design: Mobile-friendly with grid layouts and overflow handling
Styling Strategy โ
Uses VitePress CSS custom properties for theme integration:
--vp-c-brand/--vp-c-brand-darkโ Primary colors--vp-c-bg/--vp-c-bg-softโ Background layers--vp-c-dividerโ Border colors--vp-c-text-1/--vp-c-text-2โ Text hierarchy
Ensures calculators adapt to light/dark theme automatically.
Calculation Logic โ
Fund Allocation:
// Example: Safe space percentage scales with revenue
const safeSpacePercent = computed(() => {
if (monthlyRevenue.value < 50000) return 0.02
if (monthlyRevenue.value < 200000) return 0.03
if (monthlyRevenue.value < 500000) return 0.04
return 0.05
})Pilot Projections:
// Example: Month-over-month merchant churn and revenue
for (let month = 0; month <= 12; month++) {
const churnedMerchants = Math.floor(activeMerchants * (merchantChurn.value / 100))
activeMerchants = activeMerchants - churnedMerchants + newMerchants
const revenue = activeMerchants * arpu.value
// ...accumulate cumulative metrics
}Testing Results โ
Manual Testing โ
โ Verified scenarios:
- Pilot (7.5K/mo) โ Properly shows early-stage compensation and tight margins
- Growth (75K/mo) โ Demonstrates improving employee compensation as scale increases
- Enterprise (8.3M/mo) โ Confirms exceptional profit margins (68%) and high total comp (935K/employee)
- Sustainable Growth โ Shows balanced approach with 78% profit sharing, 22% retained for expansion
โ Input validation:
- Slider ranges prevent invalid values
- Real-time recalculation on any input change
- No UI lag or calculation errors observed
โ Responsive design:
- Mobile layout tested (tables horizontal scroll, cards stack vertically)
- All insights readable on small screens
- Preset buttons adapt to narrow viewports
โ Theme compatibility:
- Light mode: Proper contrast and readability
- Dark mode: Colors integrate with VitePress dark theme
Cross-Browser Testing โ
- โ Chrome/Chromium (primary development)
- ๐ Firefox (not yet tested โ recommend manual check)
- ๐ Safari (not yet tested โ recommend manual check)
Accessibility โ
- โ ๏ธ Range sliders: Native HTML5 input type="range" (keyboard accessible)
- โ ๏ธ Color contrast: Visual-only insights (success/warning/info) โ Consider adding ARIA labels
- โ ๏ธ Screen readers: Tables use proper semantic HTML, but insights list may need aria-live regions for dynamic updates
Recommendation: Add ARIA labels and test with screen readers in future iteration.
User Impact โ
For Strategic Planning โ
- Founders/Leadership: Instantly model fund allocation at any revenue scale
- Investor Conversations: Real-time scenario planning during pitch meetings
- Budget Committees: Transparent what-if analysis for quarterly planning
For Financial Literacy โ
- New Employees: Understand how cooperative economics work at different scales
- Potential Hires: See total compensation modeling based on company growth
- Community Members: Explore how safe space funding scales with revenue
Vs. Python Scripts โ
Before:
- Find Python script in repo
- Edit variables in code
- Run script in terminal
- Copy output to spreadsheet for comparison
- Repeat for each scenario
Now:
- Open docs in browser
- Click preset or drag sliders
- See results instantly
- Compare scenarios side-by-side by adjusting values
Time savings: ~5 minutes per scenario โ ~5 seconds
Deployment โ
The calculators are live once VitePress docs are built and deployed:
npm run docs:build # Build static site
npm run docs:preview # Preview locallyDeployed docs available at:
- Production: https://docs.ourlantern.app/economics/FUND_ALLOCATION.html
- Local dev: http://localhost:5174/economics/FUND_ALLOCATION.html
Note: Ensure VitePress deployment (Cloudflare Pages, etc.) includes Vue runtime โ VitePress bundles this automatically.
Future Enhancements โ
Calculator Features โ
- [ ] Export to CSV: Download projections for offline analysis
- [ ] Scenario comparison: Side-by-side comparison of 2-3 scenarios
- [ ] Chart visualizations: Line/bar charts showing revenue/profit over time
- [ ] Sensitivity analysis: Auto-generate best/worst case scenarios
- [ ] URL state sharing: Share scenarios via query parameters
Additional Calculators โ
- [ ] User Growth Calculator: Project DAU/MAU based on merchant acquisition
- [ ] Safe Space Impact Calculator: Model community funding distribution by tier
- [ ] Salary Calculator: Interactive salary scale explorer with role comparisons
- [ ] Break-Even Calculator: Determine minimum merchants/ARPU to reach profitability
UX Improvements โ
- [ ] Add tooltips explaining each input/metric
- [ ] Keyboard shortcuts (arrow keys to adjust sliders)
- [ ] Mobile-optimized touch interactions
- [ ] ARIA live regions for screen reader updates
- [ ] Dark mode toggle persistence
Related Documents โ
Financial Planning โ
- ECONOMICS.md โ Cost structure, revenue models, unit economics
- FUND_ALLOCATION.md โ Now includes interactive calculator
- CALCULATOR.md โ Now includes interactive pilot projections
- PILOT_STRATEGY.md โ 12-month pilot financial projections
Engineering โ
- SCAFFOLD.md โ VitePress setup and architecture
- VITEPRESS_SETUP.md โ Documentation system configuration
Next Steps โ
- โ
Deploy to production โ Merge to
dev, then deploy docs site - ๐ User feedback โ Share with finance committee and gather usability feedback
- ๐ Accessibility audit โ Test with screen readers and add ARIA improvements
- ๐ Additional calculators โ Prioritize User Growth and Salary calculators based on demand
- ๐ Chart visualizations โ Add Chart.js or similar for visual projections
Last Updated: 2026-01-11
Maintained By: Engineering + Finance Teams
Questions? File an issue or ask in #engineering Slack channel