{"id":25670169,"url":"https://github.com/rbas/python-project-example-architecture","last_synced_at":"2025-09-11T17:33:44.878Z","repository":{"id":136251414,"uuid":"495919261","full_name":"rbas/python-project-example-architecture","owner":"rbas","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-24T17:21:30.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T11:39:38.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rbas.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-05-24T17:14:32.000Z","updated_at":"2022-08-18T12:11:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"13bc1297-d6ac-468a-813b-5cdcbd592282","html_url":"https://github.com/rbas/python-project-example-architecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbas%2Fpython-project-example-architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbas%2Fpython-project-example-architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbas%2Fpython-project-example-architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbas%2Fpython-project-example-architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbas","download_url":"https://codeload.github.com/rbas/python-project-example-architecture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbas%2Fpython-project-example-architecture/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178494,"owners_count":22817386,"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":[],"created_at":"2025-02-24T11:31:29.196Z","updated_at":"2025-06-11T01:07:21.604Z","avatar_url":"https://github.com/rbas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python project architecture example\n\n## Goal\nThe Goal of this project to show python project architecture what is framework-agnostic and following [DDD](https://www.domaindrivendesign.org) and [Clean Code Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html).\nAll application code is in different layers with strict boundaries. That should help with easier reading and future project changes like.\n* Change 3rd party API provider, changes will happen in `Persistence` layer, It should not affect business logic.\n* Infrastructural changes, they don't affect business logic, it means it should happen in its layer\n* Changing framework. For example chosen framework is not support in serverless environments, if project need to be migrated. It should not affect business logic.\n* Etc...\n\nAll those changes should be more or less easy to do in such architecture chosen in this project. \n\n\n### Disclaimer\nProject is just for learning purpose to show architecture examples by using [DDD](https://www.domaindrivendesign.org) and [Clean Code Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) principles.\nAuthor didn't mean that chosen solution is silver bullet in software architecture. In software development is none of it.\nEven though that project is fully functional not all parts are fully done.\n\n## How to read project\nAll documentation is written as part of code. Suggested order for reading is following.\n\n1) `entity/entities.py`\n2) `entity/valueobject.py`\n3) `customtypes/invoice.py`\n4) `api.py`\n5) `usecases.py`\n6) `persistance/repository.py`\n7) `persistance/mapper/dummy.py`\n\n## Installation\nProject is fully functional, made on top of Python version 3.10. By using [Starlette](https://www.starlette.io/) framework with [Uvicorn](https://www.uvicorn.org) combination.\n\n### Install dependencies\n\n```shell\npip install -r requirements.txt\n```\n\n### Run HTTP server\n```shell\ncd src\nuvicorn api:app --reload\n```\n\n## Testing\n\n### Run tests\n\n```shell\npytest\n```\n\n### Integration tests via HTTP\n\nIntegration tests are in `tests.http`\n\n## What next?\nThe best way how to learn is to practice. Fork this repository and start working with code.\n* Finish all missing API endpoints\n  * `POST /invoices` is not parsing data from request\n  * `GET /invoices` does not exist\n  * `PUT /invoices/\u003cid\u003e/mark-as-paid/` does not exist\n* Create `Mapper` for persistence storage like: SQL like storages, Filesytem, memory etc...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbas%2Fpython-project-example-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbas%2Fpython-project-example-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbas%2Fpython-project-example-architecture/lists"}