{"repo":"iktakahiro/dddpy","free":true,"listed":false,"github":"https://github.com/iktakahiro/dddpy","clone":"git clone https://github.com/iktakahiro/dddpy.git","description":"Python DDD & Onion Architecture Example and Techniques","language":"Python","stars":728,"topics":["ddd-architecture","ddd-example","python","fastapi","onion-architecture"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Python DDD & Onion-Architecture Example and Techniques English 日本語 Go implementation: oniongo NOTE : This repository is an example to demonstrate \"how to implement DDD architecture in a Python web application.\" If you use this as a reference, ensure to implement authentication and security before deploying it to a real-world environment! DeepWiki powered by Devin: My blog post: Tech Stack FastAPI SQLAlchemy SQLite uv Docker Prerequisites Python 3.13 or higher uv - Python package installer and resolver Project Setup 1. Install dependencies using uv: 2. Run the web app Code Architecture The directory structure is based on Onion Architecture: Domain Layer The domain layer contains the core business logic and rules. It includes: 1. Entities 2. Value Objects 3. Repository Interfaces Here's how each component is implemented in this project: 1. Entities Entities are domain models with unique identifiers. In this project, the Todo class is implemented as an entity: Key characteristics of entities: Have a unique identifier ( id ) Can change state (e.g., update title , update description , start , complete methods) Identity is determined by the identifier ( eq method implementation) May be created through factory methods (e.g., create ) In this project, the eq method is implemented to determine instance identity solely based on the id : Key points of this implementation: Identity is determined solely by the identifier ( id ) Type safety is ensured with isinstance check 2. Value Objects","default_branch":null,"files":null,"tree":[],"storefront":"/r/iktakahiro","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/iktakahiro/dddpy/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."}