Home
Softono
fintrack-backend

fintrack-backend

Open source MIT Go
23
Stars
6
Forks
0
Issues
0
Watchers
6 months
Last Commit

About fintrack-backend

fintrack-backend is a versatile Go-based personal financial management backend designed to support both desktop application and server-side deployment modes. Built with Wails, it serves as the core engine for tracking income and expenses, offering features such as bill recording, category statistics, and in-depth data analysis. The system integrates seamlessly with a Vue3 frontend to enable the import and visualization of statements from major payment platforms like Alipay and WeChat. Security is prioritized through a hybrid RSA and AES encryption scheme, while built-in internationalization supports both English and Chinese interfaces. An innovative AI feature leverages DeepSeek to automatically categorize transactions and generate financial reports. The project utilizes a unified Makefile workflow for streamlined dependency management, code formatting, testing, and building of cross-platform desktop clients (Windows, macOS, Linux) or standalone server binaries. It employs SQLite for data storage and includes

Platforms

Web Self-hosted

Languages

Go

Links

🧾 FinBoard Backend

Shop

基于 Go + Wails 开发的个人财务管理应用后端,支持 桌面应用模式服务端模式,可配合前端进行账单导入、统计与分析。

本项目已经经由 Zread 解析完成,如果需要快速了解项目,可以点击此处进行查看:了解本项目


✨ 功能亮点

  • 🖥️ 桌面应用模式:Wails 打包的跨平台桌面客户端
  • 🌐 服务端模式:Web API 服务,可部署到服务器使用
  • 🔐 安全加密:支持 RSA + AES 混合加密,保障数据安全
  • 🌍 国际化支持:内置中英文多语言切换
  • 📊 账单管理:支持支付宝/微信账单导入与可视化分析
  • 🤖 AI 报告:通过 DeepSeek 整理账单类型,对账单进行分析

首次启动建议执行:

make deps   # 同步 go mod 依赖
make help   # 查看所有可用任务

🚀 使用 Makefile 的统一工作流

指令 说明
make deps 安装 / 更新 Go 依赖
make fmt 格式化后端 Go 代码
make test 运行全部单元测试
make run-server 启动服务端开发模式(go run . -server
make dev-desktop 启动 Wails 热重载调试
make build-server 输出 build/bin/finance-tracker-server
make build-desktop 构建桌面客户端(Windows/macOS/Linux)
make build-all 同时完成服务端与桌面产物
make clean 清除由 Makefile 生成的构建目录

所有构建与运行步骤都无需再调用 build.sh,统一通过 Makefile 即可。


⚙️ 配置与密钥

  1. 将根目录的 config.yaml.example 复制到 configs/config.yaml,按需修改:
    database:
      sqlite_path: "data/database"
    jwt:
      secret: "替换为自己的随机字符串"
      access_token_exp: 15m
      refresh_token_exp: 168h
  2. 生成 RSA 私钥 private.pem 并放在项目根目录,前端需对应 public_key.pem
    openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
    openssl pkey -in private.pem -pubout -out frontend/public/public_key.pem

🧑‍💻 开发调试

make run-server   # 以 REST API 模式运行,默认端口 9090
make dev-desktop  # 桌面开发模式,自动注入 frontend/build 资源

📂 项目结构

.
├── app.go                  # Wails App 实例
├── main.go                 # 入口
├── Makefile                # 统一运行 / 构建入口
├── configs/
│   └── config.yaml         # 运行时配置
├── config.yaml.example     # 配置模板
├── data/
│   ├── database/           # SQLite 文件
│   └── uploads/            # 原始账单/附件
├── frontend/build/         # Vue3 + Vuetify 打包结果
├── internal/
│   ├── dto/                # 结构体定义目录
│   ├── handler/            # HTTP处理器(等同于Controller)
│   ├── model/              # 数据模型
│   ├── repository/         # 数据模型访问层
│   ├── router/             # 路由
│   └── service/            # 业务逻辑层
├── pkg/
│   ├── config/             # 配置
│   ├── i18n/               # 多语言
│   ├── jwt/                # JWT
│   ├── middleware/         # 中间件
│   └── utils/              # 通用工具
└── wails.json              # 桌面客户端配置

🚢 构建与部署

服务端

make build-server
./build/bin/finance-tracker-server -server
# 默认监听 http://0.0.0.0:9090

桌面客户端

make build-desktop
# macOS 产物:build/bin/FinBoard.app
# Windows 产物:build/bin/FinBoard.exe

macOS 未签名的应用需执行:

xattr -d com.apple.quarantine build/bin/FinBoard.app

欢迎提交 Issue / PR,一起完善 FinBoard 的记账体验 🙌