# WeChat Moments Generator / 朋友圈文案生成器 Use AI (DashScope Qwen) to generate authentic WeChat Moments copy instantly. 利用 AI (通义千问) 一键生成符合朋友圈风格的文案。 ## Features / 功能特性 - **User Page / 用户主页**: - Simple input for name. / 仅需输入姓名。 - One-click generation. / 一键生成。 - Copy to clipboard. / 支持一键复制。 - Dark mode support. / 支持暗色模式。 - Mobile-first responsive design. / 移动端优先的响应式设计。 - **Admin Dashboard / 管理后台**: - Manage prompt templates. / 管理提示词模板。 - Real-time preview. / 实时预览生成效果。 - Simulated RBAC (Frontend only). / 模拟权限控制(仅前端)。 ## Tech Stack / 技术栈 - **Frontend**: React 18, TypeScript, Vite - **UI**: Ant Design Mobile, Tailwind CSS - **State**: Zustand (Persisted to LocalStorage) - **API**: Axios (Direct call to DashScope API) - **DevOps**: Docker, GitHub Actions ## Setup / 快速开始 1. **Clone the repository** ```bash git clone https://github.com/your-username/wx-pyq.git cd wx-pyq ``` 2. **Install dependencies** ```bash npm install ``` 3. **Configure Environment Variables** Create a `.env` file in the root directory: ```env VITE_API_KEY=your_dashscope_api_key_here ``` For Docker / production deployment, prefer using server-side env: ```env DASHSCOPE_API_KEY=your_dashscope_api_key_here ``` 4. **Start Development Server** ```bash npm run dev ``` 5. **Build for Production** ```bash npm run build ``` ## Admin Access / 管理员入口 - URL: `/login` or link from footer. - Default Credentials: - Username: `admin` - Password: `admin123` ## Docker Deployment / Docker 部署 ```bash docker build -t wx-pyq . docker run -p 80:80 -e DASHSCOPE_API_KEY=your_dashscope_api_key_here wx-pyq ``` ## Note / 注意事项 - For dev, it can call DashScope directly (API Key is exposed in the browser). For production/Docker, the app uses a same-origin server proxy (`/api/chat/completions`) so streaming is more reliable and the key is not bundled into frontend assets. - 开发环境可直连 DashScope(API Key 会暴露在浏览器请求中)。生产环境/Docker 默认走同源后端代理(`/api/chat/completions`),流式更稳定且不会把 Key 打进前端静态资源。 ## License MIT