# study-pal
**Repository Path**: ymjiangc/study-pal
## Basic Information
- **Project Name**: study-pal
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-11-27
- **Last Updated**: 2025-11-28
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# StudyPAL - AI个人家教智能体平台

**基于AI的个性化学习平台**
[](https://opensource.org/licenses/MIT)
[](https://www.oracle.com/java/)
[](https://vuejs.org/)
[](https://spring.io/projects/spring-boot)
## 📖 项目简介
StudyPAL是一个基于AI的智能个人家教平台,通过先进的AI技术为学习者提供个性化的学习体验,包括智能诊断、个性化学习路径、自适应练习等功能。
### ✨ 核心功能
- 🎯 **智能学习诊断** - AI分析学习水平,识别知识薄弱点
- 📚 **个性化学习路径** - 根据学习能力和进度定制学习计划
- ✏️ **自适应练习系统** - 智能推荐练习题,循序渐进提升能力
- 🤖 **AI智能助手** - 24小时在线答疑解惑
- 📊 **学习数据分析** - 可视化学习进度和成果
- 🔐 **微信小程序支持** - 随时随地学习
## 🏗️ 系统架构
### 架构图
```mermaid
graph TB
subgraph "前端层 Frontend Layer"
H5[H5 Web应用]
MP[微信小程序]
APP[移动App]
end
subgraph "API网关层 API Gateway"
Gateway[API Gateway]
end
subgraph "微服务层 Microservices"
Auth[认证服务
auth-service:8081]
User[用户管理服务
user-service:8082]
Content[内容管理服务
content-service:8083]
AI[AI智能体服务
ai-service:8084]
Analytics[数据分析服务
analytics-service:8085]
end
subgraph "数据存储层 Data Layer"
PostgreSQL[(PostgreSQL
主数据库)]
Redis[(Redis
缓存)]
FileStorage[文件存储
OSS/MinIO]
end
H5 --> Gateway
MP --> Gateway
APP --> Gateway
Gateway --> Auth
Gateway --> User
Gateway --> Content
Gateway --> AI
Gateway --> Analytics
Auth --> PostgreSQL
User --> PostgreSQL
Content --> PostgreSQL
AI --> PostgreSQL
Analytics --> PostgreSQL
Auth --> Redis
User --> Redis
AI --> Redis
Content --> FileStorage
```
### 前端技术栈
- **框架**: uni-app + Vue 3
- **构建**: Vite + uni-app CLI
- **状态管理**: Vuex 4
- **HTTP客户端**: axios
- **测试框架**: Jest + Playwright
- **代码规范**: ESLint + Prettier
- **支持平台**: H5、微信小程序、APP
- **包管理**: npm
### 后端技术栈
- **框架**: Spring Boot 3.x
- **Java版本**: Java 17
- **数据库**: PostgreSQL 15+ (主数据库)
- **缓存**: Redis 6+ (分布式缓存)
- **构建工具**: Maven 3.8+
- **文档**: Swagger/OpenAPI 3.0
- **日志**: Logback + SLF4J
- **安全**: JWT + Spring Security
- **测试**: JUnit 5 + Mockito
- **容器化**: Docker + Docker Compose
- **CI/CD**: GitHub Actions
### 核心技术架构
| 层次 | 技术选型 | 说明 |
|------|----------|------|
| **前端层** | Vue3 + uni-app | 跨平台UI框架,支持多端发布 |
| **网关层** | Spring Cloud Gateway | API路由、负载均衡、认证鉴权 |
| **业务层** | Spring Boot 3.x | 微服务框架,提供业务逻辑 |
| **数据层** | PostgreSQL + Redis + Mybatis-plus | 主数据库 + 缓存 + ORM框架 |
| **基础设施** | Docker + CI/CD | 容器化部署和持续集成 |
## 📂 项目结构
```
study-pal/
├── 📁 .github/ # GitHub配置和CI/CD
│ └── 📁 workflows/ # GitHub Actions工作流
│ └── 📄 basic-ci.yml # 基础CI配置
├── 📁 文档/ # 项目文档中心
│ ├── 📄 README.md # 文档导航索引
│ ├── 📁 接口文档/ # API接口文档
│ ├── 📁 部署运维/ # 部署和运维文档
│ ├── 📁 需求文档/ # 产品需求文档
│ └── 📁 文档模板/ # 文档模板库
├── 📁 scripts/ # 构建和部署脚本
│ └── 📄 build.sh # 项目构建脚本
├── 📁 backend/ # 后端微服务
│ ├── 📁 shared/ # 共享代码库
│ │ ├── 📁 common/ # 通用工具类
│ │ ├── 📁 dto/ # 数据传输对象
│ │ ├── 📁 entities/ # 共享实体类
│ │ ├── 📁 security/ # 安全组件
│ │ ├── 📁 exceptions/ # 统一异常处理
│ │ └── 📁 utils/ # 工具类
│ ├── 📁 services/ # 微服务集合
│ │ └── 📁 auth-service/ # 认证服务 (✅ 已实现)
│ │ ├── 📁 src/ # 源代码
│ │ │ └── 📁 main/java/com/studypal/
│ │ │ ├── 📁 auth/ # 认证控制器
│ │ │ ├── 📁 config/ # 配置类
│ │ │ ├── 📁 entity/ # 实体类
│ │ │ ├── 📁 service/ # 业务服务
│ │ │ ├── 📁 repository/ # 数据访问层
│ │ │ └── 📁 security/ # 安全配置
│ │ ├── 📁 tests/ # 单元测试
│ │ ├── 📁 config/ # 服务配置
│ │ └── 📄 pom.xml # Maven配置
│ └── 📁 tests/ # 集成测试
└── 📁 frontend/ # 前端应用
└── 📁 study-pal-h5/ # H5版本 (uni-app)
├── 📁 pages/ # 页面文件
│ ├── 📁 index/ # 首页
│ ├── 📁 learn/ # 学习页面
│ ├── 📁 practice/ # 练习页面
│ └── 📁 profile/ # 个人中心
├── 📁 static/ # 静态资源
├── 📁 components/ # 组件库
├── 📁 utils/ # 工具函数
├── 📄 pages.json # 页面配置
├── 📄 manifest.json # 应用配置
├── 📄 package.json # 依赖配置
└── 📄 vite.config.js # 构建配置
```
### 🚀 微服务设计
#### 已实现的服务
1. **认证服务 (auth-service)**
- **端口**: 8081
- **功能**: 微信小程序登录、JWT令牌管理、用户认证和授权
- **技术栈**: Spring Boot + Spring Security + JWT
- **状态**: ✅ 开发完成
#### 规划中的服务
2. **用户管理服务 (user-service)** - 端口: 8082
- **功能**: 用户信息管理、用户画像、用户行为分析
- **依赖**: auth-service
- **优先级**: 高 - 与微信登录功能紧密相关
3. **内容管理服务 (content-service)** - 端口: 8083
- **功能**: 学习内容管理、课程体系、知识点图谱
- **依赖**: user-service, auth-service
- **优先级**: 中 - 为AI服务提供基础数据支撑
4. **AI智能体服务 (ai-service)** - 端口: 8084
- **功能**: 智能学习诊断、个性化推荐、智能答疑
- **依赖**: user-service, content-service
- **优先级**: 高 - 核心AI功能模块
5. **数据分析服务 (analytics-service)** - 端口: 8085
- **功能**: 学习数据分析、效果评估、报表生成
- **依赖**: 所有业务服务
- **优先级**: 低 - 运营分析支撑
## 🚀 快速开始
### 环境要求
- Node.js 16+
- Java 17+
- Maven 3.8+
- PostgreSQL 15+
- Redis 6+
### 安装和运行
#### 1. 克隆项目
```bash
# 本地开发(当前目录就是项目根目录)
# 如需Git版本控制,请先初始化仓库:
git init
git add .
git commit -m "Initial commit: StudyPAL project setup"
# 或者从远程仓库克隆(如果有远程仓库)
# git clone
cd study-pal
```
#### 2. 数据库准备
```bash
# 创建数据库
createdb study_pal_dev
createdb study_pal_prod
```
#### 3. 启动后端服务
```bash
# 启动认证服务
cd backend/services/auth-service
mvn spring-boot:run
```
#### 4. 启动前端项目
```bash
cd frontend/study-pal-h5
npm install
npm run dev:h5
```
#### 5. 使用构建脚本
```bash
# 一键构建前后端
./scripts/build.sh
```
### 环境变量配置
创建 `.env` 文件:
```bash
# 数据库配置
DB_USERNAME=your_username
DB_PASSWORD=your_password
# JWT配置
JWT_SECRET=your_jwt_secret_key
# 微信小程序配置
WECHAT_APP_ID=your_wechat_app_id
WECHAT_APP_SECRET=your_wechat_app_secret
```
## 📚 文档导航
完整的项目文档请查看:[📖 文档中心](文档/README.md)
### 快速链接
- **📋 需求文档** - [功能需求和用户故事](文档/README.md#️-需求文档)
- **🔌 API文档** - [REST API接口文档](文档/README.md#-api文档)
- **🏗️ 系统架构** - [技术架构和设计](#️-系统架构)
- **🚀 部署运维** - [部署和运维指南](文档/README.md#-部署运维)
- **📝 文档模板** - [需求和技术模板](文档/README.md#-文档模板)
## 🧪 测试
### 前端测试
```bash
cd frontend/study-pal-h5
npm run test
```
### 后端测试
```bash
cd backend/services/auth-service
mvn test
```
### 集成测试
```bash
# 运行后端集成测试
cd backend
mvn verify
# 运行前端集成测试
cd frontend/study-pal-h5
npm run test:integration
```
## 📦 部署
### Docker部署
```bash
# 构建镜像
docker-compose build
# 启动服务
docker-compose up -d
```
### 生产环境部署
```bash
# 使用构建脚本进行生产构建
./scripts/build.sh
# 使用Docker Compose部署
docker-compose -f docker-compose.prod.yml up -d
```
详细部署指南请参考 [文档中心](文档/README.md#-部署运维)
## 🤝 贡献指南
我们欢迎所有形式的贡献!在贡献前请阅读我们的开发规范:
### 开发流程
1. Fork 项目
2. 创建功能分支 (`git checkout -b feature/AmazingFeature`)
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 创建 Pull Request
### 代码规范
- 前端:遵循 ESLint + Prettier 规范
- 后端:遵循 Java Code Conventions
- 提交信息:使用 Conventional Commits 规范
- 分支命名:`feature/功能名`、`bugfix/问题描述`、`hotfix/紧急修复`
## 📄 许可证
本项目采用 MIT 许可证 - 查看 [MIT 许可证详情](https://opensource.org/licenses/MIT)。
## 👥 团队
- **项目负责人**: [江雁鸣](993274410@qq.com)
## 🙏 致谢
感谢以下开源项目的支持:
- [Spring Boot](https://spring.io/projects/spring-boot)
- [Vue.js](https://vuejs.org/)
- [uni-app](https://uniapp.dcloud.io/)
- [LangChain](https://langchain.com/)
- [PostgreSQL](https://www.postgresql.org/)
## 📞 联系我们
- 📧 Email: [993274410@qq.com](mailto:993274410@qq.com)
- 🐛 问题反馈:请通过邮件联系开发团队
- 💬 技术讨论:欢迎邮件交流技术问题
---
**⭐ 如果这个项目对您有帮助,请给我们一个星标!**
Made with ❤️ by StudyPAL Team