# jhtc5898/transaccionessofka architecture

> Architecture diagram of the GitHub repository jhtc5898/transaccionessofka, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jhtc5898/transaccionessofka
- Repository: https://github.com/jhtc5898/transaccionessofka

## Overview

##### Project type and purpose
- This is a container-based, microservices architecture for managing client movements and transactions, with service discovery (Eureka), asynchronous messaging (Kafka), and per-service Postgres databases. An orchestrator service composes functionality across other services.

##### File structure
- Top-level modules:
- Movimientos_Cliente – client-oriented REST service (produces Kafka events)
- Movimientos_Entidad – exposes entity data (CRUD on accounts, clients, movements)
- Movimientos_Transaccion – transaction processor (consumes client events via Kafka, writes to its DB, exposes reports)
- Movimientos_Eureka – Eureka service registry/discovery
- Orquestador – orchestrator that invokes each microservice via HTTP to compose end-to-end flows
- Each service contains: Dockerfile, application.properties, Maven wrapper, src/main/java, tests, SQL init scripts, docker-compose snippets, and configDocker artifacts.
- Root docker-compose.yml and supporting kafka.yml, postgres.yml orchestrate all containers.

##### README
- Confirms container-based architecture.
- Command “docker-compose up” spins up all services.
- Eureka dashboard available at localhost:8761.
- Postman collection provided for API testing.

##### Detail level
- Microservice as an independent “container.”
- Inside each, optionally note key packages (controllers, services, repos).
- Init SQL sequence for each Postgres.
- Docker-Compose networks or volumes.

## Diagram (Mermaid)

```mermaid
flowchart TB
    external("Client (Postman/Browser)"):::external
    orchestrator("Orquestador Service"):::orchestrator
    serviceRegistry("Eureka Service\nport: 8761"):::eureka
    zookeeper("Zookeeper"):::kafka
    kafkaBus("Kafka Cluster"):::kafka

    subgraph "Microservices"
        direction TB
        clientService("Movimientos_Cliente Service"):::service
        entityService("Movimientos_Entidad Service"):::service
        transactionService("Movimientos_Transaccion Service"):::service
    end

    subgraph "Databases"
        direction TB
        dbClient[(Postgres DB\nCliente)]:::db
        dbEntity[(Postgres DB\nEntidad)]:::db
        dbTransaction[(Postgres DB\nTransaccion)]:::db
    end

    external -->|"HTTP Request"| orchestrator
    orchestrator -->|"Service Discovery"| serviceRegistry
    orchestrator -->|"HTTP Request"| clientService
    orchestrator -->|"HTTP Request"| entityService
    orchestrator -->|"HTTP Request"| transactionService

    clientService -->|"Registers"| serviceRegistry
    entityService -->|"Registers"| serviceRegistry
    transactionService -->|"Registers"| serviceRegistry
    serviceRegistry -->|"Discovery Response"| orchestrator

    clientService -->|"Read/Write"| dbClient
    entityService -->|"Read/Write"| dbEntity
    transactionService -->|"Read/Write"| dbTransaction

    zookeeper -->|"Manages"| kafkaBus
    clientService -.->|"Kafka Produce"| kafkaBus
    kafkaBus -.->|"Kafka Consume"| transactionService

    click serviceRegistry "https://github.com/jhtc5898/transaccionessofka/tree/main/Movimientos_Eureka/"
    click clientService "https://github.com/jhtc5898/transaccionessofka/tree/main/Movimientos_Cliente/"
    click entityService "https://github.com/jhtc5898/transaccionessofka/tree/main/Movimientos_Entidad/"
    click transactionService "https://github.com/jhtc5898/transaccionessofka/tree/main/Movimientos_Transaccion/"
    click orchestrator "https://github.com/jhtc5898/transaccionessofka/tree/main/Orquestador/"
    click dbClient "https://github.com/jhtc5898/transaccionessofka/blob/main/Movimientos_Cliente/postgres.yml"
    click dbEntity "https://github.com/jhtc5898/transaccionessofka/blob/main/Movimientos_Entidad/postgres.yml"
    click dbTransaction "https://github.com/jhtc5898/transaccionessofka/blob/main/Movimientos_Transaccion/postgres.yml"
    click kafkaBus "https://github.com/jhtc5898/transaccionessofka/blob/main/Movimientos_Cliente/kafka.yml"
    click rootCompose "https://github.com/jhtc5898/transaccionessofka/blob/main/docker-compose.yml"

    classDef service fill:#2196F3,stroke:#1E88E5,stroke-width:2px;
    classDef db fill:#4CAF50,stroke:#388E3C,stroke-width:2px;
    classDef kafka fill:#FF9800,stroke:#F57C00,stroke-width:2px;
    classDef eureka fill:#9C27B0,stroke:#7B1FA2,stroke-width:2px;
    classDef orchestrator fill:#009688,stroke:#00796B,stroke-width:2px;
    classDef external fill:#607D8B,stroke:#455A64,stroke-width:2px;
```
