Documentation Index
Fetch the complete documentation index at: https://dhanurgo.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Data Flows
Three critical data flows power HostMetrics.1. CSV Import Flow
Data enters the system via CSV file upload or Chrome extension sync. Key details:- Trip records are deduplicated by
(user_id, reservation_id) - Earnings records are deduplicated by
(user_id, composite_key) - Previous imports of the same type are marked “superseded”
- Vehicle records are auto-created from trip data if they don’t exist
2. KPI Calculation Pipeline
Dashboard metrics are computed from raw data using pure functions. Key files:src/lib/kpi/queries.ts— Parallel data fetchingsrc/lib/kpi/calculations.ts— Pure calculation functions (869 lines)src/hooks/useKPIs.ts— React hook wrapper
3. Investor Payment Flow
Revenue sharing between host and investor. Key files:src/lib/calculations/investorEarnings.ts— Three-pool expense modelsrc/lib/calculations/vehicleRevenue.ts— Revenue adjustment with inclusion togglessrc/lib/db/investors.ts— Payment CRUD + calculations