重构后端服务架构并优化前端错误处理

This commit is contained in:
ylweng
2025-09-12 01:21:43 +08:00
parent d550a8ed51
commit 3a48a67757
53 changed files with 3925 additions and 0 deletions

42
fastapi-backend/README.md Normal file
View File

@@ -0,0 +1,42 @@
# FastAPI Backend for 活牛采购智能数字化系统
This is a FastAPI implementation of the backend for the 活牛采购智能数字化系统.
## Features
- User authentication with JWT
- Order management
- Payment processing
- Role-based access control
- Database integration with SQLAlchemy
- API documentation with Swagger UI and ReDoc
## Requirements
- Python 3.8+
- FastAPI
- SQLAlchemy
- PyJWT
- Uvicorn
## Installation
1. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Configure environment variables (see .env.example)
4. Run the application:
```bash
uvicorn app.main:app --reload
```
## API Documentation
Once the server is running, you can access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc