重构后端技术栈和一些小修改

This commit is contained in:
2026-03-13 17:06:09 +08:00
parent f685370622
commit 189baa3d59
39 changed files with 46 additions and 26394 deletions

View File

@@ -1,7 +1,7 @@
# 🌱 树萌芽の作品集
<div align="center">
<img src="frontend/public/assets/logo.png" alt="Logo" width="120" height="120">
<img src="SmyWorkCollect-Frontend/public/assets/logo.png" alt="Logo" width="120" height="120">
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![React](https://img.shields.io/badge/React-18.2.0-61dafb.svg)](https://reactjs.org/)
@@ -59,18 +59,37 @@
1. **后端设置**
```bash
cd backend
cd SmyWorkCollect-Backend
pip install -r requirements.txt
python app.py
```
2. **前端设置**(新开终端)
```bash
cd frontend
cd SmyWorkCollect-Frontend
npm install
npm start
```
#### 方式三:部署(后端 Docker + 前端静态)
1. **后端 APIDocker**
```bash
cd SmyWorkCollect-Backend
docker compose up -d --build
```
- 默认对外端口:`5000`(可用 `SPROUTWORKCOLLECT_PORT` 覆盖)
- 默认持久化目录:`/shumengya/docker/sproutworkcollect/data/`(可用 `SPROUTWORKCOLLECT_DATA_PATH` 覆盖)
2. **前端(构建为静态网页)**
```bash
cd SmyWorkCollect-Frontend
npm ci
npm run build
```
- 构建产物输出到 `SmyWorkCollect-Frontend/build/`
- 默认后端地址:`https://work.api.shumengya.top/api`(构建时可用 `REACT_APP_API_URL` 覆盖)
### 🌐 访问地址
- **前端页面**: http://localhost:3000