{"id":20549531,"url":"https://github.com/akullpp/fastapi-template","last_synced_at":"2026-05-09T09:02:56.613Z","repository":{"id":217305008,"uuid":"698836335","full_name":"akullpp/fastapi-template","owner":"akullpp","description":"Template for FastAPI services.","archived":false,"fork":false,"pushed_at":"2024-02-13T17:14:32.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T21:33:39.883Z","etag":null,"topics":["fastapi","fastapi-template","python"],"latest_commit_sha":null,"homepage":"https://fastapi.tiangolo.com","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/akullpp.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":"2023-10-01T05:41:28.000Z","updated_at":"2024-01-15T12:56:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd6609c2-c898-4170-a0f6-6514fbf69e7b","html_url":"https://github.com/akullpp/fastapi-template","commit_stats":null,"previous_names":["akullpp/fastapi-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akullpp/fastapi-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Ffastapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Ffastapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Ffastapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Ffastapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akullpp","download_url":"https://codeload.github.com/akullpp/fastapi-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akullpp%2Ffastapi-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264726769,"owners_count":23654494,"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","fastapi-template","python"],"created_at":"2024-11-16T02:18:21.973Z","updated_at":"2026-05-09T09:02:56.538Z","avatar_url":"https://github.com/akullpp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi-template\n\nTemplate for [FastAPI](https://fastapi.tiangolo.com/) services.\n\nThe choice of state-of-the-art libraries balance simplicity and ease of use but you can switch them out if you want.\n\nPlease find some nice workspace defaults in `.vscode` if you use [VSCode](https://code.visualstudio.com/).\n\n## Recommended Stack\n\n### Infrastructure\n\n- 3.12 \u003c= [Python](https://docs.python.org) \u003c 3.13\n\n- [PostgreSQL](https://www.postgresql.org/docs/current/index.html)\n\nAdditionally I provide some shell scripts in `bin` to get you started with your deployment with:\n\n- [Docker](https://docs.docker.com/)\n\n- [Kubernetes](https://kubernetes.io/docs/home/)\n\n- [AWS](https://docs.aws.amazon.com/)\n\n### Libraries\n\n- [asyncpg](https://magicstack.github.io/asyncpg/current/)\n\n- [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html)\n\n- [fastapi](https://fastapi.tiangolo.com/)\n\n- [httpx](https://www.python-httpx.org/)\n\n- [loguru](https://github.com/Delgan/loguru)\n\n- [openpyxl](https://openpyxl.readthedocs.io/en/stable/)\n\n- [pandas](https://pandas.pydata.org/)\n\n- [pip-tools](https://github.com/jazzband/pip-tools)\n\n- [pydantic](https://pydantic-docs.helpmanual.io/)\n\n- [ruff](https://docs.astral.sh/ruff/)\n\n- [SQLAlchemy](https://docs.sqlalchemy.org/)\n\n### Decisions\n\n- Against `black` since it's not configurable and leads to less readable code\n\n- Against `psycopg2` which is great for synchronous code but 5x slower than `asyncpg` in most use cases\n\n- Against `requests` since it's not async and `httpx` is basically a drop-in replacement\n\n- Against `poetry` since breaks every now and then, doesn't follow standards and most features are not needed\n\n## Setup\n\nUse [asdf](https://github.com/asdf-vm/asdf) to switch between Python versions.\n\n```shell\nmake\n```\n\n## Guidelines\n\nGet [ruff](https://github.com/astral-sh/ruff) up and running in your IDE.\n\n### Structure\n\n- Flat, based on features, not layers\n\n- Use technical suffixes\n\n- Don't start with Pydantic schemas or SQLAlchemy models but evolve into them\n\n### Tests\n\nFor each router, add an `http` file which contains at least one happy path request for each endpoint.\n\n### Responses\n\nDon't use `fastapi.responses.*`, e.g. `JSONResponse` or `Response`.\n\nThe CORS middleware won't be applied and the correct headers won't be set resulting in the response not to be readable in the frontend.\n\nUse `app.response.JsonResponse`.\n\n### Exceptions\n\nThere's only one type of exception you should raise, `CustomError` and it **must** look like this:\n\n```py\nCustomError(\n    code: int,\n    key: str,\n    message: str | None\n    details: dict | None,\n)\n```\n\nDump everything you want in `details`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakullpp%2Ffastapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakullpp%2Ffastapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakullpp%2Ffastapi-template/lists"}