Files
citywalk-stamp/README.md
YANG JIANKUAN 394b643304 refactor: 兑换机制改为一图章一奖品并引入库存
- 废弃 RedemptionRule(集 N 换 1),新增 Prize 表与 Stamp 1:1 关联
- Redemption 记录直接绑定到 stampId + prizeId + prizeName 快照
- 兑换事务用 updateMany + stock>0 条件作乐观锁
- 兑换后保留 Collection 记录,图章持续彩色点亮并标记"已兑换"
- 用户端入口改为点击已收集图章弹出兑换,库存为 0 时按钮禁用
- 管理后台删除 /admin/rules,奖品编辑嵌入 StampForm

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 15:30:28 +08:00

37 lines
908 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CityWalk 图章收集系统
游客在城市不同点位扫描二维码,收集图章,集满兑换奖品。兑换后图章清空,可重复挑战。
## 快速开始
```bash
pnpm install
cp .env.example .env
pnpm db:push
pnpm db:seed
# 启动(需同时运行)
pnpm dev:server # API :3000
pnpm dev:web # 前端 :5173
```
- 用户端http://localhost:5173
- 管理后台http://localhost:5173/admin密钥见 `.env``ADMIN_API_KEY`
## 技术栈
| 前端 | 后端 | 数据库 |
|------|------|--------|
| React 19 + Vite 8 + Tailwind CSS 4 | Express 5 + TypeScript | SQLite (Prisma) |
## 项目结构
```
packages/
shared/ Prisma client + 共享类型
server/ Express API认证、图章、兑换、管理
web/ React SPA移动端 H5 + PC 管理后台)
prisma/
schema.prisma 数据模型User, Stamp, Prize, Collection, Redemption
```