Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Challenge - Luis Medina (Hexagonal Architecture - Spring Boot - Kafka - GraphQL) #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
32 changes: 32 additions & 0 deletions microservices/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
38 changes: 38 additions & 0 deletions microservices/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Getting Started

Cada microservicio se ha construido siguiendo el patrón de diseño "Arquitectura Hexagonal"

### Microservicios

* **transaction-bff:** Backend for FrontEnd, usando GraphQL.
* **transaction-ms:** Creación, actualización y consulta de transacciones.
* Envía peticiones asíncronas hacia el microservicio antifraud-ms(Evaluación de la transacción), mediante Apache Kafka
* Recibe peticiones asíncronas con el estado final de la transacción, mediante Apache Kafka
* **antifraud-ms:** Analiza la transacción recibida y setea el correcto estado de la ella.

### Instalación

Seguir los siguientes pasos.

1. Situarse en el file \app-java-codechallenge\docker-compose.yml y ejectuar: docker compose up
2. Crear Base de datos: yapebd
3. Ejecutar el siguiente script sql: app-java-codechallenge\script-bd **script-create_table.sql**
3. Crear los siguientes tópicos:
* kafka-console-producer --broker-list localhost:9092 --topic **topic-transaction-update**
* kafka-console-producer --broker-list localhost:9092 --topic **topic-antifraud-review**
4. Ejecutar los microservicios:
* transaction-ms
* antifraud-ms
* transaction-bff
5. Abrir navegador y escribir: http://localhost:8090/graphiql?path=/graphql
6. Existen dos llamados de recursos:
* **(Mutation) register**: Proceso de registro y evaluación de transacciones
* **(Query) getTransactionByCode**: Busca el transaction según el code
* **(Query) getAllTransactions**: Consigue todas las transacciones
7. En el PR se adjuntan pantallas de peticiones y resultados esperados






33 changes: 33 additions & 0 deletions microservices/antifraud-ms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
18 changes: 18 additions & 0 deletions microservices/antifraud-ms/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.1
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
Loading