Files
QuestionProject/ai_knowledge_base_v2/apps/backend/README.md

53 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 大本营答疑助手后端
这是大本营答疑助手的后端服务目录当前处于阶段二第一批建设后端基础工程、核心数据模型、mock 登录能力。
## 技术栈
- FastAPI
- SQLAlchemy
- Alembic
- MySQL 8.x
- Pydantic Settings
- PyJWT
## 当前已包含
- 应用入口和健康检查
- 统一 JSON 响应结构
- 配置读取和 `.env` 示例
- SQLAlchemy 数据库连接
- Alembic 迁移骨架
- 核心 `sys_*` 数据模型
- mock 短信验证码
- 用户手机号验证码登录
- 用户 Token 鉴权
- 当前用户信息接口
## 本地启动
方式一:使用 V2 统一编排。
```bash
cd ai_knowledge_base_v2
docker compose -f docker-compose.dev.yml up --build
```
方式二:本地 Python 直接启动。
```bash
cd ai_knowledge_base_v2/apps/backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --reload --host 127.0.0.1 --port 8100
```
默认短信验证码为 `.env` 中的 `MOCK_SMS_CODE`,默认值是 `123456`
## 下一步
- 补管理员登录接口。
- 接入 Redis 替换内存短信验证码和 Token 黑名单。