This repository is a collection of Clean Architecture examples implemented in Golang with Gin framework and MongoDB as the database. It demonstrates different architectural patterns to build scalable, maintainable, and testable applications.
- Feature-Based Architecture
- Hexagonal Architecture
- Domain-Driven Design (DDD)
- Other modern architecture patterns
- Clean and modular code structure
- Separation of concerns with layers
- Example implementations for each architecture
- Dependency injection and inversion
- Testable components
- Optimized for scalability and maintainability
git clone https://github.com/abdorrahmani/golang-clean-architectures-mongo.git
cd golang-clean-architectures-mongo
go mod tidy
- Choose the architecture you want to explore from the
examples
folder. - Navigate to the respective folder.
- Run the application:
go run main.go
A simple yet effective way to organize code by features. Each feature has its own folder containing its controllers, services, and repository.
Also known as "Ports and Adapters," this architecture emphasizes decoupling the core application logic from external dependencies.
A more advanced architectural style focused on modeling the business domain and its logic in a way that closely aligns with real-world processes.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature.
- Commit your changes and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.