Go to file
2026-05-12 11:09:46 +08:00
backend first commit 2026-05-11 23:26:11 +08:00
miniprogram first commit 2026-05-11 23:26:11 +08:00
web fixbug 2026-05-12 11:07:45 +08:00
.dockerignore first commit 2026-05-11 23:26:11 +08:00
.gitignore first commit 2026-05-11 23:26:11 +08:00
docker-compose.yml 1 2026-05-12 11:09:46 +08:00
README.md first commit 2026-05-11 23:26:11 +08:00

AI 手相报告 MVP

原生微信小程序 + Python FastAPI 后端的娱乐型手相报告应用。

目录

  • backend/: FastAPI API、数据库模型、OpenAI 分析服务、图片存储。
  • miniprogram/: 原生微信小程序页面与请求封装。
  • web/: Next.js Web App 主产品入口。

本地运行后端

cd backend
python3 -m venv venv
venv/bin/pip install -r requirements.txt
cp .env.example .env
venv/bin/uvicorn app.main:app --reload

默认使用 SQLite 和 mock 微信登录,便于本地开发。生产环境配置 DATABASE_URL 为 Postgres配置微信、OpenAI 和对象存储参数。

环境变量

backend/.env.example

小程序

用微信开发者工具打开 miniprogram/,把 utils/config.js 中的 API_BASE_URL 改成后端地址。

Web App

cd web
npm install
cp .env.example .env.local
npm run dev

默认连接 http://127.0.0.1:8000/api/v1。第一版 Web 使用匿名会话,浏览器会自动获取 token 并保存在 localStorage

Docker Compose 一键部署

docker compose up --build

启动后访问:

  • Web App: http://127.0.0.1:3000
  • 后端 API: http://127.0.0.1:8000

Compose 默认读取 backend/.env 中的大模型配置,并使用 Docker volume 持久化 SQLite 数据、上传图片和生成文件。

免责声明

本项目报告定位为娱乐占卜与自我反思,不构成医学、心理、职业、财务、投资或任何人生决策建议。