|
|
2 months ago | |
|---|---|---|
| .kiro | 3 months ago | |
| backend | 2 months ago | |
| frontend | 2 months ago | |
| .dockerignore | 3 months ago | |
| .gitignore | 3 months ago | |
| Dockerfile | 3 months ago | |
| README.md | 3 months ago |
一个用于管理人员工作记录和统计的全栈应用,支持工作记录管理、数据导入导出、月度报表等功能。
后端
前端
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python run.py
后端运行在 http://localhost:5000
默认管理员账号:admin / admin123
cd frontend
npm install
npm run dev
前端运行在 http://localhost:3000
cp backend/.env.example backend/.env
# 编辑 .env 设置以下变量:
# - SECRET_KEY
# - JWT_SECRET_KEY
# - DATABASE_URL (PostgreSQL)
cd backend
source venv/bin/activate
export $(cat .env | xargs)
python init_db.py
# 后端
## 测试
python run.py
# 生产
gunicorn -w 4 -b 0.0.0.0:5000 wsgi:app
# 前端构建
cd frontend
npm run build
# 将 dist/ 目录部署到 Web 服务器
启动后端后访问 http://localhost:5000/api/docs 查看 Swagger 文档。
├── backend/
│ ├── app/
│ │ ├── models/ # 数据模型
│ │ ├── routes/ # API 路由
│ │ ├── services/ # 业务逻辑
│ │ └── utils/ # 工具函数
│ ├── tests/ # 测试文件
│ ├── requirements.txt
│ └── run.py
├── frontend/
│ ├── src/
│ │ ├── components/ # React 组件
│ │ ├── contexts/ # Context
│ │ └── services/ # API 服务
│ └── package.json
└── README.md
MIT