[JAVA] Projeto exemplo de uma arquitetura modular em Java

Overview

Issues Forks Stars Release Version WorkFlow Codacy Badge Coverage Status

Arquitetura modular

O objetivo do bom design de software, como já diria Robert C. Martin, em seu livro 'Clean Architecture: A Craftsman's Guide to Software Structure and Design', é minimizar os recursos humanos necessários para construir e manter um determinado sistema.

Esse projeto é inspirado em situações e dificuldades reais já vivenciadas que nos permitiu ter uma visão um pouco mais abrangente sobre como ter e construir uma arquitetura duradoura. "The only way to go fast, is to go well." - Robert C. Martin

Modelo proposto

Foco no negócio

domain

A camada mais restrita de todas possui o mapeamento de regras e restrições do domínio do negócio.

use-case

Determina o comportamento da funcionalidade exigida, no caso, o use case será o orquestrador do domínio.

Adaptadores

input

Camada de apresentação do sistema, nela, por exemplo, iremos fornecer nossos end-points.

output

Todo acesso a dados seja banco e/ou api's expostos pelas 'interfaces' do Use Case devem ser implementadas nessa camada.

Testabilidade

Facilidade na execução dos testes com uma melhor granularidade.

Unitários

Aceitação (acceptance-test)

Teste do ponto de vista de quem irá consumir, sempre buscando o mais perto de produção.

O que tem:

O que não tem:

  • Framework (Spring ou quarkus)

Fluxo de dependências das camadas

Executando o projeto

O Projeto conta com uma stack configurada no docker-compose completa. Fornecendo toda infraestrutura necessária para o desenvolvedor.

Requerido

  • Java 11+
  • Maven 3+
  • docker
  • docker-compose

Build do projeto, já com todos os testes unitários e os testes de aceitação

mvn clean install

Gerando imagem docker com o Quarkus

docker build  -t helpdev/app-quarkus-jvm .

Iniciando serviço

O comando sobe toda infraestrutura necessária para a aplicação

docker-compose -f .docker-compose/stack.yml up

Agora podemos iniciar nossa aplicação

docker-compose -f .docker-compose/quarkus-app.yml up

Consumindo API

Para ter uma 'interface' de fácil com o OpenAPI consumido usamos o RapiDoc.

Basta acessar Endereço local e já pode testar as APIs

Rodando teste de carga

Para quem ainda não conhece o k6 é uma ferramenta para testes de carga, basta Instalar o K6 e executar o comando:

k6 run  k6/script.js

O tempo de execução do K6 e quantidade de 'execuções' é configurável, basta alterar o Script do K6.

Monitorando aplicação

Observabilidade

Saber como a aplicação está se comportando e métricas

A combinação poderosa entre o Grafana e o Prometheus permite gráficos e alerta configuráveis. Acessando o Grafana Local já basta navegar até o dashboard précadastro e ter uma amostrado dos dados da aplicação e das ferramentas.

Já o Promehteus Local só acessar o link (sem login):

Acessando o banco de dados

Ao acessar o Adminer é possível executar 'scripts' SQL além de adicionar e alterar dados dentro das tabelas.

Links

Desenvolvedores

Alisson Medeiros

Guilherme Biff Zarelli

Contribua

Pull Requests são bem-vindos. Para mudanças importantes, abra uma 'issue' primeiro para discutir o que você gostaria de mudar. Certifique-se de atualizar os testes conforme apropriado.

Licence

Apache-2.0

You might also like...

Este é um projeto Maven que contém vários métodos e classes criados, além de vários testes unitários. Os métodos desse projeto não contém uma implementação de fato, sendo assim você desenvolvedor(a) deverá escreve-lo.

Complete o código em Java O projeto tem como objetivo auxiliar aqueles que estão iniciando sua jornada em programação, mais precisamente, em Java. Est

Nov 3, 2022

Projeto criado para teste de uso de arquitetura hexagonal. Usando testes integrados e relatório de cobertura de testes. Banco MongoDB com objetos dentro de objetos.

NotasBackEndJavaHexagonal Projeto criado para teste de uso de arquitetura hexagonal. Usando testes integrados e relatório de cobertura de testes. Banc

Jan 27, 2022

Esse repositório disponibiliza uma versão zero de uma API de cadastro de usuários (Users) a ser melhorada com desafios ☕️ 🇧🇷

java-training-api Esse repositório disponibiliza uma versão zero de uma API de cadastro de usuários (Users) na pasta SRC a ser melhorada. DESAFIOS Os

Dec 22, 2022

um projeto até q bem feito pra uma primeira vez em java spring

todo-list-java-spring um projeto até q bem feito pra uma primeira vez em java spring boot eu não sei como roda isso e nem como configura se não gostou

Jun 9, 2022

Projeto criado no Santander Dev Week 2022 + DIO com o intuito de desenvolver uma camada de APIs (backend) que será utilizada pelo frontend.

Santader Dev Week + DIO 2022 - APIs Backend da aplicação de movimentação financeira Este repositório contém o backend da aplicação que foi desenvolvid

Sep 7, 2022

Arquitetura Hexagonal utilizando Spring

Arquitetura Hexagonal utilizando Spring

Exemplo de arquitetura Hexagonal feita em Spring Esse projeto foi feito para explicar melhor sobre a arquitetura Hexagonal, podendo ter sido feito com

Jan 3, 2023

Projeto de LAB: Conhendo o projeto Spring data JPA com Java na prática

Conhecendo o Projeto Spring Data JPA na Prática Sejam bem-vindos ao projeto de LAB Conhecendo o Projeto Spring Data JPA na Prática oferecido gratuitam

Dec 31, 2022

Projeto desenvolvido durante a semana Spring React , onde utilizamos Netlify e Heroku para subir o projeto na nuvem

Projeto desenvolvido durante a semana Spring React , onde utilizamos  Netlify e Heroku para subir o projeto na nuvem

projeto-sds3 BACKEND DO PROJETO - https://sds3-backend-guilhermepontes.herokuapp.com/ FRONT END DO PROJETO - https://sds3-guilhermepontes2.netlify.a

Aug 18, 2021

A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs

Smack About Smack is an open source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android. A pure

Dec 28, 2022

The modular web framework for Java and Kotlin

∞ do more, more easily Jooby is a modern, performant and easy to use web framework for Java and Kotlin built on top of your favorite web server. Java:

Dec 16, 2022

modular and modern graph-theory algorithms framework in Java

Erdos is a very light, modular and super easy to use modern Graph theoretic algorithms framework for Java. It contains graph algorithms that you can a

Aug 14, 2022

Genson a fast & modular Java Json library

Genson Genson is a complete json - java conversion library, providing full databinding, streaming and much more. Gensons main strengths? Easy to use

Jan 3, 2023

A modular, high performance, headless e-commerce(ecommerce) platform built with Java,Springboot, Vue.

A modular, high performance, headless e-commerce(ecommerce) platform built with Java,Springboot, Vue.

What is Shopfly? Shopfly is modular, high performance, headless e-commerce(ecommerce) platform built with Java,Springboot, Vue. Architecture Shopfly i

Jul 17, 2022

A modular, high performance, headless e-commerce(ecommerce) platform built with Java,Springboot, Vue.

What is Shopfly? Shopfly is modular, high performance, headless e-commerce(ecommerce) platform built with Java,Springboot, Vue. Architecture Shopfly i

Apr 25, 2022

An open source, modular alternative of sketchware. Create your own app in android using block programming like scratch!

An open source, modular alternative of sketchware. Create your own app in android using block programming like scratch!

OpenBlocks An open source, modular alternative of sketchware. Create your own app in android using block programming like scratch! What is OpenBlocks?

Dec 16, 2022

Modular and customizable Material Design UI components for Android

Material Components for Android Material Components for Android (MDC-Android) help developers execute Material Design. Developed by a core team of eng

Jan 3, 2023

Modular Apache commons compress

Kala Compress This project is based on Apache Commons Compress. Kala Compress has made some improvements on its basis: Modularization (JPMS Support),

Feb 22, 2022

An extremely flexible yet vanilla-esque multiblock mod, that embraces aspects of MultiblockTweaker and Modular Machinery.

Multiblocked Multiblocked (mbd) is an extremely flexible yet vanilla-esque multiblock mod, that embraces aspects of MultiblockTweaker and Modular Mach

Jan 4, 2023

Desafio Alura Challenge para backend. Criando uma API REST de controle de orçamento utilizando JAVA.

Desafio Alura Challenge para backend. Criando uma API REST de controle de orçamento utilizando JAVA.

Jun 16, 2022
Comments
  • build(deps): bump jackson-databind from 2.11.3 to 2.12.6.1

    build(deps): bump jackson-databind from 2.11.3 to 2.12.6.1

    Bumps jackson-databind from 2.11.3 to 2.12.6.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • build(deps): bump mysql-connector-java from 8.0.25 to 8.0.28 in /acceptance-test

    build(deps): bump mysql-connector-java from 8.0.25 to 8.0.28 in /acceptance-test

    Bumps mysql-connector-java from 8.0.25 to 8.0.28.

    Changelog

    Sourced from mysql-connector-java's changelog.

    Changelog

    https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/

    Version 8.0.29

    • Fix for Bug#21978230, COMMENT PARSING NOT PROPER IN PREPSTMT.EXECUTEBATCH().

    • Fix for Bug#81468 (23312764), MySQL server fails to rewrite batch insert when column name contains word select.

    • Fix for Bug#106435 (33850099), 8.0.28 Connector/J has regressive in setAutoCommit after Bug#104067 (33054827).

    • Fix for Bug#106240 (33781440), StringIndexOutOfBoundsException when VALUE is at the end of the query.

    • Fix for Bug#106397 (33893591), Contribution: fix: fix LocalizedErrorMessages.properties doc: less then -> ... Thanks to Jianjian Song for his contribution.

    • Fix for Bug#77924 (25710160), JDBC SOCKS SHOULD NOT PERFORM LOCAL DNS RESOLUTION.

    • Fix for Bug#82084 (23743938), YEAR DATA TYPE RETURNS INCORRECT VALUE FOR JDBC GETCOLUMNTYPE().

    • Fix for Bug#106441 (33850155), Add charset mapping for utf8mb3.

    • WL#15048, Upgrade Protocol Buffers dependency to protobuf-java-3.19.4.

    • Fix for Bug#106065 (33726184) Contribution: BigDecimal.toPlainString no need to check decimal exponent. Thanks to Baoyi Chen for his contribution.

    • Fix for Bug#106171 (33757217), Contribution: Remove unnecessary boxing in ResultSetImpl. Thanks to Ningpp Ning for his contribution.

    • Fix for Bug#25701740, STMT EXECUTION FAILS FOR REPLICATION CONNECTION WHEN USECURSORFETCH=TRUE.

    • Fix for Bug#33723611, getDefaultTransactionIsolation must return repeatable read.

    • Fix for Bug#38954 (11749415), DATA TRUNCATION WHILE USING BIT(1) IN STORED PROCEDURE WITH INOUT TYPE.

    • Fix for Bug#85317 (25672958), EXECUTE BATCH WILL THROW NULL POINTER EXCEPTION WHERE THE COLUMN IS BLOB!

    • Fix for Bug#105915 (33678490), Connector/J 8 server prepared statement precision loss in execute batch.

    • Fix for Bug#104349 (33563548), com.mysql.cj NPE.

    • Fix for Bug#62006 (16714956), JAVA.IO.NOTSERIALIZABLEEXCEPTION: JAVA.IO.STRINGREADER WHEN PROFILESQL=TRUE.

    • WL#14750, Better unification of query bindings.

    • WL#14834, Support for FIDO authentication.

    • WL#14835, Align TLS option checking across connectors.

    ... (truncated)

    Commits
    • 7ff2161 Updating copyright years
    • b13af38 Fix for DateTimeTest according to changes in MySQL server.
    • 5c7b775 Update in test for Bug#96900 (30355150).
    • e1169ee Fix for Bug#99260 (31189960), statement.setQueryTimeout,creates a database co...
    • 05778ef Fix for Bug#103324 (32770013), X DevAPI Collection.replaceOne() missing match...
    • 48219f2 Fix for Bug#105197 (33461744), Statement.executeQuery() may return non-naviga...
    • 24cf7e2 Fix for Bug#105323 (33507321), README.md contains broken links.
    • ad46620 Fix for Bug#96900 (30355150), STATEMENT.CANCEL()CREATE A DATABASE
    • 4d19ea1 Fix for Bug#104067 (33054827), No reset autoCommit after unknown issue occurs.
    • bc45d35 Fix for Bug#85223 (25656020), MYSQLSQLXML SETSTRING CRASH.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v2.0.0)
Owner
HelpDEV
Help the developers | Owner: https://github.com/gbzarelli
HelpDEV
Java client for Consul HTTP API

consul-api Java client for Consul HTTP API (http://consul.io) Supports all API endpoints (http://www.consul.io/docs/agent/http.html), all consistency

Ecwid 402 Jan 6, 2023
Apache Dubbo is a high-performance, java based, open source RPC framework.

Apache Dubbo Project Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit official site for quick start and document

The Apache Software Foundation 38.3k Jan 9, 2023
Lightweight framework for building java microservices

Ja-micro Ja-micro is a lightweight Java framework for building microservices. Introduction Ja-micro is a framework that allows developers to easily de

Sixt 621 Aug 21, 2022
WSO2 Microservices Framework for Java (MSF4J)

Build status: WSO2 Microservices Framework for Java (MSF4J) WSO2 Microservices Framework for Java (MSF4J) is a lightweight high performance framework

WSO2 359 Dec 27, 2022
Sample application demonstrating an order fulfillment system decomposed into multiple independant components (e.g. microservices). Showing concrete implementation alternatives using e.g. Java, Spring Boot, Apache Kafka, Camunda, Zeebe, ...

Sample application demonstrating an order fulfillment system decomposed into multiple independant components (e.g. microservices). Showing concrete implementation alternatives using e.g. Java, Spring Boot, Apache Kafka, Camunda, Zeebe, ...

Bernd Ruecker 1.2k Dec 14, 2022
Source Code for 'Pro Java Microservices with Quarkus and Kubernetes' by Nebrass Lamouchi

Apress Source Code This repository accompanies Pro Java Microservices with Quarkus and Kubernetes by Nebrass Lamouchi (Apress, 2021). Download the fil

Apress 24 Oct 31, 2022
Define Java service providers by annotating them directly

Annotated Service Provider Define JVM service providers by annotating the provider class directly. This annotation processor will add to the class-pat

Emily 5 Oct 31, 2021
Takin is an Java-based, open-source system designed to measure online or test environmental performance test for full-links, Especially for microservices

Takin is an Java-based, open-source system designed to measure online environmental performance test for full-links, Especially for microservices. Through Takin, middlewares and applications can identify real online traffic and test traffic, ensure that they enter the right databases.

ShulieTech 1.2k Dec 21, 2022
🏋️‍♀️ Construindo Uma Arquitetura Baseada em Microservices

A prova de Arquitetura de Software consiste nas seguintes atividades: - Utilizando-se Spring Cloud, implementar uma arquitetura baseada em microservice - Deve ter um API Gateway, Service Discovery (Eureka) e ao menos 3 Microservices - Cada um dos 3 microservices deve ter uma REST API - Para a REST API, deve criar a documentação com Swagger - Deve ser enviado printscreen do Eureka e do funcionamento dos 3 Microservices

Giovane A. Tiburcio 3 Mar 31, 2022