{"id":16108784,"url":"https://github.com/ibraheemtuffaha/python-fastapi-template","last_synced_at":"2026-03-27T04:46:58.299Z","repository":{"id":247783915,"uuid":"826826015","full_name":"IbraheemTuffaha/python-fastapi-template","owner":"IbraheemTuffaha","description":"A template for a Python FastAPI service with Poetry \u0026 Devcontainer","archived":false,"fork":false,"pushed_at":"2024-09-02T19:32:56.000Z","size":88,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-10T10:25:03.776Z","etag":null,"topics":["devcontainer","docker","fastapi","github-actions","poetry","pre-commit","python"],"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/IbraheemTuffaha.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-07-10T13:01:52.000Z","updated_at":"2024-10-25T15:14:42.000Z","dependencies_parsed_at":"2024-07-28T19:09:37.845Z","dependency_job_id":null,"html_url":"https://github.com/IbraheemTuffaha/python-fastapi-template","commit_stats":null,"previous_names":["ibraheemtuffaha/python-fastapi-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbraheemTuffaha%2Fpython-fastapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbraheemTuffaha%2Fpython-fastapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbraheemTuffaha%2Fpython-fastapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IbraheemTuffaha%2Fpython-fastapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IbraheemTuffaha","download_url":"https://codeload.github.com/IbraheemTuffaha/python-fastapi-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233553762,"owners_count":18693317,"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":["devcontainer","docker","fastapi","github-actions","poetry","pre-commit","python"],"created_at":"2024-10-09T19:28:38.204Z","updated_at":"2025-09-19T06:31:05.635Z","avatar_url":"https://github.com/IbraheemTuffaha.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n  [![pytest Action](https://github.com/IbraheemTuffaha/python-fastapi-template/actions/workflows/pytest.yml/badge.svg)](https://github.com/IbraheemTuffaha/python-fastapi-template/actions/workflows/pytest.yml)\n  [![format Action](https://github.com/IbraheemTuffaha/python-fastapi-template/actions/workflows/format.yml/badge.svg)](https://github.com/IbraheemTuffaha/python-fastapi-template/actions/workflows/format.yml)\n  [![Python Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FIbraheemTuffaha%2Fpython-fastapi-template%2Fmain%2Fpyproject.toml\u0026query=project.requires-python\u0026label=python\u0026color=greenlime)](https://github.com/IbraheemTuffaha/python-fastapi-template/blob/main/pyproject.toml)\n  [![GitHub License](https://img.shields.io/github/license/IbraheemTuffaha/python-fastapi-template?color=greenlime)](https://github.com/IbraheemTuffaha/python-fastapi-template/blob/main/LICENSE)\n  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=IbraheemTuffaha_python-fastapi-template\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=IbraheemTuffaha_python-fastapi-template)\n\u003c/div\u003e\n\n# Python FastAPI Template\n\nA template for a Python FastAPI service:\n- [x] [uv](https://docs.astral.sh/uv/getting-started/) for dependency management\n- [x] [FastAPI](https://fastapi.tiangolo.com/) for building the API\n- [x] [Devcontainer](https://code.visualstudio.com/docs/devcontainers/tutorial) for development environment\n- [x] [Docker](https://www.docker.com/) for containerization\n- [x] [ruff](https://docs.astral.sh/ruff/) for code formatting\n- [x] [pre-commit](https://pre-commit.com/) for code quality checks\n- [x] [Github Actions](https://github.com/features/actions) for CI/CD\n- [x] [pytest](https://docs.pytest.org/) for testing\n- [ ] [Kamal](https://kamal-deploy.org/) for deployment (TODO: add Kamal deploy action)\n\n## Build and run locally\n\nInstall `uv` and `python3.12`\n```\ncurl -LsSf https://astral.sh/uv/install.sh | sh\nuv python install 3.12\n```\n\nThen install dependencies\n```\nuv sync --frozen\n```\n\nRun locally\n```\nuv run uvicorn app.main:app --port 8000 --reload\n```\n\n## Run tests\n```\nuv run pytest\n```\n\n## Build and run using Docker\n\n```\ndocker build -t app .\ndocker run -p 8000:8000 -it app\n```\n\n### Notes\n- If you face an issue with **git ssh access** while pushing new changes, run `ssh-add $HOME/.ssh/\u003cyour ssh key\u003e` in terminal outside the devcontainer.\n\n- If you face an issue during **devcontainer build**, make sure the repo is marked as trusted in VSCode. Check `Source Control` tab in the sidebar to mark the repo safe, then rebuild the devcontainer.\n\n## Sample CRUD API\n\nThe `/v1` directory contains a sample API router demonstrating basic CRUD operations for users:\n\n- Endpoints: Create, Read, Update, Delete users\n- Router setup: `app/v1/routers/base.py` and `app/v1/routers/users.py`\n- User model: `app/v1/models/user.py`\n- User management: `app/v1/services/user/user_manager.py`\n\nUse the samples as a starting point for your own API endpoints. View available endpoints at `http://localhost:8000/docs`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibraheemtuffaha%2Fpython-fastapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibraheemtuffaha%2Fpython-fastapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibraheemtuffaha%2Fpython-fastapi-template/lists"}