Skip to content
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
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Directorios de Maven
target/

# Archivos de configuración locales
*.iml
.idea/
*.classpath
*.project
*.settings/
*.factorypath

# Archivos de sistema
.DS_Store
Thumbs.db

# Archivos de configuración de IntelliJ
*.ipr
*.iws
*.bak
*.swp

# Archivos de log
*.log

# Archivos de compilación
*.class

# Archivos de compilación de Java
*.jar
*.war
*.ear

# Configuración de sistema operativo
*.swp
.sass-cache/
.vscode/

# Archivos específicos de ambiente
.env
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions ENTREGABLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# API OPERACIONES-MS
Servicio que registra operaciones transactionales manejando eventos en diferentes topicos creados. Correctamente aunthenticado y autorizado para ejecución de cada recurso.

# Tecnologia y Herramientas

* Ide Intellij
* Spring Boot para creacion y configuracion de proyecto
* Desarrollo para Webflux
* MongoDB para persistencia reactiva.
* Estructura de Proyecto con modelo MVC
* Kafaka para gestion evento y topicos
* Spring Security para manejo de Authenticacion y Authorizacion
* JWT para manejo de token en validacion de metodos y creacion de usuarios.
* OpenAPi para documentacion y contratos de la api.
* JUnit5 para test de las clases utilizadas.

# Entregas del Proyecto

* Repositorio de GitHub con el código fuente
* Git https://github.com/Jemn/java-code-challenge/commits/main/
* Postman para hacer pruebas de la api. /resource/collection-postman/Interbank.postman_collection.json
* Mongo db Json /resource/mongo-db/challenge_prod.table_role.json - challenge_prod.table_user.json - challenge_prod.table_transaction.json
* Documentacion /resource/documentacion/api-docs.yaml
32 changes: 32 additions & 0 deletions HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.2/maven-plugin)
* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.2/maven-plugin/build-image.html)
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data)
* [Validation](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#io.validation)
* [Spring Data Reactive MongoDB](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#data.nosql.mongodb)
* [Spring Reactive Web](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.reactive)
* [Spring Security](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security)

### Guides
The following guides illustrate how to use some features concretely:

* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
* [Validation](https://spring.io/guides/gs/validating-form-input/)
* [Accessing Data with MongoDB](https://spring.io/guides/gs/accessing-data-mongodb/)
* [Building a Reactive RESTful Web Service](https://spring.io/guides/gs/reactive-rest-service/)
* [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
* [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
* [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)

### Maven Parent overrides

Due to Maven's design, elements are inherited from the parent POM to the project POM.
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
To prevent this, the project POM contains empty overrides for these elements.
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.

34 changes: 25 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
version: "3.7"
services:
postgres:
image: postgres:14
mongo:
image: mongo:4.4
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- "27017:27017"
volumes:
- mongo-data:/data/db

zookeeper:
image: confluentinc/cp-zookeeper:5.5.3
environment:
ZOOKEEPER_CLIENT_PORT: 2181

kafka:
image: confluentinc/cp-enterprise-kafka:5.5.3
depends_on: [zookeeper]
depends_on:
- zookeeper
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
Expand All @@ -23,6 +25,20 @@ services:
KAFKA_JMX_PORT: 9991
ports:
- 9092:9092

app:
image: api-operaciones-ms
build:
context: .
dockerfile: Dockerfile
depends_on:
- mongo
- kafka
environment:
- SPRING_DATA_MONGODB_URI=mongodb://mongo:27017/challenge_prod
- KAFKA_BOOTSTRAP_SERVERS=kafka:29092
ports:
- "8083:8083"

volumes:
oracle-data:
oracle-backup:
mongo-data:
12 changes: 12 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Usa una imagen base de Maven para construir el proyecto
FROM maven:3.8.1-openjdk-17 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -DskipTests

# Usa una imagen base de OpenJDK para ejecutar el proyecto
FROM openjdk:17-jdk-slim
WORKDIR /app
COPY --from=build /app/target/challenge-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
Loading