Repository Public License
1{2 "entrypoint": "expensesPage",3 "id": "app_prj_r2w7yxckdo",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": 55,57 "category": "Transport",58 "date": "2025-01-09",59 "description": "Train pass"60 },61 {62 "amount": 1200,63 "category": "Housing",64 "date": "2025-01-15",65 "description": "Rent"66 },67 {68 "amount": 32.5,69 "category": "Dining",70 "date": "2025-01-22",71 "description": "Pizza night"72 },73 {74 "amount": 74.2,75 "category": "Utilities",76 "date": "2025-02-03",77 "description": "Electricity bill"78 },79 {80 "amount": 102.15,81 "category": "Groceries",82 "date": "2025-02-11",83 "description": "Supermarket"84 },85 {86 "amount": 1200,87 "category": "Housing",88 "date": "2025-02-15",89 "description": "Rent"90 },91 {92 "amount": 24,93 "category": "Entertainment",94 "date": "2025-02-20",95 "description": "Cinema"96 },97 {98 "amount": 18.9,99 "category": "Health",100 "date": "2025-03-02",101 "description": "Pharmacy"102 },103 {104 "amount": 91.3,105 "category": "Groceries",106 "date": "2025-03-08",107 "description": "Supermarket"108 },109 {110 "amount": 1200,111 "category": "Housing",112 "date": "2025-03-15",113 "description": "Rent"114 },115 {116 "amount": 119.99,117 "category": "Shopping",118 "date": "2025-03-19",119 "description": "Running shoes"120 }121 ]122 },123 "provenance": {124 "source": "agent"125 },126 "schemaVersion": 1,127 "type": "prism.data.table",128 "version": 1129 },130 {131 "children": [132 "root"133 ],134 "id": "expensesPage",135 "name": "Expenses",136 "props": {137 "icon": "creditcard"138 },139 "provenance": {140 "source": "agent"141 },142 "schemaVersion": 1,143 "type": "prism.page",144 "version": 1145 },146 {147 "children": [148 "toolbar",149 "budgetAlert",150 "chartsGrid",151 "mainSplit",152 "notifications"153 ],154 "id": "root",155 "props": {156 "align": "stretch",157 "grow": true,158 "padding": 16159 },160 "provenance": {161 "source": "agent"162 },163 "schemaVersion": 1,164 "type": "prism.stack",165 "version": 1166 },167 {168 "children": [169 "categoryFilter",170 "budgetField",171 "importCsv",172 "newExpense"173 ],174 "id": "toolbar",175 "provenance": {176 "source": "agent"177 },178 "schemaVersion": 1,179 "type": "prism.toolbar",180 "version": 1181 },182 {183 "dependencies": [184 "expenses"185 ],186 "id": "monthlyChart",187 "props": {188 "format": "currency",189 "height": 220,190 "query": {191 "aggregates": [192 {193 "as": "total",194 "column": "amount",195 "fn": "sum"196 }197 ],198 "filters": [199 {200 "column": "category",201 "op": "eq",202 "unless": "state.categoryFilter == 'All'",203 "value": {204 "$expr": "state.categoryFilter"205 }206 }207 ],208 "groupBy": {209 "as": "month",210 "bucket": "month",211 "column": "date"212 },213 "sort": [214 {215 "column": "month"216 }217 ],218 "table": "expenses"219 },220 "title": {221 "$expr": "state.categoryFilter == 'All' ? 'Spending per month' : concat('Spending per month: ', state.categoryFilter)"222 },223 "tone": "accent",224 "x": "month",225 "y": "total"226 },227 "provenance": {228 "source": "agent"229 },230 "schemaVersion": 1,231 "type": "prism.chart.bar",232 "version": 1233 },234 {235 "children": [236 "expenseTable",237 "editorCard"238 ],239 "id": "mainSplit",240 "props": {241 "direction": "horizontal",242 "grow": true243 },244 "provenance": {245 "source": "agent"246 },247 "schemaVersion": 1,248 "type": "prism.split",249 "version": 1250 },251 {252 "id": "categoryFilter",253 "props": {254 "includeAll": "All",255 "label": "Category",256 "optionsFrom": {257 "column": "category",258 "table": "expenses"259 },260 "value": {261 "$bind": "categoryFilter"262 },263 "width": 220264 },265 "provenance": {266 "source": "agent"267 },268 "schemaVersion": 1,269 "type": "prism.dropdown",270 "version": 1271 },272 {273 "dependencies": [274 "expenses"275 ],276 "events": {277 "imported": [278 {279 "message": "Expenses imported.",280 "tone": "success",281 "type": "showNotification"282 }283 ]284 },285 "id": "importCsv",286 "props": {287 "table": "expenses",288 "title": "Import CSV…"289 },290 "provenance": {291 "source": "agent"292 },293 "schemaVersion": 1,294 "type": "prism.csvImport",295 "version": 1296 },297 {298 "events": {299 "click": [300 {301 "key": "selectedExpense",302 "type": "setState",303 "value": ""304 }305 ]306 },307 "id": "newExpense",308 "props": {309 "icon": "plus",310 "style": "primary",311 "title": "New Expense"312 },313 "provenance": {314 "source": "agent"315 },316 "schemaVersion": 1,317 "type": "prism.button",318 "version": 1319 },320 {321 "dependencies": [322 "expenses"323 ],324 "id": "expenseTable",325 "props": {326 "columns": [327 {328 "column": "date",329 "format": "date",330 "title": "Date"331 },332 {333 "column": "description",334 "title": "Description"335 },336 {337 "column": "category",338 "format": "badge",339 "title": "Category"340 },341 {342 "align": "trailing",343 "column": "amount",344 "format": "currency",345 "title": "Amount"346 }347 ],348 "emptyMessage": "Import a CSV file or add an expense to get started.",349 "emptyTitle": "No expenses",350 "grow": true,351 "query": {352 "filters": [353 {354 "column": "category",355 "op": "eq",356 "unless": "state.categoryFilter == 'All'",357 "value": {358 "$expr": "state.categoryFilter"359 }360 }361 ],362 "sort": [363 {364 "column": "date",365 "descending": true366 }367 ],368 "table": "expenses"369 },370 "selection": {371 "$bind": "selectedExpense"372 }373 },374 "provenance": {375 "source": "agent"376 },377 "schemaVersion": 1,378 "type": "prism.table",379 "version": 1380 },381 {382 "children": [383 "expenseEditor"384 ],385 "id": "editorCard",386 "props": {387 "title": {388 "$expr": "isEmpty(state.selectedExpense) ? 'New expense' : 'Edit expense'"389 },390 "width": 320391 },392 "provenance": {393 "source": "agent"394 },395 "schemaVersion": 1,396 "type": "prism.card",397 "version": 1398 },399 {400 "dependencies": [401 "expenses"402 ],403 "events": {404 "cancelled": [405 {406 "key": "selectedExpense",407 "type": "setState",408 "value": ""409 }410 ],411 "deleted": [412 {413 "key": "selectedExpense",414 "type": "setState",415 "value": ""416 },417 {418 "message": "Expense deleted.",419 "tone": "info",420 "type": "showNotification"421 }422 ],423 "saved": [424 {425 "key": "selectedExpense",426 "type": "setState",427 "value": ""428 },429 {430 "message": "Expense saved.",431 "tone": "success",432 "type": "showNotification"433 }434 ]435 },436 "id": "expenseEditor",437 "props": {438 "allowDelete": true,439 "fields": [440 "date",441 "description",442 "category",443 "amount"444 ],445 "recordId": {446 "$bind": "selectedExpense"447 },448 "submitTitle": {449 "$expr": "isEmpty(state.selectedExpense) ? 'Add Expense' : 'Save Changes'"450 },451 "table": "expenses"452 },453 "provenance": {454 "source": "agent"455 },456 "schemaVersion": 1,457 "type": "prism.recordEditor",458 "version": 1459 },460 {461 "id": "notifications",462 "provenance": {463 "source": "agent"464 },465 "schemaVersion": 1,466 "type": "prism.notification",467 "version": 1468 },469 {470 "dependencies": [471 "expenses"472 ],473 "id": "current_month_total",474 "name": "Spending this month",475 "props": {476 "query": {477 "aggregates": [478 {479 "as": "total",480 "column": "amount",481 "fn": "sum"482 }483 ],484 "filters": [485 {486 "column": "date",487 "op": "startsWith",488 "value": {489 "$expr": "month(today())"490 }491 }492 ],493 "table": "expenses"494 }495 },496 "provenance": {497 "generated": true,498 "source": "agent"499 },500 "schemaVersion": 1,501 "type": "prism.data.query",502 "version": 1503 },504 {505 "id": "budgetField",506 "props": {507 "label": "Monthly budget",508 "value": {509 "$bind": "monthlyBudget"510 },511 "width": 160512 },513 "provenance": {514 "source": "agent"515 },516 "schemaVersion": 1,517 "type": "prism.currencyField",518 "version": 1519 },520 {521 "id": "budgetAlert",522 "props": {523 "message": {524 "$expr": "concat('You have spent ', formatCurrency(coalesce(sum(queries.current_month_total, 'total'), 0)), ' this month, ', formatCurrency(coalesce(sum(queries.current_month_total, 'total'), 0) - state.monthlyBudget), ' over your budget of ', formatCurrency(state.monthlyBudget), '.')"525 },526 "title": "Over budget this month",527 "tone": "danger",528 "visible": {529 "$expr": "state.monthlyBudget > 0 && coalesce(sum(queries.current_month_total, 'total'), 0) > state.monthlyBudget"530 }531 },532 "provenance": {533 "source": "agent"534 },535 "schemaVersion": 1,536 "type": "prism.alert",537 "version": 1538 },539 {540 "children": [541 "monthlyChart",542 "categoryChart"543 ],544 "id": "chartsGrid",545 "props": {546 "columns": 2,547 "spacing": 12548 },549 "provenance": {550 "source": "agent"551 },552 "schemaVersion": 1,553 "type": "prism.grid",554 "version": 1555 },556 {557 "dependencies": [558 "expenses"559 ],560 "id": "categoryChart",561 "props": {562 "donut": true,563 "format": "currency",564 "height": 220,565 "label": "category",566 "query": {567 "aggregates": [568 {569 "as": "total",570 "column": "amount",571 "fn": "sum"572 }573 ],574 "groupBy": {575 "as": "category",576 "bucket": "none",577 "column": "category"578 },579 "sort": [580 {581 "column": "total",582 "descending": true583 }584 ],585 "table": "expenses"586 },587 "title": "Spending by category",588 "value": "total"589 },590 "provenance": {591 "source": "agent"592 },593 "schemaVersion": 1,594 "type": "prism.chart.pie",595 "version": 1596 }597 ],598 "permissions": [599 "storage.local",600 "files.import.userSelected"601 ],602 "schemaVersion": 1,603 "state": {604 "categoryFilter": "All",605 "monthlyBudget": 2000,606 "selectedExpense": ""607 },608 "summary": "A local expense tracker with CSV import, category filtering, a monthly spending chart and on-device storage.",609 "version": 2610}