feat: 完善项目架构并增强分析页面功能

- 新增项目文档和 Docker 配置
  - 添加 README.md 和 TODO.md 项目文档
  - 为各服务添加 Dockerfile 和 docker-compose 配置

- 重构后端架构
  - 新增 adapter 层(HTTP/Python 适配器)
  - 新增 repository 层(数据访问抽象)
  - 新增 router 模块统一管理路由
  - 新增账单处理 handler

- 扩展前端 UI 组件库
  - 新增 Calendar、DateRangePicker、Drawer、Popover 等组件
  - 集成 shadcn-svelte 组件库

- 增强分析页面功能
  - 添加时间范围筛选器(支持本月默认值)
  - 修复 DateRangePicker 默认值显示问题
  - 优化数据获取和展示逻辑

- 完善分析器服务
  - 新增 FastAPI 服务接口
  - 改进账单清理器实现
This commit is contained in:
2026-01-10 01:15:52 +08:00
parent 94f8ea12e6
commit 087ae027cc
96 changed files with 4301 additions and 482 deletions

View File

@@ -1,4 +1,81 @@
services:
# SvelteKit 前端服务
web:
build:
context: ./web
dockerfile: Dockerfile
container_name: billai-web
restart: unless-stopped
ports:
- "3000:3000"
environment:
NODE_ENV: production
HOST: "0.0.0.0"
PORT: "3000"
# SSR 服务端请求后端的地址Docker 内部网络)
API_URL: "http://server:8080"
depends_on:
server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
# Go 后端服务
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: billai-server
restart: unless-stopped
ports:
- "8080:8080"
environment:
ANALYZER_URL: "http://analyzer:8001"
ANALYZER_MODE: "http"
MONGO_URI: "mongodb://admin:password@mongodb:27017"
MONGO_DATABASE: "billai"
volumes:
- ./server/uploads:/app/uploads
- ./server/outputs:/app/outputs
depends_on:
analyzer:
condition: service_healthy
mongodb:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Python 分析服务 (FastAPI)
analyzer:
build:
context: ./analyzer
dockerfile: Dockerfile
container_name: billai-analyzer
restart: unless-stopped
ports:
- "8001:8001"
environment:
ANALYZER_HOST: "0.0.0.0"
ANALYZER_PORT: "8001"
volumes:
# 共享数据目录,用于访问上传的文件
- ./server/uploads:/app/uploads
- ./server/outputs:/app/outputs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
mongodb:
image: mongo:8.0
container_name: billai-mongodb