重构后端服务架构并优化前端错误处理
This commit is contained in:
42
fastapi-backend/README.md
Normal file
42
fastapi-backend/README.md
Normal 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
|
||||
Reference in New Issue
Block a user