diff --git a/README.md b/README.md index 04738da..15392ed 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,145 @@ | 前端 | PHP | 8.0 | | Web服务器 | Nginx | 1.28+ | +## 文件结构 + +``` +classmanager/ +│ +├── backend/ # Python FastAPI 后端 +│ ├── .env.example # 后端环境变量示例 +│ ├── .gitignore # Git 忽略文件 +│ ├── config.py # 配置管理 +│ ├── main.py # FastAPI 主入口 +│ ├── requirements.txt # Python 依赖 +│ │ +│ ├── logs/ # 日志目录 +│ │ ├── access.log +│ │ ├── app.log +│ │ ├── error.log +│ │ └── operation.log +│ │ +│ ├── middleware/ # 中间件 +│ │ ├── __init__.py +│ │ ├── auth_middleware.py # JWT 认证中间件 +│ │ ├── permission.py # 权限验证中间件 +│ │ └── sanitize.py # 输入过滤中间件 +│ │ +│ ├── models/ # 数据模型 +│ │ ├── __init__.py +│ │ ├── admin_role.py # 管理员角色模型 +│ │ ├── attendance.py # 考勤模型 +│ │ ├── conduct.py # 操行分模型 +│ │ ├── homework.py # 作业模型 +│ │ ├── operation_log.py # 操作日志模型 +│ │ ├── student.py # 学生模型 +│ │ ├── subject.py # 科目模型 +│ │ └── user.py # 用户模型 +│ │ +│ ├── routes/ # API 路由 +│ │ ├── __init__.py +│ │ ├── admin.py # 管理端接口 +│ │ ├── auth.py # 认证接口 +│ │ ├── debug.py # 调试入口 +│ │ ├── parent.py # 家长端接口 +│ │ ├── student.py # 学生端接口 +│ │ └── subject.py # 科目管理接口 +│ │ +│ ├── schemas/ # Pydantic 模型 +│ │ ├── __init__.py +│ │ ├── admin.py +│ │ ├── auth.py +│ │ ├── common.py +│ │ ├── conduct.py +│ │ ├── parent.py +│ │ ├── student.py +│ │ └── subject.py +│ │ +│ ├── services/ # 业务逻辑层 +│ │ ├── __init__.py +│ │ ├── admin_service.py +│ │ ├── attendance_service.py +│ │ ├── auth_service.py +│ │ ├── conduct_service.py +│ │ ├── homework_service.py +│ │ ├── import_service.py +│ │ ├── log_service.py +│ │ ├── parent_service.py +│ │ ├── permission_service.py +│ │ ├── student_service.py +│ │ └── subject_service.py +│ │ +│ └── utils/ # 工具类 +│ ├── __init__.py +│ ├── database.py # MySQL 连接池 +│ ├── jwt_handler.py # JWT 处理 +│ ├── logger.py # 日志轮转 +│ ├── redis_client.py # Redis 客户端 +│ ├── response.py # 统一响应 +│ └── security.py # 密码加密 +│ +├── frontend/ # PHP 前端 +│ ├── .env.example # 前端环境变量示例 +│ ├── .htaccess # Apache 配置(可选) +│ ├── config.php # 前端配置 +│ ├── index.php # 登录入口 +│ │ +│ ├── admin/ # 管理端 +│ │ ├── admins.php # 管理员管理 +│ │ ├── attendance.php # 考勤管理 +│ │ ├── conduct.php # 操行分管理 +│ │ ├── dashboard.php # 管理端首页 +│ │ ├── history.php # 历史记录 +│ │ ├── homework.php # 作业管理 +│ │ ├── password.php # 修改密码 +│ │ ├── students.php # 学生管理 +│ │ └── subjects.php # 科目管理 +│ │ +│ ├── api/ # 内部 API +│ │ └── save_session.php # Session 保存接口 +│ │ +│ ├── assets/ # 静态资源 +│ │ ├── css/ +│ │ │ ├── admin.css # 管理端样式 +│ │ │ └── style.css # 全局样式 +│ │ ├── js/ +│ │ │ ├── admin.js # 管理端 JS +│ │ │ ├── common.js # 公共 JS +│ │ │ ├── parent.js # 家长端 JS +│ │ │ └── student.js # 学生端 JS +│ │ └── uploads/ +│ │ └── sample_import.json # 学生导入示例 +│ │ +│ ├── includes/ # 公共包含文件 +│ │ ├── footer.php # 公共底部 +│ │ └── header.php # 公共头部 +│ │ +│ ├── parent/ # 家长端 +│ │ ├── attendance.php # 考勤记录 +│ │ └── dashboard.php # 家长端首页 +│ │ +│ └── student/ # 学生端 +│ ├── attendance.php # 考勤记录 +│ ├── conduct.php # 操行分详情 +│ ├── dashboard.php # 学生端首页 +│ ├── homework.php # 作业情况 +│ └── password.php # 修改密码 +│ +├── sql/ # 数据库脚本 +│ └── init.sql # 初始化表结构 +│ +├── docs/ # 文档 +│ ├── 学生端使用教程.md +│ ├── 家长端使用教程.md +│ └── 管理端使用教程.md +│ +├── .gitignore +├── INSTALL.md # 安装部署文档 +├── LICENSE # MIT 许可证 +└── README.md # 项目说明 + +``` + ## 角色权限一览表 | 角色 | 操行分查看 | 操行分加减 | 撤销扣分 | 历史记录查看 |