# fastapi_agent_starter **Repository Path**: pinghailinfeng/fastapi_agent_starter ## Basic Information - **Project Name**: fastapi_agent_starter - **Description**: No description available - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-29 - **Last Updated**: 2026-07-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FastAPI Agent Starter FastAPI Agent Starter 是一个基于 FastAPI 的现代化 Web 应用模板,专为快速构建 AI 代理(Agent)应用而设计。 ## ✨ 特性 - **高性能**: 基于 FastAPI + Uvicorn,提供卓越的异步性能 - **现代化架构**: 采用分层架构设计,清晰的项目结构易于维护和扩展 - **完整开发栈**: 集成数据库、认证、日志等企业级功能 - **容器化支持**: 原生支持 Docker 部署 - **完善的测试**: 内置测试框架,确保代码质量 ## 🚀 快速开始 ### 环境要求 - Python 3.8+ - pip 或 poetry ### 安装依赖 ```bash # 克隆项目 git clone https://gitee.com/pinghailinfeng/fastapi_agent_starter.git cd fastapi_agent_starter # 安装依赖 pip install -r requirements.txt # 或使用 poetry poetry install ``` ### 配置环境 1. 复制环境变量模板 ```bash cp .env.example .env ``` 2. 编辑 `.env` 文件,配置必要的环境变量 ### 运行应用 ```bash # 开发模式 uvicorn app:app --reload # 或使用 python python main.py ``` 应用将在 `http://localhost:8000` 启动。 ## 📁 项目结构 ``` fastapi_agent_starter/ ├── app.py # 应用入口 ├── main.py # 主模块 ├── config.py # 配置管理 ├── dependencies.py # 依赖注入 ├── requirements.txt # Python 依赖 ├── pyproject.toml # 项目配置 ├── Dockerfile # Docker 构建文件 ├── docker-compose.yml # Docker Compose 配置 ├── data/ # 数据文件 ├── api/ # API 路由和 schemas │ ├── routes.py # 路由定义 │ └── schemas.py # Pydantic 模型 ├── models/ # 数据模型 │ └── schemas.py # 模型 schemas ├── services/ # 业务逻辑层 ├── utils/ # 工具函数 ├── tests/ # 测试文件 └── docs/ # 文档 ``` ## 📖 API 文档 启动应用后,访问以下地址查看自动生成的 API 文档: - **Swagger UI**: `http://localhost:8000/docs` - **ReDoc**: `http://localhost:8000/redoc` ## 🧪 测试 ```bash # 运行所有测试 pytest # 查看测试覆盖率 pytest --cov ``` ## 🐳 Docker 部署 ```bash # 构建镜像 docker-compose build # 启动服务 docker-compose up -d ``` ## 📝 配置说明 主要配置项位于 `config.py` 和 `.env` 文件中: - `DEBUG`: 调试模式 - `DATABASE_URL`: 数据库连接地址 - `SECRET_KEY`: 密钥 - 其他应用相关配置 ## 🤝 贡献指南 欢迎贡献代码!请阅读 [CONTRIBUTING.md](docs/CONTRIBUTING.md) 了解详情。 ## 📄 许可证 本项目采用 MIT 许可证开源。 ## 📧 联系方式 - 项目地址: https://gitee.com/pinghailinfeng/fastapi_agent_starter - 问题反馈: https://gitee.com/pinghailinfeng/fastapi_agent_starter/issues