Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
shared/widgets — API Reference
Theshared/widgets module contains data services that back the dashboard widget system. Currently it holds one service: grantPipelineService, which computes pipeline metrics and revenue forecasts for the grant application pipeline widget.
Module Map
| File | Responsibility |
|---|---|
grantPipelineService.ts | Pipeline stage aggregation, success rate calculation, quarterly revenue forecast |
grantPipelineService
getPipelineMetrics()
PipelineMetrics object containing per-stage counts and values, overall pending totals, expected revenue, the organisation’s average success rate, and a quarterly forecast.
PipelineMetrics
GrantPipelineStage
QuarterlyForecast
Implementation Status
Note: The current implementation returns mock data for demonstration purposes. The production implementation should query theThe intended production query pattern:grantApplicationsFirestore collection filtered byorganizationIdand aggregate bystatus.
Success Rate Formula
EventBus Events
This module emits no EventBus events. It is a read-only analytics service.Callers
| Caller | Uses |
|---|---|
src/features/dashboard/ | Grant pipeline dashboard widget |
src/features/grants/ | Pipeline summary views |
Extending the Widget Service Layer
When adding new dashboard widgets that require aggregated data queries, follow the same pattern:- Create a new
[domain]WidgetService.tsinsrc/shared/widgets/. - Export the service function(s) from
src/shared/widgets/index.ts. - Keep the service read-only — widget services should never write to Firestore.
- Mock the implementation first; replace with live Firestore queries before production.
- Cache expensive aggregations in
organizations/{orgId}/widgetCache/if queries are slow.