{"id":30454477,"url":"https://github.com/bit-maximum/fastapi-feature-rich-template","last_synced_at":"2026-04-09T18:57:05.521Z","repository":{"id":308911441,"uuid":"1034400470","full_name":"Bit-Maximum/FastAPI-Feature-rich-Template","owner":"Bit-Maximum","description":"FastAPI Production-Ready feature rich template based in DDD","archived":false,"fork":false,"pushed_at":"2025-08-16T14:11:15.000Z","size":956,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T16:13:09.820Z","etag":null,"topics":["backend","docker","fastapi","kubernetes","postgresql","python","rebbitmq","redis","rest-api","traefik"],"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/Bit-Maximum.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,"zenodo":null}},"created_at":"2025-08-08T10:27:44.000Z","updated_at":"2025-08-16T14:11:18.000Z","dependencies_parsed_at":"2025-08-08T17:39:35.854Z","dependency_job_id":null,"html_url":"https://github.com/Bit-Maximum/FastAPI-Feature-rich-Template","commit_stats":null,"previous_names":["bit-maximum/fastapi-feature-rich-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bit-Maximum/FastAPI-Feature-rich-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Maximum%2FFastAPI-Feature-rich-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Maximum%2FFastAPI-Feature-rich-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Maximum%2FFastAPI-Feature-rich-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Maximum%2FFastAPI-Feature-rich-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bit-Maximum","download_url":"https://codeload.github.com/Bit-Maximum/FastAPI-Feature-rich-Template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Maximum%2FFastAPI-Feature-rich-Template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271755407,"owners_count":24815398,"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-08-23T02:00:09.327Z","response_time":69,"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":["backend","docker","fastapi","kubernetes","postgresql","python","rebbitmq","redis","rest-api","traefik"],"created_at":"2025-08-23T16:01:43.581Z","updated_at":"2026-04-09T18:57:05.516Z","avatar_url":"https://github.com/Bit-Maximum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# I am currently working on my master's thesis.\n\n## Work in progress | Breaking changes expected\n\n### Future plans:\n- Add caching with Redis\n- Refactor integration with Taskiq\n- Rework documentation\n- Add metrics with OpenTelemetry and Grafana\n- Add interactive demo\n\n\n\n## Docker\n\nYou can start the project with docker using this command:\n\n```bash\ndocker-compose up --build\n```\n\nIf you want to develop in docker with autoreload and exposed ports add `-f deploy/docker-compose.dev.yml` to your docker command.\nLike this:\n\n```bash\ndocker-compose -f docker-compose.yml -f deploy/docker-compose.dev.yml --project-directory . up --build\n```\n\nThis command exposes the web application on port 8000, mounts current directory and enables autoreload.\n\nBut you have to rebuild image every time you modify `poetry.lock` or `pyproject.toml` with this command:\n\n```bash\ndocker-compose build\n```\n\n## Project structure\n\n```bash\n$ tree \"app\"\napp\n├── conftest.py  # Fixtures for all tests.\n├── db  # module contains db configurations\n│   ├── dao  # Data Access Objects. Contains different classes to interact with database.\n│   └── models  # Package contains different models for ORMs.\n├── __main__.py  # Startup script. Starts uvicorn.\n├── adapters  # Package for different external adapters such as rabbit or redis etc.\n├── settings.py  # Main configuration settings for project.\n├── static  # Static content.\n├── tests  # Tests for project.\n└── controller  # Package contains controller server. Handlers, startup config.\n    ├── api  # Package with all handlers.\n    │   └── router.py  # Main router.\n    ├── application.py  # FastAPI application configuration.\n    └── lifespan.py  # Contains actions to perform on startup and shutdown.\n```\n\n## Configuration\n\nThis application can be configured with environment variables.\n\nYou can create `.env` file in the root directory and place all\nenvironment variables here.\n\nAll environment variables should start with \"APP_\" prefix.\n\nFor example if you see in your \"app/settings.py\" a variable named like\n`random_parameter`, you should provide the \"APP_RANDOM_PARAMETER\"\nvariable to configure the value. This behaviour can be changed by overriding `env_prefix` property\nin `app.settings.Settings.Config`.\n\nAn example of .env file:\n```bash\nAPP_RELOAD=\"True\"\nAPP_PORT=\"8000\"\nAPP_ENVIRONMENT=\"dev\"\n```\n\nYou can read more about BaseSettings class here: https://pydantic-docs.helpmanual.io/usage/settings/\n## OpenTelemetry\n\nIf you want to start your project with OpenTelemetry collector\nyou can add `-f ./deploy/docker-compose.otlp.yml` to your docker command.\n\nLike this:\n\n```bash\ndocker-compose -f docker-compose.yml -f deploy/docker-compose.otlp.yml --project-directory . up\n```\n\nThis command will start OpenTelemetry collector and jaeger.\nAfter sending a requests you can see traces in jaeger's UI\nat http://localhost:16686/.\n\nThis docker configuration is not supposed to be used in production.\nIt's only for demo purpose.\n\nYou can read more about OpenTelemetry here: https://opentelemetry.io/\n\n## Pre-commit\n\nTo install pre-commit simply run inside the shell:\n```bash\npre-commit install\n```\n\npre-commit is very useful to check your code before publishing it.\nIt's configured using .pre-commit-config.yaml file.\n\nBy default it runs:\n* black (formats your code);\n* mypy (validates types);\n* ruff (spots possible bugs);\n\n\nYou can read more about pre-commit here: https://pre-commit.com/\n\n## Kubernetes\nTo run your app in kubernetes\njust run:\n```bash\nkubectl apply -f deploy/kube\n```\n\nIt will create needed components.\n\nIf you haven't pushed to docker registry yet, you can build image locally.\n\n```bash\ndocker-compose build\ndocker save --output app.tar app:latest\n```\n\n## Migrations\n\nIf you want to migrate your database, you should run following commands:\n```bash\n# To run all migrations until the migration with revision_id.\nalembic upgrade \"\u003crevision_id\u003e\"\n\n# To perform all pending migrations.\nalembic upgrade \"head\"\n```\n\n### Reverting migrations\n\nIf you want to revert migrations, you should run:\n```bash\n# revert all migrations up to: revision_id.\nalembic downgrade \u003crevision_id\u003e\n\n# Revert everything.\n alembic downgrade base\n```\n\n### Migration generation\n\nTo generate migrations you should run:\n```bash\n# For automatic change detection.\nalembic revision --autogenerate\n\n# For empty file generation.\nalembic revision\n```\n\n\n## Running tests\n\nIf you want to run it in docker, simply run:\n\n```bash\ndocker-compose run --build --rm api pytest -vv .\ndocker-compose down\n```\n\nFor running tests on your local machine.\n1. you need to start a database.\n\nI prefer doing it with docker:\n```\ndocker run -p \"5432:5432\" -e \"POSTGRES_PASSWORD=app\" -e \"POSTGRES_USER=app\" -e \"POSTGRES_DB=app\" postgres:16.3-bullseye\n```\n\n\n2. Run the pytest.\n```bash\npytest -vv .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbit-maximum%2Ffastapi-feature-rich-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbit-maximum%2Ffastapi-feature-rich-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbit-maximum%2Ffastapi-feature-rich-template/lists"}