Overview
Dashboards in Budget Bee provide customizable views of financial data, aggregations, and analytics. They enable users to create personalized financial reporting views.
The dashboards resource is planned for future implementation. This documentation describes the intended API structure based on common dashboard patterns.
Base URL
{NEXT_PUBLIC_PG_REST_URL}/dashboards
Authorization
All dashboard endpoints require authentication via JWT token:
Authorization: Bearer {JWT_TOKEN}
Dashboard Schema
Unique dashboard identifier
Dashboard layout configuration (widgets, positions, sizes)
Default filters applied to dashboard data
Default date range for dashboard queries
Whether this is the default dashboard for the user/org
Dashboard visibility: private, shared, public
Organization ID (null for personal dashboards)
Dashboard creation timestamp
List Dashboards
Retrieve all dashboards for the authenticated user or organization.
Query Parameters
Columns to return. Default: *
Sort order. Example: name.asc or created_at.desc
Filter by visibility level
Request Example
curl -X GET "{NEXT_PUBLIC_PG_REST_URL}/dashboards?order=name.asc" \
-H "Authorization: Bearer {JWT_TOKEN}" \
-H "Content-Type: application/json"
Response Example
[
{
"id" : "dash_abc123" ,
"name" : "Monthly Overview" ,
"description" : "High-level view of monthly finances" ,
"layout" : {
"widgets" : [
{
"id" : "widget_1" ,
"type" : "summary_cards" ,
"position" : { "x" : 0 , "y" : 0 },
"size" : { "w" : 12 , "h" : 2 }
},
{
"id" : "widget_2" ,
"type" : "expense_chart" ,
"position" : { "x" : 0 , "y" : 2 },
"size" : { "w" : 8 , "h" : 4 }
}
]
},
"filters" : {
"date_range" : "last_30_days" ,
"categories" : []
},
"is_default" : true ,
"visibility" : "private" ,
"user_id" : "usr_abc123" ,
"organization_id" : null ,
"created_at" : "2024-01-15T10:30:00Z" ,
"updated_at" : "2024-01-20T14:22:00Z"
}
]
Get Dashboard
Retrieve a single dashboard by ID.
GET /dashboards?id=eq.{dashboard_id}
Request Example
curl -X GET "{NEXT_PUBLIC_PG_REST_URL}/dashboards?id=eq.dash_abc123" \
-H "Authorization: Bearer {JWT_TOKEN}" \
-H "Accept: application/vnd.pgrst.object+json"
Create Dashboard
Create a new dashboard.
Request Body
Dashboard layout with widgets
Visibility: private, shared, public
Request Example
curl -X POST "{NEXT_PUBLIC_PG_REST_URL}/dashboards" \
-H "Authorization: Bearer {JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{
"name": "Expense Analysis",
"description": "Detailed expense breakdown and trends",
"layout": {
"widgets": [
{
"id": "widget_1",
"type": "category_breakdown",
"position": {"x": 0, "y": 0},
"size": {"w": 6, "h": 4},
"config": {
"chart_type": "pie",
"show_legend": true
}
},
{
"id": "widget_2",
"type": "trend_chart",
"position": {"x": 6, "y": 0},
"size": {"w": 6, "h": 4},
"config": {
"chart_type": "line",
"grouping": "monthly"
}
}
]
},
"filters": {
"date_range": "last_90_days",
"transaction_type": "expense"
},
"is_default": false,
"visibility": "private"
}'
Response Example
{
"id" : "dash_def456" ,
"name" : "Expense Analysis" ,
"description" : "Detailed expense breakdown and trends" ,
"layout" : {
"widgets" : [
{
"id" : "widget_1" ,
"type" : "category_breakdown" ,
"position" : { "x" : 0 , "y" : 0 },
"size" : { "w" : 6 , "h" : 4 }
}
]
},
"is_default" : false ,
"visibility" : "private" ,
"created_at" : "2024-01-21T09:15:00Z"
}
Update Dashboard
Update an existing dashboard.
PATCH /dashboards?id=eq.{dashboard_id}
Request Example
curl -X PATCH "{NEXT_PUBLIC_PG_REST_URL}/dashboards?id=eq.dash_abc123" \
-H "Authorization: Bearer {JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{
"name": "Monthly Financial Overview",
"layout": {
"widgets": [
{
"id": "widget_1",
"type": "summary_cards",
"position": {"x": 0, "y": 0},
"size": {"w": 12, "h": 2}
}
]
}
}'
Delete Dashboard
Delete a dashboard permanently.
DELETE /dashboards?id=eq.{dashboard_id}
Request Example
curl -X DELETE "{NEXT_PUBLIC_PG_REST_URL}/dashboards?id=eq.dash_abc123" \
-H "Authorization: Bearer {JWT_TOKEN}"
Summary Cards
Display key financial metrics {
"type" : "summary_cards" ,
"config" : {
"metrics" : [ "total_income" , "total_expenses" , "net_balance" ],
"comparison_period" : "previous_month"
}
}
Category Breakdown
Pie or donut chart of spending by category {
"type" : "category_breakdown" ,
"config" : {
"chart_type" : "donut" ,
"show_legend" : true ,
"top_n" : 10
}
}
Trend Chart
Line or bar chart showing trends over time {
"type" : "trend_chart" ,
"config" : {
"chart_type" : "line" ,
"grouping" : "daily" ,
"metrics" : [ "expenses" , "income" ]
}
}
Transaction List
Recent or filtered transaction list {
"type" : "transaction_list" ,
"config" : {
"limit" : 10 ,
"filters" : {
"status" : "paid"
},
"columns" : [ "date" , "name" , "amount" , "category" ]
}
}
Subscription Overview
Show Subscription Overview
Active subscriptions and costs {
"type" : "subscription_overview" ,
"config" : {
"show_annual_cost" : true ,
"group_by" : "category"
}
}
Dashboard Analytics
Dashboards can query aggregated data using PostgREST functions:
Transaction Distribution
POST /rpc/get_transaction_distribution_by_category
{
"params" : {
"user_id" : "usr_abc123" ,
"organization_id" : null ,
"filters" : {
"start_date" : "2024-01-01" ,
"end_date" : "2024-01-31"
}
}
}
Budget vs Actual
GET /rpc/get_budget_comparison?start_date=2024-01-01 & end_date = 2024-01-31
Income vs Expenses
GET /rpc/get_cash_flow?grouping=monthly & periods = 12
Date Range Presets
Common date range presets for dashboard filters:
today - Current day
yesterday - Previous day
last_7_days - Last 7 days
last_30_days - Last 30 days
this_week - Current week (Mon-Sun)
last_week - Previous week
this_month - Current month
last_month - Previous month
this_quarter - Current quarter
last_quarter - Previous quarter
this_year - Current year
last_year - Previous year
all_time - All available data
custom - Custom date range
Dashboard Sharing
Visibility Levels
Private Only accessible by the creator
Shared Accessible by organization members
Public Accessible via public link (read-only)
Share Dashboard
PATCH /dashboards?id=eq.{dashboard_id}
{
"visibility" : "shared" ,
"metadata" : {
"shared_with" : [ "usr_def456" , "usr_ghi789" ]
}
}
Access Control
Dashboard access follows organization role permissions:
Owner, Admin, Editor Full access: list, get, create, update, delete
Viewer Can view shared dashboards, cannot create or modify
Best Practices
Dashboard Design
Focus on KPIs - Display the most important metrics prominently
Logical grouping - Group related widgets together
Consistent styling - Use consistent colors and chart types
Performance - Limit widgets per dashboard (8-12 max)
Clear titles - Use descriptive widget titles
Appropriate charts - Choose chart types that match the data
Date ranges - Set sensible default date ranges
Drill-down - Enable clicking to view details
Organization
Multiple dashboards - Create dashboards for different purposes
Default dashboard - Set a default for quick access
Regular updates - Review and update dashboard layouts
Share insights - Use shared dashboards for team collaboration