Give your agent a wallet you control.
Let your agents pay online using one-time-use cards or with machine payment protocols. You approve every request.
A students-AI develop Financial website-based software, predict your financial situation in details based on your cash flow.
Translation pending
FinanceJavaScript · HTMLGitHub @xbl2602OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗Personal Budget Tracker — Zero-dependency single-page HTML app. Fully offline, runs entirely in your browser.
Screenshots coming soon. Open
index.htmlin your browser to see the app in action.
记账软件 · Budget App is a personal budget tracking tool designed for everyday use. It stores all your records, categories, budgets, and savings targets entirely in your browser's localStorage — no server, no sign-up, and by default no data leaves your machine (an opt-in, end-to-end-encrypted cloud sync lives in Settings and does nothing until you turn it on). Packaged as a single offline HTML file with zero external dependencies, it is ready to run the moment you open it in a modern browser.
本项目的全部代码(HTML / CSS / JavaScript)均由 AI Agent(大型语言模型)生成、审查、修改和完善。
作者(即仓库所有者)的角色仅限于:
作者不具备专业软件开发背景,本项目为个人学习和日常使用目的而创建。公开此项目的目的是分享设计思路和展示 AI 辅助开发的可行性,而非提供专业级软件解决方案。
请在使用本软件前仔细阅读以下条款。使用即表示您理解并同意以下内容。
本软件的全部代码由 AI Agent 自动生成,未经传统人工安全审计和专业代码审查。可能存在但不限于以下问题:
请在使用前自行评估风险,尤其涉及重要数据时须谨慎。
本软件中的所有数学计算(包括但不限于预算汇总、储蓄预测、预算使用率、统计图表数据、月度报告等)均不保证绝对真实性和准确性。所有数据仅供个人参考,不应作为任何财务决策的唯一依据。
本软件不构成任何形式的财务、税务或投资建议。如有专业财务管理需求,请咨询持牌财务顾问、会计师或相关专业人士。
本项目不符合任何财务 / 会计行业合规标准、审计标准或监管要求。不适用于需要合规认证的业务场景。
localStorage 中,不提供加密保护本软件按「原样」(AS IS)提供,作者不作任何明示或默示的担保,包括但不限于适销性、特定用途适用性和不侵权的担保。
在任何情况下,作者均不对因使用或无法使用本软件而产生的任何数据丢失或财务损失承担责任,即使已被告知此类损失的可能性。
Monthly spending summary with budget and savings progress rings rendered on Canvas. Includes a 7-day spending sparkline, top 5 spending categories, overspend warnings, and a savings prediction engine that supports dual daily limit calculations.
Quick entry with an expense / income switch, automatic RM currency prefix, a tree-based category picker (emoji + color), date/time fields, and notes. Input validation with shake animation feedback.
Money coming in gets its own half of the ledger. Pick 收入 on the add or edit form and the picker switches to an income category tree — seeded with 工资(月薪 / 奖金 / 加班津贴)、副业(接单 / 卖闲置)、报销退款、理财收益、其他收入, all editable like any other category. Income never touches a spending number: daily averages, category charts, budgets, overspend warnings, heatmap and What-If all keep counting expenses only. What it does feed is the other half — the overview, statistics and report each gained an income / spending / net row, the six-month trend chart gained a green income line, and income rows show green with a leading + in the ledger. Recorded income is deliberately kept separate from the 月收入 setting, which stays a per-month declaration that drives the budget chain.
Advanced multi-filter system supporting keyword, category, date range, amount range, overspent-only and 支出 / 收入 type filters. Multi-level sorting (by date, amount, note, or category name). Toggle between compact and card views. Batch operations for delete and recategorization. Soft delete with a 5-second undo window.
Infinite nesting tree with accordion UI, split into a 支出分类 and a 收入分类 tree. Set per-category budgets in RM or percentage on expenses; income rows show what actually arrived this month instead — there is no such thing as overspending your salary. Inline budget editing with parent-child budget validation. Merge categories, move nodes with cycle detection, pick from 14 preset colors, and choose emoji icons. Merging and moving never cross the two trees, because that would silently re-type every record underneath.
Reorder with ⬆️ / ⬇️ on every row — roots and subcategories alike, greyed out at the ends of the list. The order lives on the category (sortOrder), so it is part of the ledger, travels through cloud sync and LAN sync, and the other device pulls it already in the order you set. Reordering never renumbers across the two trees, and the whole sibling list is renumbered 0..n-1 so two devices can't end up rendering the same data in different orders.
Every "pick a category" surface — new record, edit record, the records filter, batch recategorisation, and the merge/move target pickers — is the same component: collapsed by default, opened one branch at a time with the same ▶ affordance as the categories page, plus a search box. Typing a category name or an emoji filters the tree, force-expands every ancestor so the hits are actually visible, counts the hits on each ancestor row, and highlights the matched run. Expansion is remembered for the session, so drilling into 餐饮 › 午餐 to set a budget does not have to be redone on the next record. Clicks are handled by one delegated listener, so no category id is ever interpolated into an onclick attribute.
Interactive Canvas charts — elastic animated pie chart with hover pop-out and full drill-down (switchable to a waffle grid where one block = a fixed amount, or a nested treemap where area = spend and boxes nest to show the category hierarchy), animated line chart, bar chart with drill-down, and a calendar heatmap with 6-color gradient. Month-over-month comparison, 6-month trends, and a dedicated savings chart. All charts downloadable as PNG. Custom date range analysis included.
Print-optimized monthly summary featuring budget and savings rings, a category breakdown table, a spending sparkline, and natural language savings prediction.
Adjust future spending assumptions per category with modes: keep trend, set daily limit, fix remaining total, percentage change, adjust by amount, or zero out. Compare projections against current trends with visual savings bars and ring charts. Supports hypothetical new categories and global adjustments.
Mark a record as a split bill, pick who was in on it, and let the total divide evenly or by amounts you set per person — including "amount unknown" for anyone whose share isn't settled yet, yourself included. The Collection Center tracks who still owes what, by person or by bill. Repayments are amounts, not checkboxes: tick for a full settle, or record a partial. One lump sum can clear several bills at once — select bills (all / none / invert) and spread the money evenly, oldest-first, or by hand, with a live preview before anything is written. Settled bills can be archived or converted into a plain record.
Plan a large purchase in three modes: save up first (先攒后买), buy now and repay (先买后还), or a credit-card instalment (信用卡分期, which backfills real repayment records). The monthly instalment is deducted from your spendable budget, and the ledger is replayed month by month rather than stored — so skipping a month or editing an old record recalculates automatically. Overdue plans prompt to extend, pay off, or abandon. Custom emoji icon per plan.
Dark/light mode toggle, monthly budget configuration, 2-mode savings target (fixed amount or percentage). Export and import data via JSON (replace or merge), CSV, or Excel (XML Spreadsheet 2003 with 7 sheets and live formulas). Clear all data option available. LAN sync via WebRTC (same Wi-Fi, zero server). Optional cloud sync (off by default): no account — one recovery code; the ledger is encrypted on your device before upload; edits made on several devices are merged record-by-record instead of overwritten; the last few cloud versions are kept.
轻量级手机专用版本 money-wise-mobile.html,支持完整的记账增删改查、分类管理、JSON 导入导出。
适合在手机上快速记录,导出 JSON 后在主应用导入。单 HTML 文件,零依赖。
(id, arg, label),旧的 selectMergeTarget(catId, displayName) 把第二个参数当名字,所以名字一直是空的);openCatTreeModal 新增可选的 afterRender 钩子,每次重画页脚后由合并框重新同步按钮。回归网:tests/merge-category-test.js。一轮深度审计(计算、日期、措辞、安全)找出的问题,按"先止血、再核心数字、最后分摊与计划"修了三批,每条都先写会失败的测试再改。逐条编号、位置与验证方式见 audit-report/PROBLEMS.md(本地文件,未入库)。
version 会校验。合并分类时选自己的子分类不再卡死。batch1-fixes-test.js、batch2-dates-test.js、batch3-fixes-test.js、calc-consistency-test.js、xlsx-formula-test.js、xlsx-export-test.js、bill-group-drill-test.js;savings-forecast-test.js 等旧测试按新名字和新数字同步。预计结余 = 月收入 − 预计月末支出(已包含还没付的月账单,还没扣大额计划);预计储蓄 = 预计结余 − 存 / 还类计划预计拿走的部分(结算瀑布还债优先,余下的才算储蓄)。储蓄目标在 getSpendablePlan 里与大额计划是各自独立扣掉的预留,所以目标只能拿预计储蓄去比。新增 StatsEngine.getSavingsForecast(month) 返回 {surplus, planReserved, free, unpaidBills}(unpaidBills 只用于展示,已在预计支出里),总览 / 统计 / 报告 / 假设分析统一调它;PlanMath._allocate 抽出瀑布,getForecast 与 PlanMath.afterPlans(month, surplus) 共用,所以计划中心和各页的预计储蓄必然相等。有大额计划时目标环下多一行小字「预计结余 X − 计划存 / 还 Y」;信用卡分期的记录已在预计支出里,不会再从结余里扣第二次;假设分析的假设列用它自己的结余重算瀑布。没有大额计划时两个数相等,页面和以前一样。界面用语一律用大白话:「预计结余」→「月底预计剩余」、「预计还款」→「本月计划预计付出」、「预计月末支出」→「月底预计总花费(含固定账单)」,预测明细写「月账单 + 信用卡分期 + 大额消费 + 日常消费预估」,不出现「外推 / 趋势 / 瀑布」这类词。getPredictedMonthEndTotal / getPeriodPredictedMonthEndTotal 以前把已付账单当「每天花一点」按日均放大(3 号付 RM1000 房租,13 号预测里变 RM2400+),而月账单中心里设了金额、还没付的部分根本不在预测里(用户点「含固定账单」只看到大额数字在变,月账单一直没算)。现在按「含固定账单」开关自己对「固定」的定义拆成五个互不重叠的部分(_predictParts):bills 账单分类流水、billsUnpaid 月账单里计划了但还没付的(计划 − 已付,不为负)、instalments 信用卡分期流水(带 planId)、large 其余的不计日均大额、normal 日常消费(只有它按日均外推);之和恒等于预测数,关掉开关恰好少掉前三项。没付的月账单既然已在预测里,所有「收入 − 预测 − 未付账单」的地方(储蓄预测、计划中心、假设分析)都不再额外减一次,数字与以前一致,只是口径统一。明细行写「月账单 + 信用卡分期 + 大额消费 + 日常消费预估」。tests/savings-forecast-test.js(73 条,固定时钟,变异逐一验证会失败)。toggleOverviewBills),卡片上用胶囊写明当前状态(✅ 含固定账单 / ⬜ 不含固定账单)和「点一下改成…」;和预算进度卡片上的勾选框是同一个设置,两处互相同步,勾选框现在也会刷新上面的卡片(以前只重画圆环)。预测明细里数额为 0 的部分(如「已付账单 RM 0.00」)不再显示,只剩一项时整行隐藏;关掉固定账单后「本月总支出」下不再出现负数的「日常净支出」。onChartBlockClick);想看某个分类的流水,展开「分类明细」点对应的一行(showCategoryRecords),弹窗里原来的「下钻」按钮随之去掉。点到没有子分类的块(叶子分类、「…(直接)」、「月账单」、计划预计金额)会弹一条提示,不再没有反应;计划预计金额行没有流水,整行不可点。表格上方的提示文案同步改为「点击图上色块下钻 · 点击表格行查看明细」。billCategories,getCategory / getRootAncestorId 认不出,所以由 getMonthlyBillGroup 把它们合成这个父级(buildPieSliceRows / buildCategoryTreeNodes)。PlanMath.getVirtualDueByPlan,= 剩余金额 ÷ 剩余期数,还没发生)作为平级的单独块列出,先攒后买标「(预计存)」、先买后还标「(预计还)」;信用卡分期已有流水,不重复。tests/bill-toggle-test.js 同步覆盖。catWaffleChart,没有任何复选框控制它),一直停在「含账单」。现在 buildPieSliceRows 对饼图 / 格子图 / 矩形图 / 明细表统一读 pieChart 这一个开关,refreshPieChart 重画当前视图(updateDrillCharts)并刷新展开层与明细表。tests/bill-toggle-test.js 新增「真点开关」检查(矩形图 / 格子图 / 明细表,旧版会失败)。billCategories 里,getRootAncestorId / getCategory 认不出它,汇总到根分类时被悄悄丢掉,所以统计页的饼图 / 格子图 / 矩形图和总览前五分类从来没有账单,勾不勾都一样。现在勾选时每个账单是一个独立的顶层块(点击可看该账单流水),取消勾选去掉。StatsEngine.isFixedRecord(账单分类 或 带 planId 的分期流水),日常 / 固定的划分、日均、预测、日常支出、图表统一走它;getSpendablePlan 多返回 planDueCredit,日常可花预算先扣掉分期,所以「剩余日常」数字不变,只是取消勾选时分期不再算进日常。「已付账单 vs 计划账单」对账仍只看账单分类;报告页、假设分析 / 模拟器没有这个开关,口径不变。新增 tests/bill-toggle-test.js。23642 → RM 236.42,退格删最后一位,不需要小数点键。由新模块 src/js/08-money-input.js 在 document 上委托监听,带 data-money 的输入框即生效,渲染后才出现的弹窗也不用逐个接线;data-money="signed" 的框(假设分析的 ± 值、可负的金额)另有 ± 按钮。全应用的金额框都已转换:记账、编辑记录、预算(RM/% 可切换)、设置、假设分析、分摊(总额 / 各人份额 / 已收)、购物计划、云同步等。只有真正的键盘输入才会被改写,程序代码给输入框预填的值保持原样;粘贴的数字按数值解释(1,234.5 → 1234.50);光标点到数字中间也只在末尾追加。getPendingSummary 跳过已归档账单;「按人」隐藏已还清的人,「按账单」隐藏已收齐 / 已归档的账单;已结清 / 已归档账单集中放第三个标签,归档、删除、恢复入口保留。getDailyAverage:已过天数内我自己的支出(不含他人份额、不含勾了「不计日均」的记录)÷ 已过天数;有「不计日均」大额时句尾注明日均不含它。滚动 30 天的 getPeriodDailyAverage 之前漏了「不计日均」过滤与分摊他人份额扣除,同步修正。未改动:
money-wise-mobile.html(手机独立版)仍是旧的金额输入方式;编辑记录 / 分摊编辑器里的日期栏暂无前一天 / 后一天按钮。
#page-categories 的窄屏媒体查询内——桌面端、平板(>600px)和选分类弹窗(共用 .cat-header 类名)像素级不变。sortOrder 上——属于账本数据,云端 / 局域网同步一起带走,另一台设备拉下来就是排好的顺序。
parentId 都是 null,按全局排序会让一次按箭头把「工资」挪到「餐饮」旁边。sortOrder 一个字段,走一次 save(),所以三方合并把它当普通的逐条分类编辑处理,不需要任何特例。expandedCategories 一致。
onclick 属性。+。_defaults() 而不经过 _normalize(),因此新装的用户拿不到任何迁移结果——现在两条分支统一走 _normalize()。r1,"10.00",…)。一旦紧跟其后出现带引号的列,宽松的 CSV 解析器会把第一个逗号当数据,整行塌成一列——现在所有字段统一带引号。CompressionStream(Chrome 80+ / Safari 16.4+ / Firefox 113+,缺失时自动不压缩,但无法读取他人压缩过的版本)。DataStore._mergeData 现在也支持「有共同祖先」的三方合并(云端同步使用);无祖先时行为不变。# 1. 在 src/js/29-changelog.js 的 CHANGELOG 头部插入一条(新 id,填当前版本号)
# 2. 在该文件底部补对应的中英文 i18n
# 3 & 4. 构建 + 测试(测试会挡住 id 重复 / 日期顺序错 / 空条目 / 版本号超前)
bash build.sh && node tests/changelog-test.js
# 5. 只有真的要发新版时,才改 src/js/01-constants.js 的 APP_VERSION 与本文件的版本号
第 5 步是独立的一步:升版本号不会自动发公告,要公告就得插一条。
<input type="month">),带「本月 / 下月」快捷键与起止区间提示,金额 / 期数 / 月份均有边界校验。useCustomRange() 以「月份为空」作标记,而 renderStats() 开头会无条件把月份填回去,标记当场被冲掉。现已修复,范围内的统计、图表、明细表口径一致。min(96vw, 1500px) / 94vh,图表高度跟随视口(矩形图更高);修掉三处问题——多张图叠着显示(CSS 的 id 级 !important 压过内联样式)、明细表下钻失效(只重画了隐藏的画布)、以及 canvas 内部分辨率与显示尺寸不符导致的整体模糊。YYYY-MM-DD,而 App 存的是 2026-08-01T19:30 与 ISO 时间戳,每一条记录都被静默滤掉;replace 模式还会先清空本机。现已修复,并新增「全部被拒则中止同步、绝不清库」的安全网。updatedAt 新者胜。selfUnknown、payer(决定分摊金额口径)等改动指纹察觉不到。改为全量稳定序列化 + 排除名单,新增字段自动纳入,且与键序、数组顺序无关。planId 但计划已不存在的记录被直接删掉。改为解除关联,记录留下。src/, built into a single deployable HTML via build.sh.window.*) are shared across files, preventing global namespace pollution.escHtml) built in. The only network exception is connect-src for the single Supabase host used by the optional cloud sync.index.html (主应用) 或 money-wise-mobile.html (手机版)No installation, no server, no internet connection required after download.
# Clone the repository
git clone https://github.com/Xiaobailong788/budget-app.git
cd budget-app
# Build index.html from source files
bash build.sh
# Open index.html in your browser
# Edit src/css/*.css and src/js/*.js, then rebuild
The suites load the built index.html under jsdom, so always rebuild before running them — otherwise you are testing the previous build.
npm i --no-save jsdom # the only test dependency
bash build.sh # required first
for t in tests/*.js; do node "$t"; done # each file exits non-zero on failure
See the 测试 section in STRUCTURE.md for what each suite covers and the gotchas when adding new ones.
总览 (Overview) — Your landing dashboard. Review monthly totals, check your budget ring and savings ring, view the 7-day trend line, and see which categories are overspent.
记账 (Add Record) — Log a new expense by entering an amount, picking a category from the nested tree, setting a date and time, and optionally adding notes. The form validates your input and shakes on error.
流水 (Records) — Browse, search, and filter all your past expenses. Use the advanced filters to narrow results, switch between compact and card views, select multiple records for batch operations, or delete with a 5-second undo.
分类 (Categories) — Organize your spending categories in an infinitely nestable tree. Assign budgets per category, choose colors and emoji icons, merge duplicates, and move items with automatic cycle detection.
统计 (Statistics) — Explore your spending visually. Drill into pie chart slices, view trends on the line and bar charts, check your monthly heatmap, and export any chart as a PNG image.
月度报告 (Report) — Generate a print-friendly summary of any month. Use it for personal review or archiving.
假设分析 (What-If) — Run spending simulations by adjusting per-category assumptions. Compare projected savings against current trends with visual charts and detailed breakdowns.
设置 (Settings) — Configure your monthly budget, choose a savings target mode, toggle dark mode, and manage your data through JSON, CSV, or Excel export/import. Use LAN sync to transfer data between devices on the same Wi-Fi, or turn on the optional end-to-end-encrypted cloud sync (Settings → 云端同步) to keep several devices in step with one recovery code.
fetch to a Supabase Postgres RPC backend (supabase/migrations/), three-way merge on the clientbudget-app/
├── index.html # 构建产物(生成,直接用于浏览器 / GitHub Pages)
├── build.sh # 构建脚本:拼接 src/ → index.html
├── src/
│ ├── index.html # HTML 骨架(含 <!--build:css--> / <!--build:js--> 标记)
│ ├── css/ # 16 个 CSS 文件(变量、布局、组件、动画、响应式、引导、云同步…)
│ └── js/ # 28 个 JS 文件(按功能域拆分)
│ ├── 01-constants.js # 颜色表、默认分类
│ ├── 02-datastore.js # DataStore(localStorage CRUD)
│ ├── 03-excel-export.js # Excel XML 导出
│ ├── 04-stats-engine.js # 统计引擎
│ ├── 05-simulation-engine.js # 假设分析引擎
│ ├── 06-router.js # 页面导航
│ ├── 07-ui-core.js # 主题、Toast、Modal、工具函数
│ ├── 09-category-picker.js # 分类选择器
│ ├── 10-render-overview.js # 总览页
│ ├── 11-theme-colors.js # Canvas 主题色
│ ├── 12-budget-progress.js # 预算进度卡片
│ ├── 13-canvas-drawing.js # 环形图、迷你折线
│ ├── 14-render-add.js # 记账页
│ ├── 15-render-records.js # 流水页
│ ├── 16-render-categories.js # 分类页
│ ├── 17-stats-charts.js # 统计页 + 全部图表绘制
│ ├── 18-render-settings.js # 设置页
│ ├── 19-render-report.js # 月度报告
│ ├── 20-what-if.js # 假设分析
│ ├── 21-month-rollover.js # 月初结转
│ ├── 22-init.js # 初始化
│ ├── 23-lan-sync.js # WebRTC 局域网同步
│ ├── 24-diagnostics.js # 数据诊断工具(一致性检查、存储用量、审计日志)
│ ├── 25-page-guides.js # 页面引导系统(8 页简明/详尽双模式引导文案)
│ ├── 26-split-bills.js # 分摊收款系统(追账中心/分摊编辑器/部分还款/归档与转普通记账)
│ ├── 27-purchase-plans.js # 大额分期消费计划(先攒后买/先买后还/信用卡分期)
│ └── 28-cloud-sync.js # 可选云端同步(恢复码/端到端加密/三方合并/防护/界面)
├── supabase/migrations/ # 云端同步的数据库定义(私有 schema + RLS + 5 个 RPC)
├── tests/ # jsdom 测试套件(见 STRUCTURE.md 的「测试」章节)
├── money-wise-mobile.html # 手机版:轻量记账,支持导入导出JSON (~1,384 lines)
├── STRUCTURE.md # 完整函数地图(供 AI Agent 使用)
├── features/ # Feature docs (v2.0.0-era snapshots — see each file's header)
├── technical/ # Technical development logs (local only)
├── user/ # User-facing changelogs (local only)
└── logs/ # Consolidated project logs (local only)
| Browser | Support |
|---|---|
| Chrome | ✅ Full |
| Firefox | ✅ Full |
| Edge | ✅ Full |
| Safari | ✅ Full |
| Internet Explorer | ❌ Not supported |
Requires ES2020+ support. Modern browsers only. The optional cloud sync additionally needs Web Crypto (crypto.subtle, available on secure origins such as https or localhost); it is checked at run time and the toggle simply refuses to start where it is missing.
MIT License
Copyright (c) 2026
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.