ChenYu fe8dac59fe chore: align api base urls with nginx proxy hai 4 meses
..
public a49e573e2a feat: complete template management workflow hai 4 meses
src 5114ac3d4c feat: show success feedback after saving template edits hai 4 meses
.env.production fe8dac59fe chore: align api base urls with nginx proxy hai 4 meses
.env.staging fe8dac59fe chore: align api base urls with nginx proxy hai 4 meses
.gitignore 950b7bfb45 chore: add frontend staging and production env config hai 4 meses
README.md c4e227ecef chore: baseline stylist login case hai 4 meses
eslint.config.js c4e227ecef chore: baseline stylist login case hai 4 meses
index.html c4e227ecef chore: baseline stylist login case hai 4 meses
package-lock.json c4e227ecef chore: baseline stylist login case hai 4 meses
package.json 950b7bfb45 chore: add frontend staging and production env config hai 4 meses
test-hairstylist.aitori.jp.conf fe8dac59fe chore: align api base urls with nginx proxy hai 4 meses
tsconfig.json c4e227ecef chore: baseline stylist login case hai 4 meses
vite.config.js c4e227ecef chore: baseline stylist login case hai 4 meses

README.md

Aitori React App

造型师后台前端,现已接入本仓库里的 NestJS + Prisma + MySQL 后端,可本地联调体验:

  • 登录
  • 仪表盘
  • 客户列表 / 详情 / 新建 / 编辑
  • 模板列表 / 详情
  • 发型模拟结果 / 微调 / 术后跟进

环境要求

  • Node.js 20.x
  • 本地可用的 MySQL 3306
  • 本地可用的 Redis 6379
  • 如需真实媒体存储,可提供 Google Cloud Storage service account 并填写到 backend/.env

前端安装

npm install

后端准备

后端目录在 backend/,先安装依赖并准备环境变量:

cd backend
npm install
cp .env.example .env

当前初始化阶段建议在 .env 中至少维护数据库、Redis 与基础应用配置:

PORT=3000
APP_BASE_URL=http://localhost:3000
DATABASE_URL=mysql://root:123456@localhost:3306/aitori_stylist
REDIS_URL=redis://:123456@localhost:6379
JWT_SECRET=replace-me
JWT_EXPIRES_IN=7d
CORS_ORIGIN=http://127.0.0.1:5173
NODE_ENV=development

初始化 Prisma Client:

npm run prisma:generate

启动后端:

npm run start:dev

默认 API 地址:

  • http://localhost:3000/api/v1
  • http://localhost:3000/api/v1/health
  • http://localhost:3000/api/docs

默认登录账号:

  • 当前登录接口骨架已接通,但业务实现尚未完成
  • 提交有效格式的邮箱和密码会返回受控的 501

启动前端

回到项目根目录:

cd ..
npm run dev -- --host 127.0.0.1 --port 5173

默认访问地址:

  • http://127.0.0.1:5173/

推荐体验路径

建议按这条路径体验:

登录 -> 仪表盘 -> 客户列表 -> 打开客户详情 -> 发起模拟 -> 查看结果 -> 微调 / 术后跟进

模板相关也可以继续点:

登录 -> 仪表盘 -> 模板列表 -> 模板详情

验证命令

前端:

npm run test
npm run typecheck
npm run build

后端:

cd backend
npm run prisma:validate
npm run test:e2e

当前说明

  • 模板图库已从真实模板列表接口映射得到
  • 术后选项当前使用前端本地静态选项,避免阻塞主流程联调
  • 模拟结果保存、微调、术后跟进都走真实后端接口
  • 当前更推荐复用你本机已有的默认 MySQL / Redis,而不是强依赖 docker compose
  • 真实 GCS 凭证只应写入本机 backend/.env,不要提交到仓库示例文件