{"id":29104438,"url":"https://github.com/ks6088ts-labs/template-fastapi","last_synced_at":"2026-04-09T16:49:46.151Z","repository":{"id":296214366,"uuid":"992639254","full_name":"ks6088ts-labs/template-fastapi","owner":"ks6088ts-labs","description":"This is a template repository for FastAPI","archived":false,"fork":false,"pushed_at":"2025-06-17T21:10:23.000Z","size":890,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T21:29:38.625Z","etag":null,"topics":["fastapi","mcp","python"],"latest_commit_sha":null,"homepage":"https://ks6088ts-labs.github.io/template-fastapi/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ks6088ts-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-29T13:30:56.000Z","updated_at":"2025-06-17T21:10:06.000Z","dependencies_parsed_at":"2025-05-29T15:09:38.383Z","dependency_job_id":null,"html_url":"https://github.com/ks6088ts-labs/template-fastapi","commit_stats":null,"previous_names":["ks6088ts-labs/template-fastapi"],"tags_count":1,"template":true,"template_full_name":"ks6088ts/template-python","purl":"pkg:github/ks6088ts-labs/template-fastapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks6088ts-labs%2Ftemplate-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks6088ts-labs%2Ftemplate-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks6088ts-labs%2Ftemplate-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks6088ts-labs%2Ftemplate-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ks6088ts-labs","download_url":"https://codeload.github.com/ks6088ts-labs/template-fastapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ks6088ts-labs%2Ftemplate-fastapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262514201,"owners_count":23322697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","mcp","python"],"created_at":"2025-06-29T00:05:19.641Z","updated_at":"2025-10-23T21:45:57.707Z","avatar_url":"https://github.com/ks6088ts-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![test](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/test.yaml?query=branch%3Amain)\n[![docker](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/docker.yaml/badge.svg?branch=main)](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/docker.yaml?query=branch%3Amain)\n[![docker-release](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/docker-release.yaml/badge.svg)](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/docker-release.yaml)\n[![ghcr-release](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/ghcr-release.yaml/badge.svg)](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/ghcr-release.yaml)\n[![docs](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/github-pages.yaml/badge.svg)](https://github.com/ks6088ts-labs/template-fastapi/actions/workflows/github-pages.yaml)\n\n# template-fastapi\n\nA comprehensive FastAPI template with Azure cloud services integration, Agent-based workflows, and multi-service API architecture.\n\n## Features\n\n- **Multiple API Services**: Items management, file operations, restaurant discovery, speech transcription, and agent-based chat\n- **Azure Cloud Integration**: CosmosDB, Blob Storage, OpenAI, AI Speech, and Application Insights\n- **Agent Workflows**: LangGraph and Azure AI Foundry integration for conversational AI\n- **Real-time Communication**: WebSocket-based chat functionality\n- **Comprehensive Logging**: Configurable log levels with structured error handling\n- **Testing \u0026 Quality**: 37+ automated tests with logging and monitoring\n- **Container Ready**: Docker support with multi-stage builds\n\n## Quick Start\n\n### Prerequisites\n\n- [Python 3.10+](https://www.python.org/downloads/)\n- [uv](https://docs.astral.sh/uv/getting-started/installation/) (recommended) or pip\n- [GNU Make](https://www.gnu.org/software/make/)\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/ks6088ts-labs/template-fastapi.git\ncd template-fastapi\n\n# Install dependencies\nmake install-deps-dev\n\n# Copy environment template\ncp .env.template .env\n# Edit .env with your Azure service credentials\n```\n\n### Running the Application\n\n```bash\n# Development server with hot reload\nmake dev\n\n# Production server\nmake run\n\n# Run tests\nmake test\n\n# View documentation\nmake docs-serve\n```\n\nThe API will be available at http://localhost:8000 with interactive documentation at http://localhost:8000/docs.\n\n## API Services\n\n### Core Services\n\n- **Items API** (`/items/`): CRUD operations for item management\n- **Files API** (`/files/`): File upload, download, and management with Azure Blob Storage\n- **Restaurants API** (`/foodies/`): Restaurant discovery with geospatial search\n- **Speech API** (`/speeches/`): Batch transcription jobs using Azure AI Speech\n\n### Agent Services\n\n- **LangGraph Agents** (`/agents/langgraph/`): AI agents with custom tools\n- **Azure AI Foundry** (`/agents/azure-ai-foundry/`): Thread-based conversations\n- **Chat Interface** (`/chats/`): Real-time WebSocket chat with agent integration\n\n### Demo \u0026 Utilities\n\n- **Demo Endpoints** (`/demos/`): Dice rolling, flaky endpoints for testing\n- **Health \u0026 Monitoring**: Application Insights integration with OpenTelemetry\n\n## Configuration\n\n### Environment Variables\n\nKey configuration options in `.env`:\n\n```bash\n# Logging\nLOG_LEVEL=INFO  # DEBUG, INFO, WARNING, ERROR, CRITICAL\n\n# Azure OpenAI\nAZURE_OPENAI_ENDPOINT=https://\u003cname\u003e.openai.azure.com/\nAZURE_OPENAI_API_KEY=\u003ckey\u003e\nAZURE_OPENAI_MODEL_CHAT=gpt-4o\n\n# Azure Storage \u0026 Database\nAZURE_COSMOSDB_CONNECTION_STRING=\u003cconnection-string\u003e\nAZURE_BLOB_STORAGE_CONNECTION_STRING=\u003cconnection-string\u003e\n\n# Monitoring\nAPPLICATIONINSIGHTS_CONNECTION_STRING=\u003cconnection-string\u003e\n```\n\nSee `.env.template` for complete configuration options.\n\n## Docker Deployment\n\n```bash\n# Build image\nmake docker-build\n\n# Run container\ndocker run -p 8000:8000 --env-file .env ks6088ts/template-fastapi:latest\n```\n\n## Development\n\n### Project Structure\n\n```\ntemplate_fastapi/\n├── routers/          # API route handlers\n│   ├── agents/       # Agent-based endpoints\n│   ├── chats.py      # WebSocket chat\n│   ├── demos.py      # Demo endpoints\n│   ├── files.py      # File operations\n│   ├── foodies.py    # Restaurant API\n│   ├── items.py      # Items CRUD\n│   └── speeches.py   # Speech transcription\n├── models/           # Pydantic data models\n├── repositories/     # Data access layer\n├── settings/         # Configuration management\n└── templates/        # Jinja2 templates\n```\n\n### Testing\n\n```bash\n# Run all tests\nmake test\n\n# Run with coverage\npytest --cov=template_fastapi\n\n# Run specific test file\npytest tests/test_api.py -v\n```\n\n### Code Quality\n\n```bash\n# Format code\nmake format\n\n# Lint code\nmake lint\n\n# Apply auto-fixes\nmake fix\n```\n\n## Azure Functions Deployment\n\nThe application supports Azure Functions deployment:\n\n```bash\n# Export requirements\nuv export --format requirements-txt --no-dev --no-hashes --output-file requirements.txt\n\n# Deploy to Azure Functions\nfunc azure functionapp publish \u003cfunction-app-name\u003e\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes with tests\n4. Run quality checks (`make ci-test`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fks6088ts-labs%2Ftemplate-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fks6088ts-labs%2Ftemplate-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fks6088ts-labs%2Ftemplate-fastapi/lists"}