Skip to content

Instantly share code, notes, and snippets.

@kanelv
Created April 14, 2024 17:51
Show Gist options
  • Save kanelv/c79dbfda80d018d3f8cbb5f55f0de7fe to your computer and use it in GitHub Desktop.
Save kanelv/c79dbfda80d018d3f8cbb5f55f0de7fe to your computer and use it in GitHub Desktop.
Project Folder Structure Diagram for Spring-boot Clean Architecture Demo
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── example
│ │ │ ├── adapters
│ │ │ │ ├── controllers
│ │ │ │ │── database
│ │ │ │ │ ├── postgresql # Implementation for PostgreSQL
│ │ │ │ │ │ ├── entities # PostgreSQL entity classes
│ │ │ │ │ │ ├── repositories# PostgreSQL repository implementations
│ │ │ │ │ │ └── config # PostgreSQL-specific configurations
│ │ │ │ │ └── mongodb # Implementation for MongoDB
│ │ │ │ │ ├── entities # MongoDB document classes
│ │ │ │ │ ├── repositories# MongoDB repository implementations
│ │ │ │ │ └── config # MongoDB-specific configurations
│ │ │ │ ├── aws # AWS-specific code
│ │ │ │ │ ├── services # AWS service clients
│ │ │ │ │ ├── config # AWS-specific configurations
│ │ │ │ │ └── ...
│ │ │ │ ├── services
│ │ │ │ │ ├── ProductServiceAdapter.java # Implementation class
│ │ │ │ │ ├── UserServiceAdapter.java # Implementation class
│ │ │ │ │ └── ...
│ │ │ │ ├── application1 # Controllers and configurations for application 1
│ │ │ │ │ ├── controllers
│ │ │ │ │ └── config
│ │ │ │ │── application2 # Controllers and configurations for application 2
│ │ │ │ │ ├── controllers
│ │ │ │ │ └── config
│ │ │ │ └── vehicle
│ │ │ │ ├── Car.java # Concrete subclass
│ │ │ │ ├── Bus.java # Concrete subclass
│ │ │ │ ├── Truck.java # Concrete subclass
│ │ │ │ └── VehicleAdapter.java # Interface
│ │ │ │ ├── frameworks
│ │ │ │ │ ├── SpringSecurityConfig.java # Configuration for Spring Security
│ │ │ │ │ ├── AWSClientAdapter.java # Adapter for AWS SDK
│ │ │ │ │ └── ...
│ │ │ │ └── ...
│ │ │ ├── application
│ │ │ │ │── services # Application services
│ │ │ │ │ ├── ProductServiceInterface.java # Service interface
│ │ │ │ │ ├── UserServiceInterface.java # Service interface
│ │ │ │ │ └── ...
│ │ │ │ │── usecases # Implementations of shared use cases
│ │ │ │ │ ├── ProductUseCase.java # Example of a use case
│ │ │ │ │ ├── ProductManager.java # Class to manage products
│ │ │ │ │ └── ...
│ │ │ │ └── ...
│ │ │ ├── domain
│ │ │ │ ├── factories # Factories for creating domain objects
│ │ │ │ │ └── ProductFactory.java # Factory for creating Product objects
│ │ │ │ ├── models # Domain entities and value objects
│ │ │ │ │ └── Product.java # Example of a domain entity
│ │ │ │ │ └── Vehicle.java # Abstract class
│ │ │ │ └── repositories # Repository interfaces
│ │ │ └── config
│ │ └── resources
│ │ ├── application.properties
│ │ │── db
│ │ │ └── migration # Database migration scripts (e.g., Flyway)
│ │ └── ...
└── pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment