|
1 | | -# EzClaim 管理后台 |
| 1 | +# ACSSZ EzClaim Server |
2 | 2 |
|
3 | | -Next.js 14 构建的 EzClaim 管理端,提供管理员登录、标签管理、报销单审批以及审计事件查询等能力。后端接口基于项目根目录的 `api.json` (OpenAPI 3.1)。 |
| 3 | +## Overview |
| 4 | +The ACSSZ EzClaim platform powers reimbursement for the Association of Chinese Students and Scholars in Zurich. The server provides a secure REST API that replaces manual bookkeeping with automated claim processing, audit logging, and attachment handling. |
4 | 5 |
|
5 | | -## 功能亮点 |
6 | | - |
7 | | -- 🔐 管理员登录,使用 JWT 存储于 HttpOnly Cookie |
8 | | -- 🏷️ 标签管理:创建、查看、删除标签 |
9 | | -- 💼 报销单管理:支持搜索、筛选、排序,状态流转遵守服务端规则 |
10 | | -- 📊 实时概览:按状态统计报销单数量 |
11 | | -- 🛠️ 审计事件查询:多条件过滤、分页展示、详细 JSON 查看 |
12 | | - |
13 | | -## 快速开始 |
14 | | - |
15 | | -```bash |
16 | | -npm install |
17 | | -npm run dev |
18 | | -``` |
19 | | - |
20 | | -默认后端地址为 `http://localhost:8080`,如需修改可在启动前设置: |
| 6 | +## Highlights |
| 7 | +- Spring Boot 3 service with MongoDB persistence and Kafka-based audit ingestion |
| 8 | +- JWT-protected endpoints for claim, tag, photo, and audit management |
| 9 | +- S3-compatible object storage integration for receipt uploads and presigned URLs |
| 10 | +- Comprehensive OpenAPI definition (`api.json`) shared across the web and admin clients |
21 | 11 |
|
| 12 | +## Getting Started |
22 | 13 | ```bash |
23 | | -export API_BASE_URL="http://your-backend:8080" |
| 14 | +./mvnw spring-boot:run |
24 | 15 | ``` |
| 16 | +The dev profile expects MongoDB, Kafka/Redpanda, and an S3-compatible store (see `docker-compose.dev.yml`). Generated OpenAPI can be viewed at `http://localhost:8080/swagger-ui/index.html` once the service is running. |
25 | 17 |
|
26 | | -或在 `.env.local` 中声明 `API_BASE_URL`/`NEXT_PUBLIC_API_BASE_URL`。 |
27 | | - |
28 | | -## 运行前提 |
29 | | - |
30 | | -- Node.js 18+ |
31 | | -- 后端服务(默认端口 8080,可通过 `api.json` 查看接口定义) |
32 | | -- Demo 账户:`admin / ezclaim-password` 或 `reader / reader-pass` |
33 | | - |
34 | | -## 脚本 |
35 | | - |
36 | | -| 命令 | 说明 | |
37 | | -| ------------ | -------------------- | |
38 | | -| `npm run dev` | 开发模式 (`localhost:3000`) | |
39 | | -| `npm run build` | 生产构建 | |
40 | | -| `npm run start` | 启动生产环境服务器 | |
41 | | -| `npm run lint` | 执行 ESLint 检查 | |
42 | | - |
43 | | -## 目录结构 |
44 | | - |
45 | | -``` |
46 | | -app/ # App Router 路由 |
47 | | - (auth)/login # 登录页 |
48 | | - (dashboard)/ # 受保护的业务页面 |
49 | | -components/ # UI 组件与布局 |
50 | | -lib/ # API 客户端、配置、工具函数 |
51 | | -middleware.ts # 保护路由的中间件 |
52 | | -``` |
53 | | - |
54 | | -## 认证机制 |
55 | | - |
56 | | -- 登录后通过服务端调用 `/api/auth/login` 获取 JWT |
57 | | -- Token 以 HttpOnly Cookie (`ezclaim_token`) 形式存储 |
58 | | -- `middleware.ts` 拦截未登录访问并重定向至 `/login` |
59 | | - |
60 | | -## 注意事项 |
61 | | - |
62 | | -- 所有与后端交互的操作使用 Next.js Server Actions,并在成功后 `router.refresh()` + `revalidatePath` |
63 | | -- 报销单状态流转遵循后端 `ClaimService` 的约束: |
64 | | - - `SUBMITTED → APPROVED/REJECTED` |
65 | | - - `APPROVED → PAID/REJECTED` |
66 | | -- `Audit Events` 页面采用 GET 参数驱动,可直接分享链接复现查询条件 |
67 | | - |
68 | | -欢迎根据业务需要扩展更多管理能力,例如报销单详情编辑、批量操作等。 |
| 18 | +## License |
| 19 | +Licensed under the Do What The Fuck You Want To Public License (WTFPL). See [`LICENCE`](LICENCE). |
0 commit comments