{"repo":"cdddg/py-clean-arch","free":true,"listed":false,"github":"https://github.com/cdddg/py-clean-arch","clone":"git clone https://github.com/cdddg/py-clean-arch.git","description":"A Python implementation of Clean Architecture, inspired by Uncle Bob's book","language":"Python","stars":197,"topics":["fastapi","clean-architecture","python","dependency-injection","pokedex-api","unit-of-work","asyncio","graphql","restful-api","sqlalchemy2"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"py-clean-arch A Python architecture sample that demonstrates Uncle Bob's Clean Architecture through a Pokémon and Trainer API built with FastAPI. The focus is on showing how layers are separated, how dependencies flow inward, and how infrastructure can be swapped at the structural level. This is a learning-oriented project, not a production template. For background and common questions, see the FAQ. Architecture This project applies Clean Architecture with the following practices: 1. Framework Independence : FastAPI is confined to the controllers layer — use cases and models have no framework dependency. 2. Testability : Business rules in use cases can be tested without HTTP or database. 3. UI Independence : REST and GraphQL are interchangeable outer-layer interfaces. 4. Database Independence : Multiple databases implement the same repository contracts. 5. External Independence : Domain logic does not depend on specific APIs, ORMs, or drivers. \\ source: yoan-thirion.gitbook.io 🧱 Project Structure 🧬 What This Sample Demonstrates REST and GraphQL share the same use cases layer — the API protocol is an outer-layer detail. 5 databases (SQLite, MySQL, PostgreSQL, MongoDB, Redis) sit behind the same repository contracts — storage is also an outer-layer detail. Two entities illustrate different complexity levels: - Pokemon — basic CRUD - Trainer — business rules like team size limits, ownership checks, and atomic trades Enabled by several key design decisions: - Repository Pattern","default_branch":null,"files":null,"tree":[],"storefront":"/r/cdddg","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cdddg/py-clean-arch/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}