{"id":22428505,"url":"https://github.com/kwame-mintah/python-fastapi-bigger-applications-template","last_synced_at":"2025-08-01T10:32:49.029Z","repository":{"id":200006354,"uuid":"704456480","full_name":"kwame-mintah/python-fastapi-bigger-applications-template","owner":"kwame-mintah","description":"📄 A template project, to demonstrate using FastAPI in a bigger application. ","archived":false,"fork":false,"pushed_at":"2024-07-25T20:52:30.000Z","size":77,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-25T23:41:17.072Z","etag":null,"topics":["docker","docker-compose","dockerfile","fastapi","pytest","python3","template"],"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/kwame-mintah.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}},"created_at":"2023-10-13T09:46:44.000Z","updated_at":"2024-07-25T20:52:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"5cb68d7f-edcf-4767-994c-4bfd1a234479","html_url":"https://github.com/kwame-mintah/python-fastapi-bigger-applications-template","commit_stats":null,"previous_names":["kwame-mintah/python-fastapi-bigger-applications-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fpython-fastapi-bigger-applications-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fpython-fastapi-bigger-applications-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fpython-fastapi-bigger-applications-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fpython-fastapi-bigger-applications-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwame-mintah","download_url":"https://codeload.github.com/kwame-mintah/python-fastapi-bigger-applications-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228363963,"owners_count":17908319,"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":["docker","docker-compose","dockerfile","fastapi","pytest","python3","template"],"created_at":"2024-12-05T20:15:02.396Z","updated_at":"2025-08-01T10:32:49.015Z","avatar_url":"https://github.com/kwame-mintah.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python FastAPI Bigger Applications Template\n\n![python](https://img.shields.io/badge/python-3.11.6-informational)\n![fastapi-0.116.0-informational](https://img.shields.io/badge/fastapi-0.116.0-informational)\n\u003ca href=\"https://github.com/new?template_name=python-fastapi-bigger-applications-template\u0026template_owner=kwame-mintah\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/use%20this-template-blue?logo=github\"\u003e\n\u003c/a\u003e\n\nThis a template project, to demonstrate using FastAPI in a bigger application. The same file structure\nhas been followed as per FastAPI [docs](https://fastapi.tiangolo.com/tutorial/bigger-applications/).\n\nThis repository is intended as a quick-start and includes the following:\n\n- A [`Dockerfile`](/Dockerfile) to build the FastAPI application\n  following [guidelines](https://docs.docker.com/develop/develop-images/guidelines/) and [Distroless variant](/Dockerfile.distroless),\n- A `docker-compose.yml` file to build and start the application,\n- GitHub Action workflow to run linting and unit tests,\n- Pre-commit hooks to run on each commit,\n- Pydantic models as response models for endpoints,\n- Unit and integration feature tests for endpoints.\n\n## Usage\n\n1. Install python packages used for the service\n\n    ```console\n   pip install -r requirements.txt\n    ```\n2. Run the FastAPI server, which will run on port 8000\n\n    ```console\n   python app/main.py\n    ```\n\n   Alternatively, if you're within your [virtual environment]:\n   ```console\n   uvicorn app.main:app --host 0.0.0.0 --port 8000\n   ```\nEndpoint documentation are available on http://127.0.0.1:8000/docs\n\n## Docker\n\nRunning the `docker-compose.yml`, will build a new image python-fastapi-bigger-applications-template-fastapi:latest\nwhich will be used for the `fastapi` service within the container.\n\n```console\ndocker-compose up -d\n```\n\n## Tests\n\nUnit tests are located in `/tests/unit` directory, run unit tests using:\n\n```console\npytest tests/unit\n```\n\nAdditionally, a coverage report can be generated using [`pytest-cov`](https://pypi.org/project/pytest-cov/):\n\n```console\npytest --cov=app tests/unit --cov-report=html:coverage_report\n```\n\nWill generate a coverage HTML file, in the `/coverage_report/` directory, simply open the `index.html` in your chosen\nweb browser.\n\nIntegration tests are located in `/tests/integration` directory, run integration using:\n\n```console\npytest tests/integration\n```\n\n## Contributing\n\nGit hook scripts are very helpful for identifying simple issues before pushing any changes.\nHooks will run on every commit automatically pointing out issues in the code e.g. trailing whitespace.\n\nTo help with the maintenance of these hooks, [pre-commit](https://pre-commit.com/) is used, along\nwith [pre-commit-hooks](https://pre-commit.com/#adding-pre-commit-plugins-to-your-project).\n\nPlease following [these instructions](https://pre-commit.com/#install) to install `pre-commit` locally and ensure that\nyou have run\n`pre-commit install` to install the hooks for this project.\n\nAdditionally, once installed, the hooks can be updated to the latest available version with `pre-commit autoupdate`.\n\n## GitHub Actions (CI/CD)\n\nGitHub project has three workflow set up, found in `.github/workflows/`:\n\n- '🧹 Run linter' (`run-linter.yml`): To run [Flake8](https://flake8.pycqa.org/en/latest/) and check Python code system\n  and comply with various style guides.\n- '🧪 Run unit tests' (`run-unit-tests.yml`): To run unit tests within a continuous integration (CI) environment,\n  using [`pytest`](https://docs.pytest.org/en/8.2.x/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwame-mintah%2Fpython-fastapi-bigger-applications-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwame-mintah%2Fpython-fastapi-bigger-applications-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwame-mintah%2Fpython-fastapi-bigger-applications-template/lists"}