基于FastAPI的智能拼写教练后端服务
spell-smart-ai-coach-baackend/ ├── app/ │ ├── __init__.py │ ├── api/ │ │ ├── __init__.py │ │ └── v1/ │ │ ├── __init__.py │ │ ├── api.py │ │ └── endpoints/ │ │ ├── __init__.py │ │ └── hello_world.py │ ├── core/ │ │ ├── __init__.py │ │ └── config.py │ ├── crud/ │ │ ├── __init__.py │ │ └── hello_world.py │ ├── db/ │ │ ├── __init__.py │ │ ├── database.py │ │ └── models.py │ └── schemas/ │ ├── __init__.py │ └── hello_world.py ├── docs/ │ └── changelog.md ├── main.py ├── requirements.txt └── README.md
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
pip install -r requirements_asyncpg.txt -i https://mirrors.aliyun.com/pypi/simple/
install_dependencies.bat
注意:如果遇到psycopg2-binary安装问题,请参考 故障排除指南
python main.py
或使用uvicorn:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
启动应用后,访问以下地址查看API文档:
/api/v1/hello-world/hello/api/v1/hello-world/hello/api/v1/hello-world/hello/{id}/api/v1/hello-world/hello/{id}/api/v1/hello-world/hello/{id}数据库连接信息在 app/core/config.py 中配置:
Ab123456请参考项目根目录下的开发指南文档,遵循代码规范和最佳实践。