feat: 盲盒房间体系重构 — 强制登录、独立房间、用户归属
- 新增 BlindBoxRoom/BlindBoxMember 模型,BlindBoxIdea 增加 userId/drawnById - 新增房间 API(创建/加入/列表/详情),所有盲盒 API 增加认证和成员校验 - 新建盲盒大厅页面(三层引导式设计:未登录氛围页/首次创建引导/房间列表) - 新建盲盒房间页面(成员校验/邀请分享/用户归属展示/自动聚焦) - 首页删除契约画廊和 localStorage 盲盒逻辑,周末契约跳转到 /blindbox - 清理旧路由 /room/[id]/blindbox - 提取共享工具 src/lib/blindbox.ts(错误响应/房间号生成/成员校验) - AuthModal 支持 defaultTab 参数 - 更新项目规范:新项目原则、代码优雅和复用优先
This commit is contained in:
@@ -5,6 +5,13 @@ alwaysApply: true
|
||||
|
||||
# NoWhatever Project Conventions
|
||||
|
||||
## Philosophy
|
||||
|
||||
- This is a **new project** — never worry about backward compatibility or legacy code migration
|
||||
- Prioritize **code elegance and reuse** over quick hacks
|
||||
- Extract shared logic into reusable utilities (`src/lib/`) and components (`src/components/`)
|
||||
- DRY: if the same pattern appears twice, extract it
|
||||
|
||||
## Tech Stack
|
||||
|
||||
- **Framework**: Next.js App Router (all pages are `"use client"`)
|
||||
@@ -26,9 +33,12 @@ alwaysApply: true
|
||||
- Use `motion.*` from framer-motion for animated elements
|
||||
- Mobile-first, `min-h-dvh` for full-height pages
|
||||
- `overflow-y-auto scrollbar-none` for scrollable pages
|
||||
- Extract reusable UI patterns into shared components (modals, cards, empty states)
|
||||
|
||||
## API Routes
|
||||
|
||||
- Located in `src/app/api/`
|
||||
- Return `NextResponse.json()` with appropriate status codes
|
||||
- Always handle errors with try/catch
|
||||
- Extract common validation (userId, membership) into utility functions in `src/lib/`
|
||||
- Use consistent error response shape: `{ error: string }`
|
||||
|
||||
Reference in New Issue
Block a user