Initial commit

This commit is contained in:
ChuXun
2026-01-28 23:56:33 +08:00
commit f98da73376
92 changed files with 8261 additions and 0 deletions

70
README.md Normal file
View File

@@ -0,0 +1,70 @@
# Smart Office智能办公管理系统
本仓库已根据需求文档完成 v1.0MVP完整实现包含 **后端 Spring Boot****前端 React**。MVP 聚焦“可运行、可演示、流程闭环”的核心能力。
## 已实现范围v1.0
- 认证与权限JWT + 角色分级(管理员/经理/员工)
- 用户管理:用户新增、查询、状态管理
- 考勤管理:上班/下班打卡、个人考勤记录
- 请假审批:请假申请、审批通过/拒绝
- 通知服务:站内通知(审批结果)
## 目录结构
```
backend/ # Spring Boot 3.2 后端
frontend/ # React 18 + Vite 前端
plans/ # 需求/架构/数据库文档
scripts/ # 数据库初始化脚本MySQL
```
## 启动方式
### 后端
```bash
cd backend
mvn spring-boot:run
```
- 默认使用 H2 内存数据库,访问控制台:`http://localhost:8080/h2`
- Swagger: `http://localhost:8080/swagger`
可切换 MySQL
```bash
mvn spring-boot:run -Dspring-boot.run.profiles=mysql
```
### 前端
```bash
cd frontend
npm install
npm run dev
```
访问:`http://localhost:5173`
如后端运行在非 8080 端口(例如 8081可在前端设置代理目标
```bash
# macOS/Linux
VITE_PROXY_TARGET=http://localhost:8081 npm run dev
# Windows PowerShell
$env:VITE_PROXY_TARGET="http://localhost:8081"; npm run dev
```
也可以直接配置 API Base绕过代理
```bash
# macOS/Linux
VITE_API_BASE=http://localhost:8081/api/v1 npm run dev
# Windows PowerShell
$env:VITE_API_BASE="http://localhost:8081/api/v1"; npm run dev
```
## 默认账号
- 管理员admin / admin123
- 经理manager / manager123
- 员工employee / employee123
## 前端外观
- 登录页背景图文件:`frontend/public/login-bg.jpg`(可替换为自定义图片)
## 需求文档
`plans/project_requirements_document.md`,已在 v1.0 标注了 MVP 交付边界与后续迭代项。