{"id":26996495,"url":"https://github.com/madi-s/fastapi-tdd-docker","last_synced_at":"2026-04-20T04:01:07.863Z","repository":{"id":109168006,"uuid":"574441469","full_name":"Madi-S/FastAPI-TDD-Docker","owner":"Madi-S","description":"An example of dockerized fastapi application developed using test-driven technology ","archived":false,"fork":false,"pushed_at":"2022-12-15T10:39:08.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T18:43:56.636Z","etag":null,"topics":["docker","fastapi","tdd","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/Madi-S.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-05T10:18:02.000Z","updated_at":"2024-03-09T18:02:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"67a43038-466b-4e76-b38b-cf71b9f62c28","html_url":"https://github.com/Madi-S/FastAPI-TDD-Docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Madi-S/FastAPI-TDD-Docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madi-S%2FFastAPI-TDD-Docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madi-S%2FFastAPI-TDD-Docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madi-S%2FFastAPI-TDD-Docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madi-S%2FFastAPI-TDD-Docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Madi-S","download_url":"https://codeload.github.com/Madi-S/FastAPI-TDD-Docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madi-S%2FFastAPI-TDD-Docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32032302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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","tdd","template"],"created_at":"2025-04-04T01:18:53.268Z","updated_at":"2026-04-20T04:01:07.854Z","avatar_url":"https://github.com/Madi-S.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI-TDD-Docker\n\n### Commands (mostly for Windows)\n\nRun application\n\n```\nuvicorn app.main:app --reload\n```\n\nGet into pyenv\n\n```\nenv\\Scripts\\activate.bat\n```\n\nSet environmental variables\n\n```\nset TESTING=1\n```\n\nSet up docker\n\n```\ndocker-compose up -d --build\n```\n\nConnect to postgres\n\n```\ndocker-compose exec web-db psql -U postgres\n```\n\nEnter postgres database\n\n```\ndocker-compose exec web-db psql -U postgres\n```\n\nInit migrations using Aerich\n\n```\ndocker-compose exec web aerich init -t app.db.TORTOISE_ORM\n```\n\nCreate a migration\n\n```\ndocker-compose exec web aerich init-db\n```\n\nRun tests\n\n```\ndocker-compose exec web python -m pytest\n```\n\nRun tests with monkeypatching\n\n```\ndocker-compose exec web pytest -k \"unit\" -n auto\n```\n\nInitialize schemas\n\n```\ndocker-compose exec web python app/db.py\n```\n\nRun tests with coverage\n\n```\ndocker-compose exec web python -m pytest --cov=\".\"\ndocker-compose exec web python -m pytest --cov=\".\" --cov-report html\n```\n\nRun flake8 for code quality\n\n```\ndocker-compose exec web flake8 .\n```\n\nCheck for formatting errors and format them using black\n\n```\ndocker-compose exec web black . --check\ndocker-compose exec web black . --diff\ndocker-compose exec web black .\n```\n\nSort imports using isort\n\n```\ndocker-compose exec web isort . --check-only\ndocker-compose exec web isort . --diff\ndocker-compose exec web isort .\n```\n\nVerify all\n\n```\ndocker-compose exec web flake8 .\ndocker-compose exec web black . --check\ndocker-compose exec web isort . --check-only\n```\n\n\u003chr\u003e\n\n### Overview\n\nAn example of dockerized fastapi application developed using test-driven technology\nThis application will follow RESTful design principles, comprise docker configuration, use Tortoise ORM interacting with Postgres\nPytest will be used fod test-driven development\nApplication will be configured for deployment on Heroku\n\n\u003chr\u003e\n\n### The application routes:\n\n| Endpoint       | Method | CRUD Operation | Result                          |\n| -------------- | ------ | -------------- | ------------------------------- |\n| /summaries     | GET    | READ           | Retrieve all summaries          |\n| /summaries/:id | GET    | READ           | Retrieve a single summary by id |\n| /summaries     | POST   | CREATE         | Create a summary                |\n| /summaries/:id | PUT    | UPDATE         | Update a summary by id          |\n| /summaries:id  | DELETE | DELETE         | Delete a summary by id          |\n\n\u003chr\u003e\n\n### Useful links\n\n[FastAPI](https://fastapi.tiangolo.com)\n\n[Pytest](https://docs.pytest.org/en/7.2.x)\n\n[Docker](https://www.docker.com)\n\n[Tortoise](https://tortoise.github.io)\n\n[Postgres](https://www.postgresql.org)\n\n[Heroku](https://devcenter.heroku.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadi-s%2Ffastapi-tdd-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadi-s%2Ffastapi-tdd-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadi-s%2Ffastapi-tdd-docker/lists"}