{"id":18174349,"url":"https://github.com/Donnype/fastapi-template","last_synced_at":"2025-04-01T15:31:16.216Z","repository":{"id":64467380,"uuid":"553189946","full_name":"Donnype/fastapi-template","owner":"Donnype","description":"A FastAPI and SQLAlchemy project template with Docker and GitHub Actions.","archived":false,"fork":false,"pushed_at":"2024-10-18T07:45:59.000Z","size":166,"stargazers_count":124,"open_issues_count":0,"forks_count":24,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-04T03:34:57.618Z","etag":null,"topics":["fastapi","fastapi-boilerplate","fastapi-sqlalchemy","fastapi-template","makefile","python"],"latest_commit_sha":null,"homepage":"https://bitestreams.com/blog/fastapi_template/","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/Donnype.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":"2022-10-17T21:24:56.000Z","updated_at":"2024-11-20T06:16:54.000Z","dependencies_parsed_at":"2024-01-09T13:38:03.712Z","dependency_job_id":"5d05a4b9-ba89-4e75-80a1-b96b46e6704f","html_url":"https://github.com/Donnype/fastapi-template","commit_stats":null,"previous_names":["donnype/fastapi-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donnype%2Ffastapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donnype%2Ffastapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donnype%2Ffastapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donnype%2Ffastapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Donnype","download_url":"https://codeload.github.com/Donnype/fastapi-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246662325,"owners_count":20813728,"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-boilerplate","fastapi-sqlalchemy","fastapi-template","makefile","python"],"created_at":"2024-11-02T16:02:50.532Z","updated_at":"2025-04-01T15:31:16.209Z","avatar_url":"https://github.com/Donnype.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Fastapi Project Template\n\n\nA FastAPI project template using Make, Docker Compose and Github Actions,\nthat includes **SQLAlchemy**, **Alembic** and an integration test setup.\n\n[![Code Integration](https://github.com/bitestreams/fastapi-template/actions/workflows/code-integration.yml/badge.svg)](https://github.com/bitestreams/fastapi-template/actions/workflows/code-integration.yml)\n\n##  Installation\n\nThe only requirements to develop are **Docker** and **Make**.\nDocker makes it easy to get started and enables easier switching between projects, operating systems and machines.\n\nTo start up the project locally you first clone the project, and then run the following command in the cloned directory:\n```sh\n$ git clone https://github.com/Donnype/fastapi-template.git\n$ cd fastapi-template\n$ make up\n```\nThen to update the schema using alembic, in another shell:\n```sh\n$ make migrate\n```\n**That's it**. The app is set up and should be running at [localhost:5000/docs](localhost:5000/docs).\nCode changes are automatically detected using a mounted docker volume.\n\n\n### Makefile\n\n---\nThe Makefile is the 'entrypoint' for the tools in this structure,\nsuch that you can easily run different commands without remembering the exact arguments.\nRun `make help` to get an overview of the available commands:\n```sh\n$ make help\nup:\n Run the application\ndone: check test\n Prepare for a commit\ntest: utest itest\n Run unit and integration tests\nutest: cleantest\n Run unit tests\nitest: cleantest\n Run integration tests\ncheck: cleantest\n Check the code base\ncleantest:\n Clean up test containers\nmigrations:\n Generate a migration using alembic\nmigrate:\n Run migrations upgrade using alembic\ndowngrade:\n Run migrations downgrade using alembic\nhelp:\n Display this help message\n```\n\nMake allows you to collect common scripts and commands for the project.\nOther projects using different programming languages and frameworks get the same development interface by using Make.\n\n---\n\n### Installation without Docker\nTo install a local copy of the python environment (to get code-completion for example),\nyou must have **Poetry** installed.\nCreate a poetry environment by running `poetry install` at the root of the project.\nTo start up the server in the poetry environment and talk to a test sqlite database in `./test.db`, run\n```bash\n$ export DB_STRING=sqlite:///test.db/\n$ poetry run alembic upgrade head \u0026\u0026 poetry run uvicorn api.main:app --port 5000 --reload\n```\nAgain, the app should be all set up and running at [localhost:5000/docs](localhost:5000/docs).\n\n### Tests\n\n---\n\nThe tests are containerized and the Docker setup can be found in the `.ci/` folder.\nThey are written using Pytest.\nYou can run the tests using:\n```bash\n$ make test\n```\nThis runs the integration \u0026 unit tests.\nIf you want to run them separately, use `make itest` to run the integration tests and `make utest` to run the unit tests.\n\n\n## Further reading\n\nTo read about the benefits of using this template,\ncheck out [my blog post](https://bitestreams.com/blog/fastapi_template/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDonnype%2Ffastapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDonnype%2Ffastapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDonnype%2Ffastapi-template/lists"}