Stop memorizing definitions. Start refactoring real code.
This repository contains real-world case studies demonstrating how to apply SOLID principles. Unlike other tutorials that use abstract "Animal/Dog" examples, we use realistic scenarios (e.g., Payment Gateways, Data Pipelines) to show the actual business value of clean architecture.
If this repository helped you understand SOLID better, please give it a Star! It helps others find these resources.
This project is language-agnostic. While the initial case studies are written in TypeScript, we welcome contributions in Go, Java, Rust, C#, Python, and more.
| # | Principle | Case Study Topic | Key Takeaway |
|---|---|---|---|
| 01 | SRP | Keyword Processing Pipeline | Breaking a monolithic "God Handler" into Service, Parser, and Repository layers. |
| 02 | OCP | Payroll System | How to add features without modifying existing code. |
| 03 | LSP | Event Ticketing System | Subtyping without breaking the system. |
| 04 | ISP | Media Player | Keeping interfaces small and client-specific. |
| 05 | DIP | Order Processor | Decoupling high-level logic from low-level details. |
- Choose a Case Study: Navigate to the
case-studiesfolder (e.g.,case-studies/01-srp-keyword-processor). - Read the Concept: The local
README.mdexplains the problem and the solution conceptually. - Select Your Language: Go into the language folder of your choice (e.g.,
typescript/). - Compare: Look at the
bad/folder (the mess) and thegood/folder (the fix).
Want to add a solution in Go, Rust, or Java? We would love that!
- Found a bug? Open an Issue.
- Ready to code? Read CONTRIBUTING.md to ensure your code matches our structure.