SPB Git

Repository Public License

expense-tracker.blueprint.json 14.6 KB 656 lines json

1{2  "entrypoint": "expenses_page",3  "id": "app_expense_tracker",4  "name": "Expense Tracker",5  "objects": [6    {7      "id": "expenses",8      "name": "Expenses",9      "props": {10        "columns": [11          {12            "label": "Date",13            "name": "date",14            "required": true,15            "type": "date"16          },17          {18            "label": "Description",19            "name": "description",20            "required": true,21            "type": "text"22          },23          {24            "default": "Other",25            "label": "Category",26            "name": "category",27            "options": [28              "Groceries",29              "Dining",30              "Transport",31              "Housing",32              "Utilities",33              "Entertainment",34              "Health",35              "Shopping",36              "Other"37            ],38            "required": true,39            "type": "text"40          },41          {42            "label": "Amount",43            "name": "amount",44            "required": true,45            "type": "currency"46          }47        ],48        "seed": [49          {50            "amount": 86.4,51            "category": "Groceries",52            "date": "2025-01-04",53            "description": "Supermarket"54          },55          {56            "amount": 1250,57            "category": "Housing",58            "date": "2025-01-01",59            "description": "Rent"60          },61          {62            "amount": 72.15,63            "category": "Utilities",64            "date": "2025-01-12",65            "description": "Electricity bill"66          },67          {68            "amount": 34.5,69            "category": "Dining",70            "date": "2025-01-18",71            "description": "Pizza night"72          },73          {74            "amount": 65,75            "category": "Transport",76            "date": "2025-01-22",77            "description": "Monthly transit pass"78          },79          {80            "amount": 1250,81            "category": "Housing",82            "date": "2025-02-01",83            "description": "Rent"84          },85          {86            "amount": 41.2,87            "category": "Groceries",88            "date": "2025-02-07",89            "description": "Farmers market"90          },91          {92            "amount": 120,93            "category": "Entertainment",94            "date": "2025-02-14",95            "description": "Concert tickets"96          },97          {98            "amount": 23.8,99            "category": "Health",100            "date": "2025-02-19",101            "description": "Pharmacy"102          },103          {104            "amount": 97.65,105            "category": "Groceries",106            "date": "2025-02-25",107            "description": "Supermarket"108          },109          {110            "amount": 1250,111            "category": "Housing",112            "date": "2025-03-01",113            "description": "Rent"114          },115          {116            "amount": 110,117            "category": "Shopping",118            "date": "2025-03-05",119            "description": "Running shoes"120          },121          {122            "amount": 38.9,123            "category": "Utilities",124            "date": "2025-03-11",125            "description": "Water bill"126          },127          {128            "amount": 27.3,129            "category": "Dining",130            "date": "2025-03-16",131            "description": "Lunch with team"132          },133          {134            "amount": 48,135            "category": "Transport",136            "date": "2025-03-23",137            "description": "Taxi to airport"138          }139        ]140      },141      "provenance": {142        "source": "agent"143      },144      "schemaVersion": 1,145      "type": "prism.data.table",146      "version": 1147    },148    {149      "dependencies": [150        "expenses"151      ],152      "id": "filtered_expenses",153      "name": "Filtered expenses",154      "props": {155        "query": {156          "filters": [157            {158              "column": "category",159              "op": "eq",160              "unless": "state.categoryFilter == 'All'",161              "value": {162                "$expr": "state.categoryFilter"163              }164            }165          ],166          "search": {167            "columns": [168              "description"169            ],170            "text": {171              "$expr": "state.searchText"172            }173          },174          "sort": [175            {176              "column": "date",177              "descending": true178            }179          ],180          "table": "expenses"181        }182      },183      "provenance": {184        "generated": true,185        "source": "agent"186      },187      "schemaVersion": 1,188      "type": "prism.data.query",189      "version": 1190    },191    {192      "dependencies": [193        "expenses"194      ],195      "id": "monthly_totals",196      "name": "Monthly totals",197      "props": {198        "query": {199          "aggregates": [200            {201              "as": "total",202              "column": "amount",203              "fn": "sum"204            }205          ],206          "filters": [207            {208              "column": "category",209              "op": "eq",210              "unless": "state.categoryFilter == 'All'",211              "value": {212                "$expr": "state.categoryFilter"213              }214            }215          ],216          "groupBy": {217            "as": "month",218            "bucket": "month",219            "column": "date"220          },221          "sort": [222            {223              "column": "month"224            }225          ],226          "table": "expenses"227        }228      },229      "provenance": {230        "generated": true,231        "source": "agent"232      },233      "schemaVersion": 1,234      "type": "prism.data.query",235      "version": 1236    },237    {238      "children": [239        "root"240      ],241      "id": "expenses_page",242      "name": "Expenses",243      "props": {244        "icon": "creditcard"245      },246      "provenance": {247        "source": "agent"248      },249      "schemaVersion": 1,250      "type": "prism.page",251      "version": 1252    },253    {254      "children": [255        "toolbar",256        "stats_row",257        "chart_card",258        "main_split",259        "notifications"260      ],261      "id": "root",262      "props": {263        "align": "stretch",264        "grow": true,265        "padding": 16,266        "spacing": 12267      },268      "provenance": {269        "source": "agent"270      },271      "schemaVersion": 1,272      "type": "prism.stack",273      "version": 1274    },275    {276      "children": [277        "search_box",278        "category_filter",279        "new_expense_btn",280        "csv_import"281      ],282      "id": "toolbar",283      "provenance": {284        "source": "agent"285      },286      "schemaVersion": 1,287      "type": "prism.toolbar",288      "version": 1289    },290    {291      "children": [292        "total_stat",293        "count_stat",294        "avg_month_stat"295      ],296      "id": "stats_row",297      "props": {298        "align": "stretch",299        "direction": "horizontal",300        "spacing": 12301      },302      "provenance": {303        "source": "agent"304      },305      "schemaVersion": 1,306      "type": "prism.stack",307      "version": 1308    },309    {310      "children": [311        "monthly_chart"312      ],313      "id": "chart_card",314      "props": {315        "title": "Spending per month"316      },317      "provenance": {318        "source": "agent"319      },320      "schemaVersion": 1,321      "type": "prism.card",322      "version": 1323    },324    {325      "children": [326        "expense_table",327        "editor_card"328      ],329      "id": "main_split",330      "props": {331        "direction": "horizontal",332        "grow": true333      },334      "provenance": {335        "source": "agent"336      },337      "schemaVersion": 1,338      "type": "prism.split",339      "version": 1340    },341    {342      "id": "notifications",343      "provenance": {344        "source": "agent"345      },346      "schemaVersion": 1,347      "type": "prism.notification",348      "version": 1349    },350    {351      "id": "search_box",352      "props": {353        "accessibilityLabel": "Search expenses by description",354        "placeholder": "Search descriptions",355        "value": {356          "$bind": "searchText"357        },358        "width": 240359      },360      "provenance": {361        "source": "agent"362      },363      "schemaVersion": 1,364      "type": "prism.search",365      "version": 1366    },367    {368      "id": "category_filter",369      "props": {370        "includeAll": "All",371        "label": "Category",372        "options": [373          "Groceries",374          "Dining",375          "Transport",376          "Housing",377          "Utilities",378          "Entertainment",379          "Health",380          "Shopping",381          "Other"382        ],383        "value": {384          "$bind": "categoryFilter"385        }386      },387      "provenance": {388        "source": "agent"389      },390      "schemaVersion": 1,391      "type": "prism.dropdown",392      "version": 1393    },394    {395      "events": {396        "click": [397          {398            "key": "selectedExpenseId",399            "type": "setState",400            "value": ""401          }402        ]403      },404      "id": "new_expense_btn",405      "props": {406        "icon": "plus",407        "style": "primary",408        "title": "New Expense"409      },410      "provenance": {411        "source": "agent"412      },413      "schemaVersion": 1,414      "type": "prism.button",415      "version": 1416    },417    {418      "dependencies": [419        "expenses"420      ],421      "events": {422        "imported": [423          {424            "message": "CSV import finished.",425            "tone": "success",426            "type": "showNotification"427          }428        ]429      },430      "id": "csv_import",431      "props": {432        "help": "CSV columns: date, description, category, amount",433        "table": "expenses",434        "title": "Import CSV…"435      },436      "provenance": {437        "source": "agent"438      },439      "schemaVersion": 1,440      "type": "prism.csvImport",441      "version": 1442    },443    {444      "id": "total_stat",445      "props": {446        "format": "currency",447        "grow": true,448        "icon": "sum",449        "label": {450          "$expr": "state.categoryFilter == 'All' ? 'Total spent' : concat('Total spent: ', state.categoryFilter)"451        },452        "tone": "accent",453        "value": {454          "$expr": "sum(queries.filtered_expenses, 'amount')"455        }456      },457      "provenance": {458        "source": "agent"459      },460      "schemaVersion": 1,461      "type": "prism.aggregation",462      "version": 1463    },464    {465      "id": "count_stat",466      "props": {467        "format": "number",468        "grow": true,469        "icon": "list.bullet",470        "label": "Expenses shown",471        "value": {472          "$expr": "count(queries.filtered_expenses)"473        }474      },475      "provenance": {476        "source": "agent"477      },478      "schemaVersion": 1,479      "type": "prism.aggregation",480      "version": 1481    },482    {483      "id": "avg_month_stat",484      "props": {485        "format": "currency",486        "grow": true,487        "icon": "calendar",488        "label": "Average per month",489        "value": {490          "$expr": "isEmpty(queries.monthly_totals) ? 0 : avg(queries.monthly_totals, 'total')"491        }492      },493      "provenance": {494        "source": "agent"495      },496      "schemaVersion": 1,497      "type": "prism.aggregation",498      "version": 1499    },500    {501      "id": "monthly_chart",502      "props": {503        "format": "currency",504        "height": 200,505        "query": {506          "$ref": "monthly_totals"507        },508        "title": {509          "$expr": "state.categoryFilter == 'All' ? 'All categories' : state.categoryFilter"510        },511        "tone": "accent",512        "x": "month",513        "y": "total"514      },515      "provenance": {516        "source": "agent"517      },518      "schemaVersion": 1,519      "type": "prism.chart.bar",520      "version": 1521    },522    {523      "id": "expense_table",524      "props": {525        "columns": [526          {527            "column": "date",528            "format": "date",529            "title": "Date"530          },531          {532            "column": "description",533            "title": "Description"534          },535          {536            "column": "category",537            "format": "badge",538            "title": "Category"539          },540          {541            "align": "trailing",542            "column": "amount",543            "format": "currency",544            "title": "Amount"545          }546        ],547        "emptyMessage": "Add an expense, import a CSV, or change the filters.",548        "emptyTitle": "No expenses",549        "grow": true,550        "query": {551          "$ref": "filtered_expenses"552        },553        "selection": {554          "$bind": "selectedExpenseId"555        }556      },557      "provenance": {558        "source": "agent"559      },560      "schemaVersion": 1,561      "type": "prism.table",562      "version": 1563    },564    {565      "children": [566        "expense_editor"567      ],568      "id": "editor_card",569      "props": {570        "title": {571          "$expr": "isEmpty(state.selectedExpenseId) ? 'New expense' : 'Edit expense'"572        },573        "width": 320574      },575      "provenance": {576        "source": "agent"577      },578      "schemaVersion": 1,579      "type": "prism.card",580      "version": 1581    },582    {583      "dependencies": [584        "expenses"585      ],586      "events": {587        "cancelled": [588          {589            "key": "selectedExpenseId",590            "type": "setState",591            "value": ""592          }593        ],594        "deleted": [595          {596            "message": "Expense deleted.",597            "tone": "info",598            "type": "showNotification"599          },600          {601            "key": "selectedExpenseId",602            "type": "setState",603            "value": ""604          }605        ],606        "saved": [607          {608            "message": "Expense saved.",609            "tone": "success",610            "type": "showNotification"611          },612          {613            "key": "selectedExpenseId",614            "type": "setState",615            "value": ""616          }617        ]618      },619      "id": "expense_editor",620      "props": {621        "allowDelete": true,622        "fields": [623          "date",624          "description",625          "category",626          "amount"627        ],628        "recordId": {629          "$bind": "selectedExpenseId"630        },631        "submitTitle": {632          "$expr": "isEmpty(state.selectedExpenseId) ? 'Add Expense' : 'Save Changes'"633        },634        "table": "expenses"635      },636      "provenance": {637        "source": "agent"638      },639      "schemaVersion": 1,640      "type": "prism.recordEditor",641      "version": 1642    }643  ],644  "permissions": [645    "storage.local",646    "files.import.userSelected"647  ],648  "schemaVersion": 1,649  "state": {650    "categoryFilter": "All",651    "searchText": "",652    "selectedExpenseId": ""653  },654  "summary": "A local expense tracker with CSV import, category filtering, a monthly spending chart and persistent storage.",655  "version": 1656}
Files main
Menu

Theme