04c7b547aa
- 新增 /api/auth/register 和 /api/auth/login 接口,使用 bcryptjs 哈希密码 - User 模型改为 username + passwordHash,id 自动生成 cuid - 新增 AuthModal 组件(登录/注册双标签页),替换旧的 ProfileSetupModal - 重写 /profile 页面:支持修改用户名、密码、头像、绑定邮箱、退出登录 - /api/user PUT 支持密码修改(需验证当前密码)和用户名唯一性校验 - 游客模式保留,右上角显示"登录"按钮;登录后显示头像和用户名 - 全局 nickname -> username 重命名(types、SwipeDeck、RoomManageModal、buildRoomStatus) - 新增 logout() 清除登录态并重新生成游客 UUID
1.3 KiB
1.3 KiB
NoWhatever — 别说随便
像 Tinder 一样滑卡片,和朋友一起决定去哪吃!解决聚餐时"随便都行"的纠结痛点,无需下载 App,用完即走。
Tech Stack
- Next.js (App Router) + React + TypeScript
- Tailwind CSS — Utility-first styling
- Framer Motion — Physics-based swipe & drag animations
- Lucide React — Icon library
Getting Started
npm install
npm run dev
Open http://localhost:3000 in your browser (best viewed on mobile viewport).
Project Structure
src/
├── app/
│ ├── globals.css # Global styles (mobile-first, no scroll)
│ ├── layout.tsx # Root layout with viewport meta
│ └── page.tsx # Main entry page
├── components/
│ ├── TopNav.tsx # Navigation bar with room info
│ ├── RestaurantCard.tsx # Restaurant display card
│ ├── SwipeableCard.tsx # Framer Motion drag/swipe logic
│ ├── SwipeDeck.tsx # Card stack orchestrator
│ ├── ActionButtons.tsx # Nope / Like action buttons
│ └── MatchResult.tsx # Match celebration screen
└── types/
└── index.ts # TypeScript type definitions