{"id":23859123,"url":"https://github.com/angelospanag/fastapi-uv-starter","last_synced_at":"2025-12-30T01:23:50.474Z","repository":{"id":80607862,"uuid":"587037085","full_name":"angelospanag/fastapi-uv-starter","owner":"angelospanag","description":"A starter project using Python, FastAPI and uv.","archived":false,"fork":false,"pushed_at":"2025-04-24T16:00:23.000Z","size":408,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-24T15:59:52.875Z","etag":null,"topics":["docker","fastapi","pytest","pytest-cov","python","ruff","uv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angelospanag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-01-09T20:15:53.000Z","updated_at":"2025-04-24T16:00:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"97932053-2142-4375-a1fb-aa8dc57a6976","html_url":"https://github.com/angelospanag/fastapi-uv-starter","commit_stats":null,"previous_names":["angelospanag/fastapi-poetry-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/angelospanag/fastapi-uv-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelospanag%2Ffastapi-uv-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelospanag%2Ffastapi-uv-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelospanag%2Ffastapi-uv-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelospanag%2Ffastapi-uv-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angelospanag","download_url":"https://codeload.github.com/angelospanag/fastapi-uv-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelospanag%2Ffastapi-uv-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274152117,"owners_count":25231285,"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-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["docker","fastapi","pytest","pytest-cov","python","ruff","uv"],"created_at":"2025-01-03T03:31:54.360Z","updated_at":"2025-12-30T01:23:50.468Z","avatar_url":"https://github.com/angelospanag.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi-uv-starter\n\nA starter project using Python, FastAPI and uv.\n\n\u003c!-- TOC --\u003e\n* [fastapi-uv-starter](#fastapi-uv-starter)\n  * [Description](#description)\n  * [Prerequisites](#prerequisites)\n    * [1. Install Python 3 and uv](#1-install-python-3-and-uv)\n    * [2. Create a virtual environment with all necessary dependencies](#2-create-a-virtual-environment-with-all-necessary-dependencies)\n  * [Run application](#run-application)\n    * [Development mode](#development-mode)\n    * [Production mode](#production-mode)\n  * [Testing](#testing)\n    * [With coverage](#with-coverage)\n    * [With coverage and HTML output](#with-coverage-and-html-output)\n  * [Linting](#linting)\n  * [Formatting](#formatting)\n  * [Containerisation](#containerisation)\n    * [1. Build image and tag it as `fastapi-uv-starter`](#1-build-image-and-tag-it-as-fastapi-uv-starter)\n    * [2. Run a container of the previously tagged image (`fastapi-uv-starter`)](#2-run-a-container-of-the-previously-tagged-image-fastapi-uv-starter)\n    * [3. Check running containers](#3-check-running-containers)\n    * [4. Hit sample endpoint](#4-hit-sample-endpoint)\n\u003c!-- TOC --\u003e\n\n## Description\n\nA project starter for personal usage containing the following:\n\n- [Python 3.14.\\*](https://www.python.org/)\n- [FastAPI](https://fastapi.tiangolo.com/) web framework\n- Structured logging using [`structlog`](https://www.structlog.org/)\n- Dependency management using [`uv`](https://docs.astral.sh/uv/)\n- Containerisation using a Dockerfile\n- Testing with [`pytest`](https://docs.pytest.org/) and optionally with coverage\n  with [`pytest-cov`](https://pytest-cov.readthedocs.io/)\n- Linting/formatting using [`Ruff`](https://docs.astral.sh/ruff/)\n- [`.gitignore`](https://github.com/github/gitignore/blob/main/Python.gitignore)\n\n## Prerequisites\n\n- [Python 3.14.\\*](https://www.python.org/downloads/)\n- [uv](https://docs.astral.sh/uv/)\n\n### 1. Install Python 3 and uv\n\n**MacOS (using `brew`)**\n\n```bash\nbrew install python@3.14 uv\n```\n\n**Ubuntu/Debian**\n\n```bash\nsudo add-apt-repository ppa:deadsnakes/ppa\nsudo apt update\nsudo apt install python3.14\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\n### 2. Create a virtual environment with all necessary dependencies\n\nFrom the root of the project execute:\n\n```bash\nuv sync\n```\n\n## Run application\n\n### Development mode\n\n```bash\nuv run fastapi dev\n```\n\n### Production mode\n\n```bash\nuv run fastapi run\n```\n\n## Testing\n\n```bash\nuv run pytest\n```\n\n### With coverage\n\n```bash\nuv run pytest --cov=app\n```\n\n### With coverage and HTML output\n\n```bash\nuv run pytest --cov-report html --cov=app\n```\n\n## Linting\n\n```bash\nuv run ruff check app/* tests/*\n```\n\n## Formatting\n\n```bash\nuv run ruff format app/* tests/*\n```\n\n## Containerisation\n\nThe following `podman` commands are direct replacements of the Docker CLI. You can see that their syntax is identical:\n\n### 1. Build image and tag it as `fastapi-uv-starter`\n\n```bash\npodman image build -t fastapi-uv-starter .\n```\n\n### 2. Run a container of the previously tagged image (`fastapi-uv-starter`)\n\nRun our FastAPI application and map our local port `8000` to `80` on the running container:\n\n```bash\npodman container run -d --name fastapi-uv-starter -p 8000:80 --network bridge fastapi-uv-starter\n```\n\n### 3. Check running containers\n\n```bash\npodman ps\n```\n\n```bash\nCONTAINER ID  IMAGE                            COMMAND               CREATED         STATUS             PORTS                 NAMES\n78586e5b4683  localhost/fastapi-uv-starter:latest  uvicorn main:app ...  13 minutes ago  Up 5 minutes ago  0.0.0.0:8000-\u003e80/tcp  nifty_roentgen\n```\n\n### 4. Hit sample endpoint\n\nOur FastAPI server now runs on port `8000` on our local machine. We can test it with:\n\n```bash\ncurl -i http://localhost:8000/healthcheck\n```\n\nOutput:\n\n```bash\nHTTP/1.1 200 OK\nserver: uvicorn\ncontent-length: 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelospanag%2Ffastapi-uv-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangelospanag%2Ffastapi-uv-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelospanag%2Ffastapi-uv-starter/lists"}