A practical implementation of Clean Architecture principles inspired by Robert C. Martin's "Clean Architecture" book. This repository serves as both a reference implementation and a template for new projects.
- Core Principles
- Repository Structure
- Getting Started
- Testing Strategy
- Documentation
- Case Studies
- Contributing
- License
This implementation follows the key tenets of Clean Architecture:
- Independent of Frameworks: Core business logic doesn't depend on any external libraries
- Testable: Business rules can be tested without UI, DB, or external services
- Independent of UI: UI can change easily without changing business rules
- Independent of Database: Business rules aren't bound to any specific database
- Independent of External Services: Business rules don't know about external interfaces
clean-architecture-project/
├── docs/ # Architectural documentation and principles
├── src/ # Source code organized by clean architecture layers
├── tests/ # Comprehensive test suites
├── examples/ # Practical implementations of concepts
└── scripts/ # Development and deployment utilities
- Core: Enterprise business rules and entities
- Application: Application-specific business rules and use cases
- Interface Adapters: Controllers, presenters, and gateways
- Infrastructure: Frameworks, databases, and external services
- Main: Composition root and application entry point
- Node.js/Python/Java (depending on your implementation)
- Docker (for containerized dependencies)
- Make (for build automation)
git clone https://github.com/JawherKl/clean-architecture.git
cd clean-architecture
npm install # or pip install -r requirements.txt
make run # or npm start / python main.py
We employ a multi-layered testing approach:
make test # Run all tests
make test-unit # Run unit tests only
make test-int # Run integration tests
make test-e2e # Run end-to-end tests
Explore our comprehensive documentation:
Practical implementations included:
- Video Sales System - Complete e-commerce example
- Embedded Systems - Clean Architecture in constrained environments
- Microservices - Service-oriented implementations
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Inspired by: "Clean Architecture: A Craftsman's Guide to Software Structure and Design" by Robert C. Martin