| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Here you will describe this project, what it does, and its goals, making it clear to everyone. Example:
The Java Architecture Template is a project designed to serve as a template for creating applications, aiming for development with exceptional technical quality to ensure long-term maintainability. In this template, we provide a user registration endpoint that publishes a CloudEvent to Kafka when a user is registered. A listener consumes CloudEvents of type br.com.helpdev.sample.user.created and enriches the user with address data.
📖 Read this in:
Related skill: hexagon-scaffold for adding feature slices that follow the template's hexagonal structure.
This project follows the Hexagonal Architecture, as proposed by Alistair Cockburn, focuses on decoupling the application’s core business logic from its input and output mechanisms. This design principle promotes adaptability, testability, and sustainability by encapsulating the application layer (business core) and exposing defined ports for interactions with external systems.
The architecture isolates the core domain logic by structuring the application into distinct layers:
Adapters Layer: Handles communication with external systems (e.g., databases, APIs, or user interfaces). Divided into:
Core Layer: Represents the heart of the application:
Read more about: O Core Domain: Modelando Domínios Ricos and O Use Case: Modelando as Interações do Seu Domínio
The structure adheres to the principles of Hexagonal Architecture, as demonstrated below:
application
br.com.helpdev.sample
├── adapters
│ ├── input # Controllers, event listeners, or other entry points
│ ├── output # Database repositories, external API clients, etc.
├── config # Configuration files and application settings
├── core # Core business logic
│ ├── ports
│ │ ├── input # Interfaces defining input interactions (e.g., commands, queries)
│ │ ├── output # Interfaces defining output interactions (e.g., persistence, external APIs)
│ ├── domain # Entities, value objects, and aggregates
│ ├── usecases # Application-specific business workflows
acceptance-test
# Integration tests with real Docker application.
Related skill: archunit-guard for preserving and evolving the repository's architecture rules safely.
This architecture is warranted by ArchUnit tests to ensure the project's compliance with the defined structure. These tests validate the project's adherence to the Hexagonal Architecture principles, guaranteeing the separation of concerns and the independence of the core business logic from external systems.
Read more about: Garantindo a arquitetura de uma aplicação sem complexidade
Related skill: acceptance-scenario-scaffold for Docker-based black-box scenarios in the acceptance-test/ module.
To ensure robust testing, the acceptance-test module encapsulates the application within a Docker image and executes integration tests in an environment that closely mimics the real-world behavior of the application. This approach guarantees homogeneity in the application modules by restricting unit tests to the main application module, while handling integration tests separately within the acceptance-test module.
This separation ensures:
Realistic Test Environments: Integration tests are performed in conditions resembling the actual runtime environment, improving test reliability.
Clear Test Scope: Unit tests focus solely on isolated components within the core application, while integration tests validate end-to-end workflows and external interactions.
Ease of Deployment: Encapsulation in Docker allows seamless deployment and execution of tests across different environments.
By adhering to this strategy, the acceptance-test module becomes an essential part of maintaining the integrity and reliability of the application during its lifecycle. View module README.
Read more about: Separando os testes integrados de sua aplicação em um novo conceito
This project provides a complete local stack with all the dependencies necessary to run the application. Additionally, an observability environment using OpenTelemetry and Grafana is included.
Ensure you have the following tools installed on your machine:
Note: Maven was embedded in the project to avoid the need to install it on your machine.
For a seamless development experience, the project includes a Makefile with predefined commands to simplify common tasks. These commands encapsulate
Run Tests:
Run Application:
Run Infrastructure:
Run Entire Application:
Stop Services:
This setup ensures an efficient and consistent development experience, enabling seamless integration and monitoring capabilities in a local environment.
Related skill: flyway-decoupled for versioned migrations, Flyway runner wiring, and startup ordering.
To ensure better startup performance and avoid concurrency issues in Kubernetes environments, Flyway has been implemented as a decoupled database migration tool. This design enables the migration process to run independently of the application.
Key Features:
This approach enhances deployment reliability and maintains a clean separation of concerns, aligning with the project's architectural principles.
You see the sample how to execute in: application docker-compose file.
Related skill: api-doc-auditor for keeping generated API documentation aligned with the source code.
This project uses Springdoc OpenAPI to automatically document REST endpoints.
After starting the application, access:
Related skill: api-doc-auditor for keeping async contracts and generated docs aligned with the source code.
This project uses Springwolf to document asynchronous events (Kafka, RabbitMQ, etc.) with AsyncAPI. Kafka messages on the user-events topic follow the CloudEvents structured JSON format (application/cloudevents+json).
After starting the application, access:
The local stack also includes infrastructure services to support the application. These services are accessible on localhost and provide essential functionalities:
Related skill: observability for the local OpenTelemetry, Prometheus, Grafana, and Jaeger stack.
See the stack: docker-compose-observability.yaml
See the stack: docker-compose-infrastructure.yaml
These services are orchestrated using Docker Compose to ensure seamless setup and operation in a local development environment.
Related skills: docs as the entrypoint, then docs-spec, docs-adr, docs-design-doc, docs-runbook, and docs-selective-persistence.
This template treats documentation as an active part of delivery, guided by repository skills instead of ad-hoc files. The entry point is .agents/skills/docs/SKILL.md, which decides whether the change needs durable documentation, whether an existing document should be updated, or whether explicitly no new document is needed.
The flow works like this:
This keeps documentation lean, decision-oriented, and connected to execution instead of turning every discussion into a permanent artifact.
Read more about this perspective in Documentacao na era da IA: quando a documentacao vira contexto de execucao (Portuguese).
Pull Requests are welcome. For significant changes, please open an issue first to discuss what you would like to change. Make sure to update tests as appropriate.
Architecture Template Project proposed by Guilherme Biff Zarelli
Good software design, as Robert C. Martin emphasizes in his book Clean Architecture: A Craftsman's Guide to Software Structure and Design, aims to * minimize the human resources required to build and maintain a system*. This project template draws inspiration from real-world challenges and experiences, providing a comprehensive perspective on building durable, maintainable architectures.
"The only way to go fast, is to go well."
– Robert C. Martin
| Back | FazBrowse Home | New Git URL |