{"id":22882855,"url":"https://github.com/dalryan/fastapi-example","last_synced_at":"2025-07-23T18:03:38.597Z","repository":{"id":254973564,"uuid":"805542762","full_name":"dalryan/fastapi-example","owner":"dalryan","description":"A mimimal, modern example of developing APIs in Python with FastAPI","archived":false,"fork":false,"pushed_at":"2025-03-06T09:38:56.000Z","size":283,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T06:26:52.432Z","etag":null,"topics":["api","example","fastapi","mypy","pre-commit","python","ruff","template","uvicorn"],"latest_commit_sha":null,"homepage":"","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/dalryan.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}},"created_at":"2024-05-24T20:10:50.000Z","updated_at":"2025-03-06T09:38:59.000Z","dependencies_parsed_at":"2024-08-27T09:02:05.619Z","dependency_job_id":"898dff3a-81f7-4ad7-9284-e22450579a45","html_url":"https://github.com/dalryan/fastapi-example","commit_stats":null,"previous_names":["dalryan/fastapi-example"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/dalryan/fastapi-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalryan%2Ffastapi-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalryan%2Ffastapi-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalryan%2Ffastapi-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalryan%2Ffastapi-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalryan","download_url":"https://codeload.github.com/dalryan/fastapi-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalryan%2Ffastapi-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266726574,"owners_count":23974922,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","example","fastapi","mypy","pre-commit","python","ruff","template","uvicorn"],"created_at":"2024-12-13T18:29:26.806Z","updated_at":"2025-07-23T18:03:38.412Z","avatar_url":"https://github.com/dalryan.png","language":"Python","readme":"# Example FastAPI Project\n\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/dalryan/fastapi-example/ci-checks.yml)\n\nThis is a simple template for FastAPI projects. \nIt contains the bare minimum needed to get started developing a modern async Python web API.\n\n## Features\n\n- Simple, extensible API structure with [FastAPI](https://github.com/tiangolo/fastapi)\n- Fully asynchronous web server deployed with [Uvicorn](https://github.com/encode/uvicorn)\n- Multi-stage Dockerfile for efficient image creation.\n- Dependency management and tool config with [Poetry](https://github.com/python-poetry/poetry).\n- [Pre-commit](https://github.com/pre-commit/pre-commit) hooks for enforcing standards.\n- [Ruff](https://github.com/astral-sh/ruff) for code style and formatting.\n- [MyPy](https://github.com/python/mypy) for static type checking.\n- Example [sentry](https://github.com/getsentry/sentry) integration with FastAPI hooks.\n\n### To come\n\n- [ ] Example database integration\n- [ ] Example auth with JWT\n- [ ] Example integration testing with testcontainers\n\n## Getting Started\n\nMake sure you have installed the following:\n\n- Docker\n- Poetry\n- Pre-commit\n\n### Run it locally\n\n1. Clone this repository:\n2. Build the Docker image: `docker build -t my-fastapi-app .`\n3. Run the Docker container: `docker run -p 8080:8080 my-fastapi-app`\n\n\n### Start developing\n\n1. Clone this repository.\n2. Install pre-commit hooks: `pre-commit install`\n3. Install dependencies: `poetry install`\n4. Run the tests: `poetry run pytest tests/`\n5. Add new dependencies with Poetry: `poetry add \u003cpackage\u003e`\n6. Run the server locally: `poetry run uvicorn src.main:app --reload`\n\n## Project Structure\nThe project is structured as follows:\n```shell\n├── Dockerfile\n├── README.md\n├── docs\n├── mypy.ini\n├── poetry.lock\n├── pyproject.toml\n├── src\n│   ├── __init__.py\n│   ├── api\n│   │   ├── __init__.py\n│   │   └── v1\n│   │       ├── __init__.py\n│   │       ├── api.py\n│   │       ├── models.py\n│   │       └── routes\n│   │           ├── __init__.py\n│   │           └── health.py\n│   ├── core\n│   │   ├── __init__.py\n│   │   ├── auth.py\n│   │   ├── config.py\n│   │   ├── logging.py\n│   │   └── middleware.py\n│   └── main.py\n└── tests\n    └── test_v1_route_health.py\n```\n\nTo add a new v1 route/endpoint, create a new module in `src/api/v1/routes` and simply import it in `src/api/v1/api.py`.\nTo add the v2 version of the route, create a new module in `src/api/v2/routes`, import it in `src/api/v2/api.py`, and add a new versioned route in `src/api/api.py`.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalryan%2Ffastapi-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalryan%2Ffastapi-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalryan%2Ffastapi-example/lists"}