# AI调酒师 **Repository Path**: luli1314520/ai-bartender ## Basic Information - **Project Name**: AI调酒师 - **Description**: 来自一份远程工作的小创意,利用ai的能力与新意, 在娱乐方面 玩味代码~~~ , 说干就干 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-20 - **Last Updated**: 2025-10-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🍸 ByteSlinger 调酒师
![ByteSlinger Logo](https://img.shields.io/badge/ByteSlinger-调酒师-00C851?style=for-the-badge&logo=react&logoColor=white) **AI驱动的智能调酒师助手,让每个人都能成为调酒大师** [![Next.js](https://img.shields.io/badge/Next.js-14-black?style=flat-square&logo=next.js)](https://nextjs.org/) [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/) [![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-3.4-38B2AC?style=flat-square&logo=tailwind-css)](https://tailwindcss.com/) [![Prisma](https://img.shields.io/badge/Prisma-5.22-2D3748?style=flat-square&logo=prisma)](https://prisma.io/) [![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE) [演示地址](#) • [文档](#) • [问题反馈](#) • [功能建议](#)
## ✨ 项目特色 - 🤖 **AI智能对话** - 基于大语言模型的专业调酒师助手 - 🍹 **智能配方提取** - 自动从对话中提取结构化配方数据 - 📱 **响应式设计** - 完美适配桌面端和移动端 - 🔐 **用户认证系统** - 完整的注册、登录和个人酒柜功能 - 🎨 **现代化UI** - 基于Radix UI的美观组件库 - ⚡ **实时流式输出** - 逐字显示AI回复,提升用户体验 - 🗄️ **数据持久化** - 基于Prisma + MySQL的可靠数据存储 ## 🚀 快速开始 ### 环境要求 - Node.js 18.0 或更高版本 - pnpm 包管理器 - MySQL 8.0 或更高版本 - OpenAI API 密钥 ### 安装步骤 1. **克隆项目** ```bash git clone https://github.com/your-username/bartender-chat.git cd bartender-chat ``` 2. **安装依赖** ```bash pnpm install ``` 3. **配置环境变量** ```bash cp .env.example .env.local ``` 编辑 `.env.local` 文件,填入以下配置: ```env # 数据库配置 DATABASE_URL="mysql://username:password@localhost:3306/bartender_chat" # OpenAI API配置 OPENAI_API_KEY="your-openai-api-key" OPENAI_BASE_URL="https://api.openai.com/v1" OPENAI_MODEL="gpt-4" # JWT密钥 JWT_SECRET="your-jwt-secret-key" ``` 4. **数据库初始化** ```bash # 生成Prisma客户端 pnpm db:generate # 运行数据库迁移 pnpm db:migrate # 可选:填充示例数据 pnpm db:seed ``` 5. **启动开发服务器** ```bash pnpm dev ``` 访问 [http://localhost:3000](http://localhost:3000) 查看应用。 ## 📖 使用指南 ### 基本功能 1. **AI调酒师对话** - 在首页输入框输入问题或需求 - 选择快捷操作(随机盲盒、酒品知识、经典系列) - 与AI调酒师进行自然语言对话 2. **配方管理** - 在对话中生成配方后,点击"生成配方卡片" - 查看详细的配料、步骤和制作方法 - 将喜欢的配方保存到个人酒柜 3. **个人酒柜** - 登录后访问"我的酒柜"页面 - 查看和管理已保存的配方 - 分享和发现其他用户的配方 ### 高级功能 - **智能推荐**:根据用户喜好推荐个性化配方 - **配方搜索**:快速查找特定类型的鸡尾酒 - **收藏管理**:分类管理个人收藏的配方 - **社区分享**:在公共酒柜中分享和发现新配方 ## 🛠️ 技术栈 ### 前端技术 - **Next.js 14** - React全栈框架,支持App Router - **TypeScript** - 类型安全的JavaScript超集 - **Tailwind CSS** - 实用优先的CSS框架 - **Radix UI** - 无障碍的UI组件库 - **React Hook Form** - 表单状态管理 - **React Markdown** - Markdown内容渲染 ### 后端技术 - **Next.js API Routes** - 服务端API接口 - **Prisma ORM** - 现代化数据库ORM - **MySQL** - 关系型数据库 - **JWT** - JSON Web Token身份验证 - **bcryptjs** - 密码加密库 ### AI集成 - **OpenAI API** - 大语言模型接口 - **智能提示工程** - 专业的调酒师角色设定 ## 📁 项目结构 ``` bartender-chat/ ├── app/ # Next.js App Router │ ├── api/ # API路由 │ │ ├── auth/ # 用户认证API │ │ ├── chat/ # AI聊天API │ │ ├── recipe/ # 配方提取API │ │ └── cabinet/ # 酒柜管理API │ ├── chat/ # 聊天页面 │ ├── cabinet/ # 个人酒柜页面 │ ├── login/ # 登录页面 │ └── register/ # 注册页面 ├── components/ # UI组件 │ └── ui/ # 基础UI组件库 ├── lib/ # 工具库 │ ├── auth/ # 认证相关功能 │ └── prisma.ts # 数据库客户端 ├── hooks/ # 自定义React钩子 ├── prisma/ # 数据库模型和迁移 └── public/ # 静态资源 ``` ## 🔧 开发指南 ### 可用脚本 ```bash # 开发服务器 pnpm dev # 构建生产版本 pnpm build # 启动生产服务器 pnpm start # 代码检查 pnpm lint # 数据库相关 pnpm db:generate # 生成Prisma客户端 pnpm db:migrate # 运行数据库迁移 pnpm db:seed # 填充示例数据 ``` ### 代码规范 - 使用 TypeScript 进行类型安全开发 - 遵循 ESLint 和 Prettier 配置 - 组件采用函数式组件 + Hooks - 使用 Tailwind CSS 进行样式管理 - API 路由遵循 RESTful 设计原则 ### 贡献指南 1. Fork 本仓库 2. 创建特性分支 (`git checkout -b feature/AmazingFeature`) 3. 提交更改 (`git commit -m 'Add some AmazingFeature'`) 4. 推送到分支 (`git push origin feature/AmazingFeature`) 5. 开启 Pull Request ## 📸 截图
### 首页界面 ![1760895767177](image/readme/1760895767177.png) ### AI聊天界面 ![1760895790418](image/readme/1760895790418.png) ## 📄 许可证 本项目基于 [MIT 许可证](LICENSE) 开源。 ## 🙏 致谢 - [Next.js](https://nextjs.org/) - React全栈框架 - [Tailwind CSS](https://tailwindcss.com/) - CSS框架 - [Radix UI](https://www.radix-ui.com/) - UI组件库 - [Prisma](https://prisma.io/) - 数据库ORM - [OpenAI](https://openai.com/) - AI模型服务 ## 📞 联系我们 - 项目链接:https://gitee.com/luli1314520/ai-bartender - 问题反馈:[Issues](https://github.com/your-username/bartender-chat/issues) - 邮箱:your-email@example.com ---
**如果这个项目对您有帮助,请给个 ⭐ Star 支持一下!** Made with ❤️ by [Your Name](https://github.com/your-username)